Hierarchical SMS menu management [Proposal]

Proposed by: Nirmalya Lahiri [nirmalyalahiri at yahoo dot com]

Proposal for hierarchical menu management feature while accessing Sahana through Short Message Service(SMS) of mobile phone.

Objective

  • Add dynamic feature to menu creation.
  • Build hierarchical menu up to unlimited depth.
  • Add session based for menu management through SMS.
  • Add feature to keep record of menu traversal path.
  • Add “position remember” feature in menu management. System will keep remember of current position in menu for session period.

Proposed menu structure

In proposed design system can be accessed by hierarchical menu structure. As per proposed design the system can have unlimited number of level in the menu.

  • Top menu can not be accessible by user. It is only accessible by system.
  • Every level has some reserved menu label.
  • Except reserved menu label, unlimited number of menu label can be added into the menu.
  • Every level has a “help” menu. So, any one can ask for help from any level of menu.
  • Every level has a “previous” menu label. It required to jump to upper level of the menu.

Example menu diagram

Proposed database table structure

To add dynamic feature in menu management, menus are kept inside database table. To keep the hierarchical menu inside the database table a special table structure is required.

CREATE TABLE msg_menu_structure (
    menu_id varchar(6) NOT NULL UNIQUE KEY,
    menu_desc varchar(20),
    parent_menu_id varchar(6),
    PRIMARY KEY(menu_id),
    FOREIGN KEY(parent_menu_id) REFERENCES msg_menu_structure(menu_id)
);

The proposed design has another table to keep remember of traversal path through the hierarchical menu.

CREATE TABLE msg_current_menu_position (
    sender char(32) NOT NULL,
    event_time DATETIME,
    menu_position varchar(6) NOT NULL,
    PRIMARY KEY(sender,event_time),
    FOREIGN KEY(menu_position) REFERENCES msg_menu_structure(menu_id)
);

Proposed functional changes

Current system has a linear menu structure, which is based on a set of KEYWORDS. Proposed system has multilevel menu structure. To implement that the proposed design maintain multilevel of keywords in database level, and dynamical generate keywords for particular level.

List of functions need to be updated

  • Newly propose function shn_msg_keyword_generate() need to call from this function.
function _shn_msg_sms_keyword_check($keyword, $sender){
...
shn_msg_keyword_generate($sender);
...
}
  • Need to separate control switching operation from module operation function like _shn_msg_sms_login(), _shn_msg_sms_help(), _shn_msg_sms_sm().
function _shn_msg_sms_action($parsed_sms, $sender_phone_number){
...
...
}
  • Function needed to be change, because at the time of login an initiation is required for menu traversal.
function _shn_msg_sms_login($parsed_sms, $sender_phone_number){
...
...
}

List of functions need to be added

All these functions are required for new proposed design.

  • Function needed to generate keyword from database dynamically.
function shn_msg_keyword_generate($sender){
...
...
}
  • An initiation is required from menu traversal.
function _shn_msg_sms_menu_initiate($sender_phone_number){
...
...
}
  • To jump from child menu to its parent menu.
function _shn_msg_sms_menu_up($parsed_sms, $sender_phone_number){
...
...
}
  • To go to child menu.
function _shn_msg_sms_menu_down($parsed_sms, $sender_phone_number){
...
...
}
  • Module operation function
function _shn_msg_sms_sm($parsed_sms, $sender_phone_number){
...
...
}

Proposed operation

The operation of menu management system is fully depend on the menu created by administrator and developer of the system. One example is given below based on the proposed menu diagram.

In the proposed system the session will be maintain against a mobile phone. So, as per system every mobile phone shall have a single session and only one user can interact with the system at a time through that mobile number. The stages of the communication between an user and system are given below.

The example menu has 3 level of menu. Top level is not accessible by system user it is only accessible by system only. By default level 2 is accessible by an user because at initial stage (before login) user will get permission to access level 2 only.

  • Initial stage when a help is required from the system, an user can ask for help by sending “help” keyword, or the user can send any keyword to system.
Input Text: Any Keyword
Output Text:

Invalid SMS Keyword Sent. Kindly send help to get the list of keywords.
Input text: help
Output Text:

Sahana Menu: 
Numeric Code - Word Code
[1] -  login
[2] -  help
  • Now user has two option, first one is login and second one is help. By sending “help” keyword user can get the same menu as above and by sending “login” keyword user can get output as below. The system will automatically move to level 3. If the user will send incorrect user_id/pass the system will generate an error message and will keep the user in the same level.
Input Text: login <user_id> <password>
Output Text:

Welcome, <user_id> Registered User you are logged in to Sahana System via SMS.
Sahana Menu: 
Numeric Code - Word Code
[3] -  mpr
[4] -  or
[5] -  sm
[6] -  previous
[7] -  help
  • In this stage user will get five option because on that stage the user will be at the level 3 of the menu. First three options are for respective module call. The next one will be used to jump to parent menu of current one.
Input Text: previous
Output Text:

Sahana Menu: 
Numeric Code - Word Code
[1] -  login
[2] -  help
  • System will keep remember the last position in the menu up to one hour because session timeout time is fixed to one hour.
  • If the system will have another menu (level 4) under mpr menu, an user user can get that menu also by sending keyword “mpr” only and will come back to level 3 again by sending “previous” keyword.

Nirmalya Lahiri 2008/11/25 21:09


Navigation
QR Code
QR Code dev:sms_hierarchical_menu_proposal (generated for current page)