PHP Commands to USB Modem - php

Please what is the AT commands in PHP compatible with Huawei USB Modem ?
i need to use these commands in script then i can send sms using the Huawei USB Modem.
thanks

The first thing you need to do is to open up the serial port with PHP. There is a class for doing this: http://code.google.com/p/php-serial/
Once open, it is as simple as this:
$serial->sendMessage("AT+CMGS=\"+1231231234\"\nHello");
Obviously, the AT commands can vary from device to device, so you will need to find out the commands for your specific device.

A saner approach would be to delegate SMS management to a specialized software, because in my experience there's more to do to manage SMS sends than just throwing a couple of bytes to a modem
network availability checks and the corresponding retries to optimize your delivery rate
capability to receive SMS'es
multipart messages
routing
...
I suggest the most excellent SMSTools it's a server software compatible with Linux and Windows, it talks with your application via regular ASCII files in specific directories (in, out, failed, ...) and has a host of other advanced functions.
To send a basic sms with default options you just have to create a text file like this one
To: 155512345
Hello, this is the text of the SMS
in the out-spool directory, on Linux that's /var/spool/sms/outgoing unless you reconfigure that path.
Best of all it's free and open source.

Related

How to read SMS from GSM Modem using AT and AT+ commands in php?

I want to read SMS received on a SIM.
SIM is inserted into GSM modem, modem is connected to my local machine using USB port.
I am using wamp on windows
After reading SMS I wan't to check whether SMS content has specific word, if yes I want to call one API. I can achieve this once I am able to read the SMS.
Also I will be scheduling this script, as I have to keep reading SMS 24X7.
Is there any library or script available for this?
You can install and make a simple config for Kannel Then use it's API or db to read incoming SMS
But it's not an easy job

Sending commands to an IP phone on the network using PHP

I have a number of phones on my network and I would like to be able to send a number to one based on extension for it to dial.
I have looked into TAPI and the PHP COM events but I don't understand it all that well and how to apply it to my setup.
Does anyone have any experience with using PHP to send commands to an IP phone on their network?
If these are Cisco IP Phones you can look at using the Ip Phone Services API: http://developer.cisco.com/web/ipps
Look specifically at "Dial" Telephony URI in the Application Development Notes
Each IP phone has a web server on it, you can use standard http(s) posts to send XML commands to the phone. You can completely control the phone in this manner.
You have to understand that client-server communication is a bit unidirectional. From iPhone to server you can easily send messages (and get responses), but to send a message from server to iPhone you have to implement socket connection between them, so the iPhone will always "listen" to what the server is "saying". Also, push notifications are a way to send messages from server to device, but it's not your case, I guess.

How to read GSM device from USB port using PHP Script ?

I have a USB GSM device which I use for Internet connection as well as for Sending SMS through the software provided by the device itself. I would like to know if is it possible to read this device from USB port using PHP server side script ?
If it is possible, how we can do it & process some actions on it like Send SMS or receive SMS ?
Currently I am using Wamp on my Windows Machine. I would also like to do this on Linux machine too but that is in the very later stage so that is not part of this question at the moment.
Thanks in advance.
There are several libraries and tutorials about how to control serial ports with PHP.
Example: https://gist.github.com/51342
Article about this http://www.communitymx.com/content/article.cfm?cid=8658A
An article about exactly what you need is here (thanks to Mathew Hall)

Sending SMS through USB interfaced GSM Modem in PHP

I have searched on Google and found that I have to use AT commands to send SMS here is the link,
http://gonzalo123.wordpress.com/2011/03/21/howto-sendread-smss-using-a-gsm-modem-at-commands-and-php/
But in this tutorial he is using serial interfaced GSM modem, is it possible to send SMS via USB interfaced GMS modem. Please guide me.
A USB interfaced GSM modem will be presenting a USB serial interface, usually / hopefully conforming to the USB CDC specification. In other words you can treat it as a virtual COM port and the tutorial you linked to will still be relevant for you.
In Unix systems you can read/write from USB and Serial port reading data from /dev/ttyS0 or /dev/ttyUSB0. You also can use a usb/serial converter. They are cheap devices. But my experience with those usb converters is very bad. Because of that I prefer to use serial/ethernet convertes. They also allow me to place the serial device in any place and not necesary close to the server. OK maybe with a GSM device is not a problem. We can place it wherever we want, but if we are using the same technique to read/write from another device (like sensors, scales, ...), this may be a problem.

What do I need to send text messages with Kannel?

I want to be able to send text messages from Linux with PHP. I've read about and installed Kannel, a free SMS gateway. When I try to use the HTTP interface, it won't send a message. Do I need something else to send text messages via kannel, like a modem?
Yes, you need a GSM modem and a SIM card from your local mobile network provider.
To setup your GSM modem, you can auto-detect its settings using wvdialconf. The output contains pertinent information such as Baud rate, which serial port is used, and the modem's initialization string.
To test that your modem works properly, you can use minicom. Minicom acts as a terminal to any serial device (in this case, a GSM modem) and, with it, you can send AT commands to your modem.
I dont know if this is a solution, but Clickatell provides a very easy to use HTML api for sending sms messages anywhere in the world. I'v been using them for several years. You only pay for the sms messages you send.

Categories