Using an SMS Gateway

The instructions here are for using our premade VM to act as an SMS gateway. You will need a USB modem as well as VMWare to run this.

This system was setup using:

  •  Grandma's Lamp VM Image loaded with  Kannel SMS gateway
    • Kannel install and all conf files are in /usr/local/include/kannel
  • VMWare Server
  • Falcom Samba75 USB GPRS/EDGE modem

Giving it a try

  • Download our  vm image and fire it up. (Warning, 600+ MB file!)
  • Plug in the USB modem (if you plug it in before loading the vm in windows, windows will probably not find the drivers, this ok. plug it in again after the vm has loaded).
  • In VMWare, forward your host machine's USB devices to this Guest OS. You will want to forward the Siemens device. To do this go to the menu VM->Removable Devices->USB->Siemens Information USB modem
  • Just in case we have the  falcom drivers available for download too
  • In the Guest OS, check to see if the modem is working ok.
    • To do this, you can run lsusb as well as dmesg to find that the usb modem is running on ttyACM0. You should see something like from lsusb
Bus 001 Device 002: ID 0681:0034 Siemens Information and Communication Products
  • Next open up 2 terminal windows
  • In the first one, run
cd /usr/local/include/kannel
/usr/local/sbin/bearerbox -v 0 ./smskannel.conf

In the 2nd one, run

cd /usr/local/include/kannel
/usr/local/sbin/smsbox -v 0 smskannel.conf

Your SMS gateway is now running!

Now, let's test to see an SMS message go out. Kannel can send out SMS messages of your choosing via a GET HTTP interface.

 http://kannelhostname:13013/cgi-bin/sendsms?username=tester&password=foobar&to=6175554444&text=words+separated+by+space

To receive messages from a phone into the Kannel gateway setup, you will need to read through the smskannel.conf file and see how the listener is setup for receiving messages.

But for a simple example, let's look at an application setup:

#Services block

group = sms-service # headline to say this is for sms messages
keyword = hellophp # the initial keyword for the message to trap for this application, case insensitive
get-url = "http://hostname/echoexample.php?from=%p&to=%P&text=%r"  #you can do get-url, post-url to forward information of the inbound message to a URL endpoint for further processing
accept-x-kannel-headers = true
max-messages = 3
concatenation = true
omit-empty = true

#if you send a message that doesn't have hellophp in it, it'll reply back no service specified, saying that there was no handle for this type of message.
group = sms-service
keyword = default
text = "No service specified"

#this might be a catch all method to get ALL messages
group = sms-service
keyword =
keyword-regex = .*
catch-all = yes
max-messages = 0
get-url = "http://localhost/sms?phone=%p&text=%a"

Kannel doc links:
 sms-service

 escape codes

For more information on kannel, please see these sources (that were invaluable for the creation of this page).

The following instructions come from these two primary sources:

*  http://projects.csail.mit.edu/ict4d/wiki/index.php?title=MIT_ICT4D_SMS_Lab

*  http://chipmunkninja.com/Setting-up-Configuring-and-Using-13@