Saturday, 18 July 2015

Introduction to USSD

What is USSD?

USSD in full is Unstructured Supplementary Services Data.
USSD survey- an example of a USSD app UI

Unstructured- the data sent over this protocol between the MSP (Mobile Service Provider aka Telecom Company) has no predefefined format or an established standard to follow, its left to the discretion of the developer of the application sending the data.

Supplementary- the services offered just supplement the core job of the MSP, lets say calls and sms, supplemented by balance check, ussd based credit loading, third party services e.g bill payments, mobile banking etc.

Services- the applications/softwares running on the MSP's or the Third party provider's servers that the handset talks to via ussd protocol.

Data-of course what is exchanged over the protocol during your USSD session is kB's of data daaah!!!

All in all, USSD is a service protocol used by telecom companies to provide all gsm handsets access to softwares applications on their servers.

Most people look at USSD as a very complicated feature of Cellular technology, however, as we are already seing, there is really nothing complicated about it.

Are you a developer???
USSD applications are your normal web services. Only difference; its not served over HTTP and does not offer the all glamorous GUI features you have on smart devices and PCs.

You rather have to offer clients a stripped down and thoroughly summarized version of your service mostly broken down into menus. And depending on how much you offer, your menus will most likely have  tree structure navigated in hierarchical order.
Single USSD message

Short codes
Just as a phone number (MSISDN) identifies a subscriber on the MSP's network, so does a short code, a USSD application.

A short code has a unique format usually containing numbers punctuated by a series of stars (*) and hash (#) signs e.g *131# for checking credit (Ugandan MSPs)
short code format

When you dial a friend's phone number, your mobile handset identifies the format of the number and places the call on a voice channel.

However, if the format of the number is a short code, the mobile handset places the call on a signalling channel.

Who owns a USSD application???
The MSP???


 May be!!!

A private enterprise???


May be!!!

Okay as you can see, we are getting nowhere with this. That's the point, its quite tricky to give an absolute answer to that question.


Because there is no standard for implementation of USSD services and each MSP chooses how to deal with it in its own way.

Sometimes, an MSP may decide to outsource all its services to third party enterprises while at other times, it may choose to host all its services or do both.

If you have an enterprise and can purchase a short code from the communications regulatory authority of your country (UCC in Uganda, FCC in the US), you have gone halfway to become a third party service provider to the subscribers of the MSP.

Your next step would be to partner with the MSP so that your short code is configured on their USSD server.

When a subscriber dials the short code say *298#, the call will be received by the USSD server of MSP and then it will be routed to the appropriate software application's URL (which should be where you host your service).

Just know the USSD server deals with the short codes and matches them to URL's, whether belonging to the MSP or a third party provider.

USSD Menu's
A USSD message usually presents itself as a numbered menu from which you can select options for processing. It then takes you deeper into the menu hierarchy which resembles a typical tree structure in normal UI.

However, there is no real menu in the USSD message. What you see is just a string manipulated to appear as a menu. In most applications, including those I have developed, new line character is used to create the menu like look.

Those numbered items are not a list of menu items but rather a single string with all items appended and separated by new line character(/n or breaks(br))

Its the duty of the server to interpret this input data accordingly, return more data as per client selection, and save this data for further processing at the end of the session.

How different is USSD from SMS

  • USSD  messages are session based and only exist in the context of the session, while SMS can be stored and forwarded.
  • USSD message validity is limited to the duration of the session, while SMS can be read anytime again and again after receiving.
  • A USSD message is displayed directly on the phone screen while SMS is accessed from the messages menu.

What happens when am roaming
In roaming mode, your USSD calls are routed to the home network, therefore, you can access your favorite services from another country if you are roaming.

What this means is that if you are an MTN Uganda subscriber and go to Kenya, you will be roaming on safaricom. So if you dial *165#, you will be accessing the Mobile money application of MTN.

In addition, you can not access any safaricom service this way i.e you cant access USSD services of host network, only home network.

USSD services may be mobile originated(MO aka USSD pull) or mobile terminated (MT aka USSD push)

MO is where the subscriber:

  • dials a shortcode and starts a USSD session
  • sends a key word to a Common Short Code (CSC) i.e a number specially assigned by the MSP e.g 8198 to deal with particular kinds of one-off transactions subscribing to Value Added Services e.g caller tunes, voting e.g in Media awards such as MTV, BET awards. This key word is processed by the server and sends an appropriate response in USSD message to start a session.

MT on the other hand is where the USSD session is initiated by the server by sending a message to the subscriber's handset.

This is it for introduction to USSD cellular technology, in my next post we shall see how to start developing our own USSD applications and test them in  a simulator.


  1. Great read. I hope to follow you other stuff and get up to speed with USSD apps

    1. Thanks for appreciating, USSD is great and you wont go wrong.

  2. Your explanation is simple and clear. Thanks so much. I am really interested in programming but cannot go to school because of commitments. I just want to be good but through online relevant courses, How do I begin?

  3. Your explanation is simple and clear. Thanks so much. I am really interested in programming but cannot go to school because of commitments. I just want to be good but through online relevant courses, How do I begin?

  4. Thanks for passing by Martina Mutheu. You are not alone. It depends on your current level of programming knowledge. I would recommend Harvards CS50 which is available through EdX and it's free unless you want to be certified which will cost just $90. It's fit for even those with zero experience in programming or computer science.
    Follow this link to enroll, I am enrolled too. In case you have more questions, don't hesitate to reach me.
    NB: I stopped blogging on this site and moved to my own domain a few weeks back. You can read more of my content on and I wrote something about CS50 on this post

  5. Great work! This is the best USSD application concept explanation that i found so far. I would like to know if you can help me on one of my project which is one USSD menu driven application. Here is my email address: or you can give me your phone number I will call you.
    I'm a software engineer but this is the first time I'm working on an USSD application project.
    I look forward to hearing from you! You've done a great job!!!

    1. Thanks for appreciating Saint Paul Tinga, hope it has helped you. Send me an email and I will get back to you about this before the week ends, cheers!

    2. And one more thing, I moved from blogger to a new domain. You can read this same article here and any other newer content