Todd Pinkerton

building SMS applications

Categories: Uncategorized
Written By: todd

SMS stands for ’search message service’. It is a way to send short text messages from one mobile phone to another, kinda like email. Unlike email, your mobile phone operator charges you around 10 cents (USD) per message sent, or received.

Teenagers and Europeans love it. And the phone company loves it because those 10-cent messages really add up, to the tune of billions of dollars per year.

SMS is a great tool for web application developers — just look at the success of twitter. So how does it work, and how can you incorporate SMS into your application?

There are a few mechanisms for sending and receiving SMS. One is to use a phone or modem connected to a computer. The computer can communicate with the phone (or modem), and send or receive messages on behalf of your application. The computer can expose a web service or some other mechanism to allow your application to send or receive messages as needed. Software packages such as NowSMS exist to facilitate this.

Another way is to use email. Mobile Carriers in the USA have email-addressable handsets. If you want to send an SMS to 212-555-6789, and you know the user is on the T-mobile network, you can send email to 12125556789@tmomail.net , and it will be delivered to the handset. The carrier provides this SMTP-to-SMS gateway, but it’s not very well documented or supported. A full list of carrier email gateways are available on wikipedia.

A third way is to use an sms aggregator. This is expensive, but the best way for full-on commercial applications to send and receive SMS messages the ‘official’ way. An SMS aggregator has direct connections (SMPP) to all the major carriers, and abstracts all of their peculiarities from your application. Instead, an interface such as a web service is exposed to your application, through which you can instruct the aggregator to send messages on your behalf. When an incoming message arrives for your application, the aggregator posts a message to your application, such as an HTTP POST. You can get a different API if REST isn’t your thing.

I couldn’t find a good list of sms aggregators, but some noteworthy ones are mBlox, m-qube, telenor, clickatell, simplewire. I only have experience with mBlox, but I imagine they all operate about the same. You pay a service fee (on the order of $1000/month) plus the cost to send or receive each message. If your application uses Premium SMS, for which the user is charged a fee, then a portion of that revenue will go to you and the rest will go to the mobile operator.

Part of the reason this is so expensive is that getting your application approved by each of the carriers is a time-intensive process. Your aggregator will assign you an account rep who will walk you through the certification process. Although you don’t have to do a technical integration with each carrier, your application does have to meet their requirements. They vary from carrier to carrier — some support different charsets, some require that you respond to certain keywords like “HELP” and “STOP”. This part of the process can be very frustrating. But the good news is you end up with an application that can handle a boatload of SMS traffic, and you get support for your app from the aggregator.

To send a message to your application, the user texts to a special number known as a short code. This short code is a 5 or 6 digit number reserved specifically for your application. You need a shortcode to work with one of these aggregators, which you can reserve from http://www.usshortcodes.com/. It’s $500/month for a random code, or $1000/month if you choose your own.

other resources :

sms shortcode primer

SMS aggregator list

3 Responses to “building SMS applications”

  1. Shane Vitarana Says:

    Some great info here. Thanks Todd.

  2. doug Says:

    Thanks for the post Todd. Very informative!

  3. barnsFromOz Says:

    Thanks Todd, you’ve answered exactly my questions about understand what I
    need to to build an sms interface for a student project… good start.
    btw, isnt sms = short msg service?

Leave a Reply