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.
Usage¶
python start_rest_outbound.py [--wsserver <cloudWebServerAddress>] <cloudId> <username> <outboundService> <outboundServicePassword> <to>;[<from>];[<token>];[<outboundParameters>] | <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.
or...
filename
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¶
Invoke an outbound service
python start_rest_outbound.py 0-2-0 bob@acompany.com MyOutboundService 54321 sip:bill@bcompany.com
Running the command above invokes service 'MyOutboundService' (with password 54321) 5 times on account 'bob@company.com' (cloud region 0-2-0) and passes each invocation the outboundParameters 'sip:bill@bcompany.com'.
Invoke an outbound service multiple times
python start_rest_outbound.py 0-2-0 bob@acompany.com MyOutboundService 54321 outParams.csv
Running the command above invokes service 'MyOutboundService' (with password 54321) 3 times on account 'bob@acompany.com' (cloud region 0-2-0) and passes each invocation one of the sip addresses from the outParams.csv file.
Note
The outParams.csv in this example contains the following: sip:bill@bcompany.com;;;,sip:ben@bcompany.com;;;,sip:lw@bcompany.com;;;