What do I need to send text messages with Kannel? - php

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.

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.

J2ME PHP Push Notification

I want to work on a project which has to do with the server sending notification to the client. The client side is a j2me application and the server side script will be implemented using PHP.
I have found out i can use the push registry API in midp 2.0 for push notifications, but i don't know how to implement this such that a socket connection will be created to the server such that notification can be sent to the client via the socket connection. The notification will then trigger the start of the midlet.
How can i use the push API to create a socket connection between client and server and have notifications sent to the client?
Complete answer is here
In short, there are two ways you might want to do it
Launch the application whenever you receive this "Push SMS"
Launch the application just the next time you receive this 'Push SMS"
For situation (1), you will need to specify this in JAD file. If you do this, the application manager will take necessary steps to launch your application the next time SMS is received.
For situation (2), you will need to write code:
PushRegistry.registerConnection("sms://<port number>","Midlet-Class","*");
The above note of mine would address the issue of launching the application upon incoming SMS. After you launch you can connect to your server and post data or retrieve data. This is a practical way of implementing push for J2ME platform.
But you seem to be wanting to launch the application on incoming network connection; this means you are creating a server socket on the phone and server is trying to establish the connection to the phone applications. I did work in such a situation where the phones were deployed on Motorola's iDen network (pre-2005 era). On such networks, it is possible to assign an IP address to the phone which makes the Push upon incoming network connection feasible. But that's past, on none of the GSM/CDMA networks, atleast at consumer's end, this cannot be supported. Hope it answers your question.
You need to do two things, One you need to listen one port number on the J2ME side for the incoming sms. Next you need to attach one GMS Modem to your computer system, Now send sms using this Modem on a particular port to the mobile you are listening. You can use AT Commands to send SMS.
Please visit this Nokia Link.

Siemens MC39i GSM Modem send SMS linux

I recently bought a serial modem "Siemens MC39i GSM Modem" in an attempt to setup a script that would send SMS to customers.
Anyway its all connected up I believe it is /dev/ttyS0 and I have tried running the following code which I found elsewhere:
echo "AT
AT+CMGF=1
AT+CMGW="+775557"
> A simple demo of SMS text messaging.
+CMGW: 1
AT+CMSS=1
+CMSS: 20
" > /dev/ttyS0
The modem light flashes but nothing happens I dont receive an SMS, also no output is returned either.
Does anyone have any advice who may have done something like this before?
Thanks!
You can do that with any mobile phone connected via the serial port or USB. And while you certainly can interface to it via AT commands, you shouldn't really do it manually.
The prefered way is most certainly to use gnokii for sending sms:
exec('echo "A simple demo." | gnokii --sendsms +775557 --report');
And there are likely SMS libraries for PHP too, especially for the special charset encoding required. (But you can inspect whatever gnokii sends to the serial devfile.)

PHP Commands to USB Modem

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.

Categories