Start REST Outbound Sample

A command line console application that starts an outbound service that is currently configured on a cloud region to run a REST API application.

The telephone number to call, the originating number and user-specified outboundParameters to be passed to a single service instance can be supplied on the command line. Multiple instances can be started by specifying the name of the file that contains a set of these parameters for each instance (comma-separated).

Usage

python start_rest_outbound.py [--wsserver <cloudWebServerAddress>] <cloudId> <username> <outboundService> <outboundServicePassword> <to>[;<from>[;<token>[;<outboundParameters>[;<extraSIPHeaders>]]]] | <csvFilename>

Arguments

cloudWebServerAddress

The address of the cloud web server. By default the wrappers call web services on https://ws-<cloudId>.aculabcloud.net. In certain circumstances you may need to use a different address which you can set here.

cloudId

Cloud region id (e.g. 1-2-0)

username

Cloud account username

outboundService

The outbound service to start

outboundServicePassword

The outbound service password

Followed by either...

to

The destination of the outbound call.

from

The origin of the outbound call.

token

The token string to send to the first page.

outboundParameters

The outbound parameters sent to the service instance. Must contain only seven bit ASCII, excluding ^, | and the control characters.

extraSIPHeaders

A comma-separated list of name:value pairs of extra SIP Headers to send in the initial outbound call request.

or...

csvFilename

The name of a file containing 1 or more to;from;outboundParameter strings, comma-separated.

Note

A comma-separated file containing the application instance ids of the invoked services is written when they have all completed (appInstances.csv).

Note

Multiple call invocations are only supported on standard production cloud accounts or above.

Note

For users running Python 2 under Windows, this tool does not support command line arguments containing non-ASCII characters. If you wish to specify command line arguments containing non-ASCII characters, please use Python 3.

Examples

  1. Invoke an outbound service

    python start_rest_outbound.py 1-2-0 bob@acompany.com BobsOutboundRESTService 1912 "443069990123;443069999876;mytoken;"
    

    Running the command above starts a single instance of BobsOutboundRESTService, the outbound destination is 443069990123, the calling number is 443069999876 and it is passed the token "mytoken".

  2. Invoke an outbound service multiple times

    python start_rest_outbound.py 1-2-0 bob@acompany.com BobsOutboundRESTService 1912 targets.csv
    

    Note

    The targets.csv in this example contains the following: 443069990123;443069999876;;,sip:bill@bcompany.com;;;user defined info

    Running the command above starts two instances of BobsOutboundRESTService. The first instance specifies the outbound destination (443069990123) and the calling number (443069999876). The second instance specifies the outbound destination (sip:bill@bcompany.com) and the outbound parameters (user defined info).