Infobip Transport

Infobip USSD transport.

exception vumi.transports.infobip.infobip.InfobipError

Bases: vumi.errors.VumiError

Used to log errors specific to the Infobip transport.

class vumi.transports.infobip.infobip.InfobipTransport(options, config=None)

Bases: vumi.transports.httprpc.httprpc.HttpRpcTransport

Infobip transport.

Currently only supports the Infobip USSD interface.

Configuration parameters:

Parameters:ussd_session_timeout (int) – Number of seconds before USSD session information stored in Redis expires. Default is 600s.

Excerpt from INFOBIP USSD Gateway to Third-party Application HTTP/REST/JSON Web Service API:

Third party application provides four methods for session management. Their parameters are as follows:

  • sessionActive (type Boolean) – true if the session is active, false otherwise. The parameter is mandatory.
  • sessionId (type String) – is generated for each started session and. The parameter is mandatory. exitCode (type Integer) – defined the status of the session that is complete. All the exit codes can be found in Table 1. The parameter is mandatory.
  • reason (type String) – in case a third-party applications releases the session before its completion it will contain the reason for the release. The parameter is used for logging purposes and is mandatory. msisdn (type String) – of the user that sent the response to the menu request. The parameter is mandatory.
  • imsi (type String) – of the user that sent the response to the menu request. The parameter is optional.
  • text (type String) – text the user entered in the response. The parameter is mandatory. shortCode – Short code entered in the mobile initiated session or by calling start method. The parameter is optional.
  • language (type String)– defines which language will be used for message text. Used in applications that support internationalization. The parameter should be set to null if not used. The parameter is optional.
  • optional (type String)– left for future usage scenarios. The parameter is optional. ussdGwId (type String)– id of the USSD GW calling the third-party application. This parameter is optional.

Responses to requests sent from the third-party-applications have the following parameters:

  • ussdMenu (type String)– menu to send as text to the user. The parameter is mandatory.
  • shouldClose (type boolean)– set to true if this is the last message in this session sent to the user, false if there will be more. The parameter is mandatory. Please note that the first message in the session will always be sent as a menu (i.e. shouldClose will be set to false).
  • thirdPartyId (type String)– Id of the third-party application or server. This parameter is optional.
  • responseExitCode (type Integer) – request processing exit code. Parameter is mandatory.