News Feed
Jobs 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

Jakub Zalas' Blog: Mocking Symfony Container services in Behat scenarios with Mockery

HotToForge.com: Installing Cherokee With PHP5 And MySQL Support On Ubuntu 9.10

Zend Developer Zone: Getting Started with MongoDB and PHP

Phish Tank: Install & Configure Apache+PHP+ZendFramework+OracleDbXe On Windows In Minutes

Adobe Developer Connection: Flex and PHP charting


Community Events











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


package hhvm install podcast code component security facebook release introduction opinion composer unittest application overview language hack framework example symfony2

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