IMImobile Transport¶
IMIMobile Transport¶
-
class
vumi.transports.imimobile.imimobile_ussd.
ImiMobileUssdTransport
(options, config=None)¶ Bases:
vumi.transports.httprpc.httprpc.HttpRpcTransport
HTTP transport for USSD with IMImobile in India.
Configuration parameters:
Parameters: - transport_name (str) – The name this transport instance will use to create its queues
- web_path (str) – The HTTP path to listen on.
- web_port (int) – The HTTP port to listen on.
- suffix_to_addrs (dict) – Mappings between url suffixes and to addresses.
- user_terminated_session_message (str) – A regex used to identify user terminated session messages. Default is ‘^Map Dialog User Abort User Reason’.
- user_terminated_session_response (str) – Response given back to the user if the user terminated the session. Default is ‘Session Ended’.
- redis_manager (dict) – The configuration parameters for connecting to Redis.
- ussd_session_timeout (int) – Number of seconds before USSD session information stored in Redis expires. Default is 600s.
-
get_to_addr
(request)¶ Extracts the request url path’s suffix and uses it to obtain the tag associated with the suffix. Returns a tuple consisting of the tag and a dict of errors encountered.
-
classmethod
ist_to_utc
(timestamp)¶ Accepts a timestamp in the format [M]M/[D]D/YYYY HH:MM:SS (am|pm) and in India Standard Time, and returns a datetime object normalized to UTC time.