/usr/local/kannel
just because I’m that kind of guy who likes to keep everything reasonably separated and organized. You’re free to put it anywhere.gw/
directory) has much of the information we want, but we’ll need to add a few things for our GSM modems and to interact with our web server correctly.AT
-style modem commands and typically hook up over the serial port. To get this going, I set up the smsc group in the smskannel.conf file:my-number
field contains the number of your GSM modem’s SIM chip. Again, I only allow connections from my local server, and the Ubuntu Linux serial port is on /dev/ttyS0
.smsbox
group helps configure the part of the system that dispatches SMSes received by the core SMS or receives SMSes before they’re sent out. I honestly don’t fully understand what this group really does, but it’s necessary, and pretty trivial to set up.global-sender
field is the outgoing-number of your GSM modem, which for me is the same as the my-number
field above.sms-service
group configures how Kannel gets messages to your web application. You are allowed to specify a number of these groups, each of which can “catch” incoming messages based on various criteria. My application had all messages go to one processing script, so I just set up one group that caught all incoming messages.GET
request to send the message to my application. The param phone
contains the phone number of the sender and the text
parameter contains their entire message.max-messages
value was particularly tricky and critical for me: When I first set up Kannel and tested sending messages, I would always get back '<Empty reply from service provider>'
. Setting max-messages
to tells Kannel to never send a reply directly from the incoming message (you can, of course, initiate your own response later, of course).sms-service
group and you can process this with whatever HTTP server environment you want. We’re using LAMP right now, but, again, any will do. The incoming phone number and message are in GET
parameters. You can, if you want, configure the sms-service
to send them as POST messages as well.iconv
function to do this for you.allow_url_fopen
set to On
.