Turn Channels API (EXPERIMENTAL: DO NOT USE IN PRODUCTION) ---------------------------------------------------------- This application provides bidirectional messaging over HTTP, intended for integration with `Turn's Channels API `_. Currently this only supports text message types. A future iteration will support other types. .. py:currentmodule:: vumi2.applications.turn_channels_api Configuration ^^^^^^^^^^^^^ The application has the following configuration options: .. py:data:: connector_name :type: str The name of the AMQP queue to publish outbound message on, and to consume inbound messages and events from. Required. .. py:data:: http_bind :type: str The address to bind the HTTP server to. Required. .. py:data:: vumi_api_path :type: str The base URL path for outbound message HTTP requests. Outbound message requests must be POSTed to ``/messages``. Defaults to an empty string. .. py:data:: turn_api_url :type: str The base URL path for requests to Turn. Defaults to an empty string. .. py:data:: default_from_addr :type: str The default from address to use for outbound messages. Required. .. py:data:: auth_token :type: str The authorization token to use for requests to Turn. Required. .. py:data:: turn_hmac_secret :type: str The secret key that Turn uses to sign its requests to us. Required. .. py:data:: request_timeout :type: float Maximum time allowed (in seconds) for outbound message request handling. Defaults to 240 seconds. .. py:data:: mo_message_url_timeout :type: float Maximum time allowed (in seconds) for inbound message HTTP requests. Defaults to 10 seconds. .. py:data:: event_url_timeout :type: float Maximum time allowed (in seconds) for event HTTP requests. Defaults to 10 seconds. .. py:data:: transport_type :type: str The transport_type to use for non-reply outbound messages. Defaults to ``sms``. .. py:data:: message_cache_class :type: str The message cache class to use for storing inbound messages. Defaults to ``MemoryMessageCache``. .. py:data:: message_cache_config :type: dict The configuration for the message cache. Defaults to an empty dictionary. .. py:data:: max_retries :type: int The maximum number of retries to attempt for outbound message requests. Defaults to 3. .. py:data:: retry_delay_exponent :type: int The exponent to use for retry delays. Defaults to 2. .. py:data:: retry_delay_base :type: int The base to use for retry delays. Defaults to 2. How it works ^^^^^^^^^^^^ The application worker listens on HTTP for outbound messages from Turn and forwards them over AMQP to a router or transport. Inbound messages and events are forwarded to Turn over HTTP. Outbound message API """""""""""""""""""" When Turn needs to submit a message to a user, it will send a POST request to the configured URL. For more information see the `Turn Channels API documentation `_. .. http:post:: /messages Send an outbound (mobile terminated) message. :/messages :/statuses :`_ for more information.