Implementing an SMS gateway for your development project

SMS offers a flexible way to monitor your project.  While limited in the data you can convey, it works on every phone and is widely understood.  This blog post looks at SMS gateways.  These are a combination of hardware and software that enable you to receive and send bulk SMS.  Some can also connect directly into your database.

Last year we spent some time evaluating a range of SMS gateways to decide which best fits our requirements. Initially we needed to set one up for our work on the Citizen Engagement Programme. However, since SMS is increasingly an important channel for our partners, we were looking for something that will have broader applicability than this one project.

Different types of SMS gateways

Currently if you need an SMS gateway you have four basic options:

  • Use a hosted service - this means signing up with TwilioTropoClickatell or one of the many other providers. They'll often provide some free credits, but then you need to pay by credit card or PayPal for more
  • Partner with a mobile operator - this means arranging a meeting with a company like MTN, Vodafone or Orange (depending on who is present in the country you work in) and setting up a commercial or other partnership with them
  • Connect a phone or a modem to a computer - this is by far the simplest option for many people. You can start with free software like Frontline SMS which makes it easy to get started
  • Use a smartphone with an SMS gateway app - this avoids the need for a computer and can handle a higher volume of messages

The table below (adapted from one produced by Envaya) summarizes the major benefits and drawbacks of each of these methods for creating an SMS gateway:

Comparison table of SMS gateway options

Comparison table of SMS gateway options

The option you choose depends on your own requirements. Many of our partners are primarily interested in sending out bulk SMS and perhaps the occasional SMS survey. In those situations a tool like Frontline SMS is often the best place to start. It's backed by an active community and has lots of clear documentation to help you get started. There are also similar apps offered by Clickatell that are worth exploring.

What we needed from an SMS gateway

For our own work we identified three key requirements that limit the field. These are:

1. Option for local number - For many of our partner's projects it's essential that they use a local number in that country. This unfortunately rules out most of the hosted services, which often can only provide a local number in a handful of countries (un-surprisingly these are rarely in developing countries). In an earlier project we used the Clickatell API to send SMS alerts to people in East and Southern Africa. However, the SMS sent by Clickatell would originate from a UK number. This can look strange to the people receiving them and of course is expensive for them to reply to. This may change over time as Twilio and Clickatell expand the list of countries in which they offer local numbers.

2. Connect to a server over the Internet - Our applications are server based and run from a data centre in Johannesburg. While we need to send and receive SMS using local numbers (in one or more countries) we need to be able to process those SMS on our servers in Johannesburg. This means the SMS gateway must be able to communicate with a server via the Internet (preferably using a REST or similar API). This rules out many of the options that fall under the 'modem connected to a computer' category.

3. Can process reasonably high volumes of SMS - At peak we estimate that the Citizen Engagement Programme will need to send around 2000 SMS per day. While these volumes are in-significant for hosted providers or mobile operators, they may be more than some modems or phones can reliably process. Android phones for example are limited to sending 100 messages an hour (although there are ways around this). While Ushahidi and Envaya have information on sending volumes for Android devices, we've not been able to find what the limits are for other SMS gateways or devices.

To help short-list SMS gateways for a more detailed evaluation we put together a comparison table on SocialCompare. Please update the table if you come across other options to consider (or other criteria that you think are important).

Since our first project needing an SMS gateway is in Mozambique we've ruled out hosted providers. We've not been able to find any that offer a Mozambique number to send and receive SMS. Clickatell was able to offer a local short code, but at a price beyond the budget available. We've also ruled out using an SMS gateway that relies on a modem connected to a computer. We need the gateway to communicate via the Internet with our servers in South Africa.

We had some initial meetings with Vodacom, mCel and Movitel in February. However, most referred us to 'value added service providers' whose prices were higher than the other options in this post. While partnering with a mobile operator is an appealing option, it could well take some time to set up and would likely only apply in Mozambique - or at best in the countries where the mobile operator has a presence. This means following a similar process in other countries in the future.

This leaves the option of using a smartphone app that connects to the Internet via WiFi.  Envaya and Ushahidi have developed apps like this. They generally work in the following way:

  • Set up an Android phone with a SIM card for the network you want to use (this provides your local number)
  • Install the SMS app onto the Android phone via the Play marketplace (this is the software that runs the SMS gateway)
  • Turn on WiFi and connect the phone to a Wifi network (this connects the SMS gateway to the Internet)
  • Configure your server to talk to the app (SMSSync uses the HTTP and HTTPS protocols for communication between the app and the server)

The local support needed for this option is quite simple. Our partners need only ensure that the phone is kept plugged in, connected to the Internet and the balance topped up (if using a pre-paid SIM). Most problems can be solved by re-starting the phone.

What we selected

We ended up implementing a gateway using the Ushahidi SMS Sync App running off a Google Nexus One tablet. This worked well in our field trials. Sadly the project did not continue past the pilot, so we've yet to see how this approach copes with higher SMS volumes.