Friday, October 23, 2009

How to start USSD Application Development

Normally in order to send data to mobile subscribers handset when they requesting by dialing a code (Eg: *100#, etc) we have to get access to USSD Server of Mobile Service Provider. In Mobile Service Provider’s USSD Server we can take a Provider Account from them and Configure URL of our service there. Then when the subscriber dials the relevant code the USSD server browser will direct that request to our third party application.

In our side what we have to do is to develop the application to analyze the request send generate menus by taking data from a database and send back to the USSD server. Then USSD server will direct that response to subscriber’s hand set. The format of the response we have to make to send for the USSD Server will depend on the USSD browser in the USSD Server. May be we have to send the response in Http, XML, VXML, etc. In each response we have to add the functions to each menu item pressed by the user.


  1. Initial Steps to develop USSD Application

    So far what I hve undestood abt the architecture is as follows

    mobile <-- ussd <-- web
    phone --> server --> server

    How to reroute the requests that comes to ussd server to web server and where can i get the ussd service from?

  2. Actually that request routing part is done by the USSD server for you. What you have to do is buy the USSD server account facility with available unique short code for your service from a Mobile Service Provider (MSP). I think in Sri Lanka all mobile telecommunication service providers are providing the USSD facility.

    Then you have to configure the default URL of your 3rd party server in the MSPs USSD server. Normally, MSP is asking you to have a secure VPN connection in between the MSP’s USSD server and your 3rd party server (Requirement may be vary to MSP to MSP)

    When the mobile subscriber dials the short code from their handset the MSP will direct that request to your 3rd party server through their USSD server. Then you have to process that request and send back the response in the particular format and syntax that MSP’s USSD server API supports. (HTML, XML, VXML, etc.) Then the MSP’s USSD server will forward that response to the mobile subscriber’s handset.

    Likewise USSD session can be continued between both parties until the session timeouts or subscriber will terminates the session.

    1. Hi
      I am a HND student in software engineering please give all the code and Materials of USSD development it would be more useful for my final project
      Dev from sri Lanka

  3. hi!

    i think that to be registered with a network operator in order to use their USSD server means to be a Mobile Contents Provider(clearly it's means "create an enterprise").personnaly i never contacted any operators in my country(but i'm interested to ). do you think that operators can allow an independant to register with them?.

    Serge Mehoune

  4. Hi!
    It depends on your Mobile Service Provider. Well I don't think you will be able to engage into such deal with your Mobile Service Provider until you will be able to convince them your business goal on this USSD service you gonna provide as well as the payment that you can do for the USSD service when at the production. Yeah true. it will be easy to get a chance if you engaging with them as an enterprise. ;)

  5. hi!

    All day long, trying to post since my mobile phone... not easy LOL.

    ok! i don't understand clearly is the MoBILE Network Operator also the Mobile Service Provider or it's two differents entities?.

    Serge Mehoune

  6. I don't know about how it is going on your country. But if you are using a mobile phone you will be given a sim card which will allow you to take calls or use for USSD services, etc. So what I meant as Mobile Service Provider is that service provider.

  7. hi Dear!

    ok i think that i understand firsts steps in order to start an USSD project :

    1/- to be registred with an Mobile Network Operator
    2/- Have an USSD server Account
    3/- configure the default URL given, around a 3rd party application that give response to subscribers's requests in a format that MSP's USSD Server API supports.

    Ok personnaly, i have designed a USSD service that contains just 4 commands in the main menu of the services.
    I'm wondering if i can start writing the application program myself or contact a developer.
    so to be fixed, please can you tell me more about the complexity of an USSD application.

    For example, for an application such as this USSD "Call Me Back ",(a subscriber send an USSD code to ask an other subscriber to call him)
    how many lines of code can be written? in which language? what are the infrastructure of the GSM network that the program will seek to meet the request of the customer?

    Serge Mehoune

  8. Well. I can't give you direct answer because as I am saying every time what we have to do in our 3rd party application may differ according to the existing technology of the USSD server of the Mobile Service Provider. Don't worry about the programming language. I think programming language will not be a problem as long as we will be given a way to communicate with the USSD server API.

    If you need to give a simple service like "Call back service" and nothing to do with functional things like data manipulation,etc you may not need a 3rd party application. There are some USSD service that you can configure menu's etc in the USSD server itself using your account.

    But first you have to talk with your Mobile Service provider and get to know about their USSD server API. Without knowing that we can't decide on what to do or how complex the task is.

  9. hi! Dear

    thanks very much for your usefuls informations.
    all seems so clear, i think you are schooling me very well, for real! lol. i appreciate that.

    ok. according what you say,the way we can proceed to start developing the project depends firstable of the specifities of MSP's USSD server.

    ok. so, all i have to do right now is to contact operators in order to get informations about their USSD server or platform.

    ok, in my country their are 4 mobile operators. the leader in this local market is ZAIN.
    personnally i know somes peoples who works in 2 of this 4 mobiles operators.

    let me just contact them in order to get some informations about their USSD server specifities. i'll back to you to continue discuss about "THE PROCESS".

    " à tout à l'heure" :-)

    Serge Mehoune

  10. hi! Dear!

    As i told you last time, i started to contact operators in order to get informations about their USSD servers and how to access.

    2 days ago i received an e-mail from the Head of IT Department who work with the 4th operator in the market.

    he told me that they don't have an USSD Server but to make connection to SMS Vas, they works with somes partners.

    I was surprised a little. what do you think about that? Is really possible they can do this or it was just a way to say to me they can't accept?

    i'm still trying to contact the others operators.

    Serge Mehoune

  11. That is possible. USSD is not essential for a Mobile Service Provider. SMS is handling on SMPP Server. We can use USSD and SMPP together for our services. But MSP s can survive without USSD. :)

  12. hi! dear

    OK.thank you to fix me about this operator.:) i'm trying to contact now the leader of the market (zain gabon)

    meanwhile, i have one question about what you say in one of your previous posts. I quote you:

    "If you need to give a simple service like "Call back service" and nothing to do with functional things like data manipulation,etc you may not need a 3rd party application. There are some USSD service that you can configure menu's etc in the USSD server itself using your account"

    i'm a passionate of multimedia but i have no programming skills. So at the beginning i thought that create an USSD service requires absolutly a lot of hours on programming, to create an application, and to be a crack on C++ or Java (and i had already downloaded Code Blocks and severals tutorials to prepare myself :)LOL )

    so according what you say i see clearly the difference between a "3rd PARTY USSD APPLICATION " and a "USSD SERVICE CONFIGURATION"

    comparated to what i want to create, indeed, i think that my project will not necessary requires to create a 3rd USSD application but just to configure menu's (or commands?) in the MSP USSD server

    please, i want you to confirm me that's that. So this is the main function of my service;

    1)a Suscriber A want to pay in order to allow a subscriber B to use a given mobile service

    2)subscriber A dials the Ussd code including the subscriber B phone number. the Ussd server treat the request so that when subscriber B use the service it will be automatically charged on subscriber A credit

    3) subsciber B can continue to use the service as subscriber A pay for him. When subscriber A want to stop to pay, he just dials an USSD code including the subscriber B phone number. the MSP ussd server treat the request and turn of the service connexion between subscriber B and subscriber A's credit account.

    so what do you think about? is such kind of service could be easily configured in the MSP USSD SERVER or it will require to create a third paarty application?

    serge mehoune

  13. Well. Still I can't give you a solid answer as I don't know the technology capabilities and limitations of your MSP's USSD server. But I think it should be possible to do this with USSD server without using 3rd party application.

    I am sure this can be done with a USSD server which uses "OpenCode" technologies.

    Pls visit

  14. hi! dear!

    thanks very much for your details. i'm fixed now.
    Yes i already visited this website when i googled on the subject. indeed, they technology is very at the forefront...

    Definitely we'll be fixed when we'll get informations from operators about their USSD server. so Gonna continue my searching...


  15. hi akke
    can i have a sample code of developing a ussd menu driven application using vxml?
    Thank u

  16. <vxml>
    <menu id="mainmenu" name="mainmenu">
    <prompt>The balance of your account is is Rs.50.00</prompt>
    <property name="inputmodes" value="dtmf"/>
    <choice dtmf="1" next="#doReload">Reload</choice>
    <choice dtmf="2" next="#doTransferCredit">Transfer Credit</choice>
    <catch event="nomatch">
    <prompt>Invalid choice</prompt>
    <goto next="#mainmenu"/>
    <catch event="noinput">
    <prompt>Please try again</prompt>
    <goto next="#mainmenu"/>

    The above simple VXML code will generate the following output.

    The balance of your account is is Rs.50.00
    2.Transfer Credit

    1. Hi pubudini,

      How it will interpret and communicate with gateway?

      Thanks Venkat

  17. Hi,

    do you have any experience with dialog Sri lanka ?
    To whom i want talk to get USSD server info from dialog side
    if you can pls provide sample code to


    1. Hi!,

      Yes I have worked with Dialog. Once you get the Service from them, they will give you the API documentation of their USSD server. You can learn the syntax to communicate with the Server from it.

  18. Quite an interesting blog.I'm interested in creating both Web and USSD application. My question is how the whole logic should look like for interpreting ussd requests into data manipulations. Appreciate if you can be of assistance.

  19. Hi, My Name is riteshe.
    its is possible to develope aplication for USSD using PHP???
    if yes, can u give me a example plzzz.
    my email is


  20. Hi Pubudini,

    I was hoping you could assist me, I’ve been searching the whole day now. I am looking for any code examples on how to create a USSD Application in C#.

    This is quite urgent and your help is much appreciated.
    Please contact me on my gmail account.


  21. hi, this is very helpful topic, i just want to know how the USSD menu
    handled,developer or USSD server administrator

  22. which language am i going to use

  23. hi

    Is it possible?

    For example a country that has 3 mobile operators.

    Can i create a ussd that can be used via all these networks and then connect to my third party application.
    Or would i have to approach the three msp

    1. It is possible, but may be you should get different different approaches (specially for message engine) if the 3 MSP's USSD technologies are different.

  24. I know how USSD works but what IDE do you use to test aplications

  25. Hi,

    I want to develop a USSD based Mobile Banking App.
    Can you help in Request-Response API for the same.
    we have our own Apps for iOS & Andriod and our Platform APIs are SOAP.

    Amit |

  26. dear all,my name is kevin and I want to develop a ussd football betting application on my network operator.MNOs details are as follows.
    Name:Vodacom Tanzania Limited
    Please help me!!!!!!!!!


  27. Hi,
    I 'm kind new in developing ussd application. I want to develop an USSD application as 3rd party.i already have an account in my MSP.
    the goal is after sending an ussd request from the phone, the MSP forward it to my server that has to send an automatic appointment after searching in a MYSQL database.
    i'm just starting so i need to know is there any free ussd application that could be setup?
    Thank you bye

  28. Hi Pubudini Prasanna,
    With the proliferation of SmartPhone and Web enabled phone with internet access,and the introduction of HTML5, don't you think that USSD Applications and SMS Based services will not be a big deal anymore.

  29. Hi,

    1. Which language preferable to develop the ussd application?[any tools]
    2. What are the responsible of the USSD Gateway?
    3. Is there any simulator to acheive ussd application. with out service provider?

  30. Hi, My Name is Timothy.
    I am new to USSD but i understand the basics. I would like to know which of the two programming languages us better for developing a USSD Application among PHP and Java
    Please help me.
    my email is

  31. This comment has been removed by the author.

  32. hi my name is freddy and am interested in doing some ussd applications can you please send me a sample ussd code in php

  33. Hi,
    My name is Anu.
    I want to develop an USSD application .I would like to know if it is
    possible to create Mobile as well as Landline,could you please send
    me a ussd sample code.

  34. Hi,We have a software which creates it easily

    1. Could u send me the details to my " " mail id.

    2. Hi,kindly assist on all details regarding the software.Please assist. My mail is

  35. Thanks Pubudini for the create tutorial

    i would like to have php example i have wrote
    a simple php application but the problem
    when i dial the short code i don't get the
    answer key on the phone i think the session
    is terminating please advice.

  36. can any one share a USSD simulator

  37. please can you share a sample XML code to response to an USSD request. please my mail is i will appreciate your prompt response.

  38. pls send me a code on how to create USSD app with either c++ or java, or any language email is

  39. Hi I'm Sarath. Actually Im new in USSD application development , I want to to develope an application in java. Please help me with this

  40. Hi Pubudini, i'm new to USSD too, and i plan to use php, any sample code you have will help a great deal, email @, thanks 8)

  41. HI Pubudini, i appreciate the informatiomn posted on your blog. i would like to learn more about USSD development using either java or php. please advice me on the same, if you have materials or details concerning the same, please mail me to or

  42. Hi Pubudini,
    I'm currently working on settig up a ussd menu, using Dialogic softwares.
    Could you please send me a USSD sample code AND sample XML code to response to an USSD request?
    My e-mail address is:

  43. Hi ,
    Can you give an example of the type of result USSD Gateways sends to the Application server??. Its very Important. Can you give a reply as quick as possible?. It would help me a lot.
    Thank You,

  44. Hi,

    Do you know any good USSD GW Simulators ??


  45. how to start an ussd server


  46. hi pubudini

    can i have a sample code of developing a ussd menu driven application using C# code ?

    Thank u

  47. Thanks for explaining the working of USSD Application. I understood it clearly.

  48. hi ,
    I wanted to know that how are USSD messages affected by DND services ?
    Are even push USSD messages allowed ?
    If some online portal wants to send information through USSD

  49. Everyone who wants to get started the development of USSD applications, there you have a good way to start:‎

  50. hello,Pubudini , is there a source of information where i can learn programming for USSD from scratch.

  51. Hi
    I was recently involved in a website development project, and the client wanted his customers to be able to query the database for information regarding their accounts such as the balance etc. through ussd. that is they would send their policy number to a specific number we provided and receive details about their account in form of an sms from the database. This is how we did it:
    >We developed the website in php, html and css
    >We installed a server locally on our computer (xampp, for development purposes)
    >Then we used eclipse IDE (java) to write code to handle our ussd server requests. We could also use a mobile simulator to display our results.
    > We used a modem as the gateway (sort of) Am not sure how to explain that. Since we were in the development phase, it dint seem viable to contact a MSP for an account until the project was completed and tested.
    The great thing about java is that it has a vast library to help you do stuff and you can even add your own. So for our project to work we included the java sms library org.aiti.sms

    Check out for an overview of how things work. I am still learning how to develop a complete ussd application.

    I hope I have made sense. Thanx

    1. Plz help me in order to develop ussd full application without a service provider my email ""

  52. Hi
    I am new to this and I want to develop an ussd application.So any 1 please send the details at

  53. Hi,
    I am very interested about this topic and I want to know where you are with it. I read all the previous posts and I want to know how to get started. I've already downloaded the Leibict udk simulator and now I want to write a java program that will receive a code like #xxxx*xxxxxx# and will query a database to return a text for example. What do I need to understand and know how to program ussd applications with java. My email address:

  54. HI Pubudini, i appreciate the informatiomn posted on your blog. i would like to learn more about USSD development using either java or php. please advice me on the same, if you have materials or details concerning the same, please mail me to much regards

  55. Hi pubudini. I appreciate all you helping guys on this blog.Am new t it and also would need some help.I am a student in Cameroon and a MSP(MTN CAMEROON) just made availaible APIs to develop on its platform including USSD applications. I want to build and application and virtuall don't know how o go about it.i have read through the API documentations still am not clear with;
    1- where do I start, I have never used an API before in programming. I don't know if I am to write a program in another language say j2me and then include in the API or I have to use the APIs from start.

    2- would any particular programming language be of interest or I cn just write in anyand then intergrate with APIs. PLease I really would appreciate any help from the community.this is the link to the APIs and documentations

  56. Also Is it possible to have USSD application that can collect information from users (say input texts, in several pages linked with NEXT buttons ) and then send them back to a server for processing. If not what would be the better way of implementing such an APP so that all kind of mobile phones ( smart and feature(unsmart) ) can access it.

  57. Sir,

    Can I have a sample code of a USSD application in php or java

  58. Awesome artilce finaly i got to understand clearly and in simple words how Ussd word.Now i want develop the application to analyze the request send generate menus in and C# can i can a simple code on it