Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java USSD menu tree generation - how to

Tags:

java

ussd

I want to generate a tree-based menu using Java that will appear on a USSD browser. Each node may have children, ending with leaf nodes. I will also have to maintain state regarding each user who accesses this menu (like his current position on the menu) to facilitate navigation.

Any ideas on how I may achieve the tree generation and state management?

like image 839
Deepak Marur Avatar asked May 25 '10 07:05

Deepak Marur


3 Answers

I assume that you get a message from the gateway such as: (Session#, UserInput) and you need to compute the next information to send to the user ?

I propose:

  1. table CURRENTSTATE:
    Session#
    State

  2. table STATES:
    State
    Title

  3. table CHOICES:
    State
    Choice
    Name
    DoCode
    NewState

Then when you get the message (Session#, UserInput):

  1. query CURRENTSTATE using the Session# to determine what state the user is in.
  2. query CHOICES using the State and Choice=UserInput to determine the new state (and DoCode) based on user input.
  3. Based on DoCode, you can do some processing.
  4. update CURRENTSTATE to reflect the new state.
  5. query STATES to get the Title (e.g. "Please choose a color").
  6. query CHOICES to get the possible choices from the new state (e.g. (1, "Blue"), (2, "Red"), etc.)
  7. build the message (concat Title + choices)
  8. return message to user.

Is that a reasonable way to solve the problem ?

like image 103
Albert Avatar answered Nov 04 '22 12:11

Albert


HI, am also currently developing a USSD menu based application. Unforturnately there are scarce resources about USSD applications on the internet and i think it's because USSD unlike SMS is not yet standardized. so every telecom has their own ussd implementation. The project am working on requires a USSD gateway(run by the telecom) and my webserver(apache) which runs my app. my app written in php communicates the telecoms USSD gateway via xml fortunately for me. so i get mobile user input from the USSD gatway via xml and i also send xml pages back to the USSD server which inturn display the reply on the use's mobile phone. that's all i know.

like image 24
David Okwii Avatar answered Nov 04 '22 13:11

David Okwii


Have a look at an implementation of this problem: Vumi.org

Source code viewable at https://github.com/praekelt/vumi

like image 24
David d C e Freitas Avatar answered Nov 04 '22 11:11

David d C e Freitas