Introduction to USSD

ussd gateway

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???
Yes

No

May be!!!

A private enterprise???
Yes

No

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.

Why???


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.

MO USSD vs MT USSD
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.