SMSSync

SMSSync Transport

class vumi.transports.smssync.smssync.BaseSmsSyncTransport(options, config=None)

Bases: vumi.transports.httprpc.httprpc.HttpRpcTransport

Ushahidi SMSSync Transport for getting messages into vumi.

Parameters:
  • web_path (str) – The path relative to the host where this listens
  • web_port (int) – The port this listens on
  • transport_name (str) – The name this transport instance will use to create its queues
  • redis_manager (dict) – Redis client configuration.
  • reply_delay (float) – The amount of time to wait (in seconds) for a reply message before closing the SMSSync HTTP inbound message request. Replies received within this amount of time will be returned with the reply (default: 0.5s).
add_msginfo_metadata(payload, msginfo)

Update an outbound message’s payload’s transport_metadata to allow msginfo to be reconstructed from replies.

callLater(_seconds, _f, *args, **kw)

See twisted.internet.interfaces.IReactorTime.callLater.

msginfo_for_message(msg)

Returns an SmsSyncMsgInfo instance for this outbound message.

May return a deferred that yields the actual result to its callback.

msginfo_for_request(request)

Returns an SmsSyncMsgInfo instance for this request.

May return a deferred that yields the actual result to its callback.

class vumi.transports.smssync.smssync.MultiSmsSync(options, config=None)

Bases: vumi.transports.smssync.smssync.BaseSmsSyncTransport

Ushahidi SMSSync Transport for a multiple phones.

Each phone accesses a URL that has the form <web_path>/<account_id>/. A blank secret should be entered into the SMSSync secret field.

Additional configuration options:

Parameters:country_codes (dict) – Map from account_id to the country code to use when normalizing MSISDNs sent by SMSSync to that API URL. If an account_id is not in this map the default is to use an empty country code string).
class vumi.transports.smssync.smssync.SingleSmsSync(options, config=None)

Bases: vumi.transports.smssync.smssync.BaseSmsSyncTransport

Ushahidi SMSSync Transport for a single phone.

Additional configuration options:

Parameters:
  • smssync_secret (str) – Secret of the single phone (default: ‘’, i.e. no secret set)
  • account_id (str) – Account id for storing outbound messages under. Defaults to the smssync_secret which is fine unless the secret changes.
  • country_code (str) – Default country code to use when normalizing MSISDNs sent by SMSSync (default is the empty string, which assumes numbers already include the international dialing prefix).
class vumi.transports.smssync.smssync.SmsSyncMsgInfo(account_id, smssync_secret, country_code)

Bases: object

Holder of attributes needed to process an SMSSync message.

Parameters:
  • account_id (str) – An ID for the acocunt this message is being sent to / from.
  • smssync_secret (str) – The shared SMSSync secret for the account this message is being sent to / from.
  • country_code (str) – The default country_code for the account this message is being sent to / from.