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

NETTUTS.com: MVC for Noobs

DevShed: Building an Error Logger with the Chain of Responsibility Pattern in PHP 5

Vid Luther's Blog: Deploying Wordpress with Phing to the Rackspace Cloud

Josh Adell's Blog: Path finding with Neo4j

SitePoint PHP Blog: Building a Simple Blog App with MongoDB and PHP


Community Events

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


voicesoftheelephpant version introduction library laravel opinion interview language security laravel5 symfony api community series extension threedevsandamaybe framework podcast unittest release

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