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

Max Horvath's Blog: How to enable the Xdebug debugger in Zend Studio for Eclipse

SitePoint PHP Blog: Data Fixtures in Symfony2

TrueLogic.org: Integrate the Mailchimp API with your PHP application

Brandon Savage's Blog: Making Zend_Navigation Useful

The Bakery - Rails-Like Validation, Elistic, Textile, and a CakePHP Release


Community Events





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


interview opinion laravel community composer mvc library release framework tool version series language update package introduction voicesoftheelephpant podcast symfony security

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