Versions Compared
Version | Old Version 3 | New Version 4 |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Introduction
Helium and the Helium DSL provides built-in functionality for USSD integration. The DSL provides an interface for these integrations through a USSD annotation and new MezUssdMenu and MezUssdMenuOption built-in objects MezUssdMenu and MezUssdMenuOption.
Functions that are annotated with @USSD serve as integration endpoints that are available to be executed upon for inbound requets requests from USSD gateways. These function functions then return an instance of MezUssdMenu that describes the next menu structure that is to be presented to the end user during his USSD session.
Overview
The basis of integrating with a USSD gateway is through calls from the USSD gateway to Helium.
When a user initiates a USSD session on the mobile device an API call is made to Helium's API. The calls are then routed to a specific @USSD annotated DSL function within an app. The app then response with the menu structure that is to be presented to the end user. Helium then translates this response as is required by the specific gateway.
@USSD
One of the following signatures is expected for USSD annotated functions:
Code Block |
---|
@USSD("description") MezUssdMenu processUssd(int menu, int selection) |
Code Block |
---|
@USSD("description") MezUssdMenu processUssd(int menu, int selection, json gatewayArgs) |
The purpose of the provided parameters are as follows:
menu:
An integer that indicates the menu from which the USSD request originated. For an initial call a value of 0 is sent.
selection:
An integer that indicates the menu option that was selected for the current request. For an initial call a value of 0 is sent.
gatewayArgs:
A json parameter that is populated with all additional query parameters sent by the gateway to Helium. At present the only gateway that is supported is Vodacom USSD gateway. The following shows an example of values that are sent for this gateway:
Code Block |
---|
{ "msisdn":"27763303624", "request":"*120*247253#", "provider":"Vodacom", "ussdSessionId":"2496158596" } |
The json attributes listed in the above example represent to following:
Attribute | Description |
---|---|
msisdn | The msisdn / mobile number that initiated the USSD session and request. |
request | A field that describes the request made by the mobile end user. For requests where free text answers are provided, this field will contain the provided free text value. |
provider | Name of the USSD provider. For the Vodacom gateway it will allays be "Vodacom". |
ussdSessionId |