News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Howto Send/Read SMSs using a GSM modem, AT+ commands and PHP
March 22, 2011 @ 08:15:27

Gonzalo Ayuso has a new post to his blog today showing how you can send and read SMS messages with PHP through a GSM modem. The AT+ commands they use can be sent via a serial (or serial-to-usb) interface directly from your application to a local device. He includes both code and some sample AT commands to get the ball rolling.

GSM modems are similar than normal modems. They've got a SIM card and we can do the same things we can do with a mobile phone, but using AT and AT+ commands programmatically. That's means we can send (and read) SMSs and create scripts to perform those operations. [...] The idea is the following one: We are going to create a main class called Sms. It takes in the constructor (via dependency injection) the HTTP wrapper or the serial one (both with the same interface).

His base SMS class provides open, close and read methods that talk with the device set in a child class (in this case "/dev/ttySO"). The sendSMS method is defined to take in the number to send to and the message. The AT command examples show how to send the SMS message, read all of the messages waiting and delete an SMS from the device. You can get the full code from github.

0 comments voice your opinion now!
sms read send tutorial gsm modem tty


blog comments powered by Disqus

Similar Posts

DZone.com: How to Use Flash for File Upload with PHP

Josh Adell's Blog: PHP Fog Quickstart

Stefan Mischook's Blog: New PHP article in Web Designer Magazine

Experimentalworks Blog: DTracing PHP

Community News: PHPBenelux 2013 Tutorial Sessions Announced


Community Events

Don't see your event here?
Let us know!


opinion yii2 podcast application framework example language list project interview symfony community laravel part2 api php7 programming composer series introduction

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework