Contact our Help Desk as we will need to work with you to get calls pointed at your Web responder. Include the following information:
- Subject: Web Responder
- The web URL of your Responder.
- Instructions to route calls to it ( DID, IVR Option, Internal Dial Code ).
For instance, if someone dials into a DID on our system, we can cause that call to interact with your web server via HTTP/S API calls. This sample queries a web API for weather data but it is not limited to just that. You could use it to query your backend databases, salesforce, or many other systems.
- Causes Stratus to play an announcement and wait for a 5 digit US ZIP code.
- Queries https://openweathermap.org/ with that ZIP code and gets back the current weather.
- Uses Amazon Polly text to speech to create a wav file of the returned data.
- Causes Stratus to play that wav file.
- Hangs up the call.
Notes:
- Requires /usr/bin/mpg123 and /usr/bin/sox to convert audio files created by Polly to format compatible with Stratus.
- Rename includes/creds.sample.php to includes/creds.php and update it with your keys.
Stratus will browse your web server and expects to receive XML "verbs" ( i.e. instructions ) and wav files. Stratus will do things based on these instructions. This gives you the ability create IVRs that do all sorts of things.
When Stratus requests to your WebResponder application (inbound or outbound), the URL always contains at least the following parameters:
- NmsAni : caller, e.g., "1001"
- NmsDnis : callee e.g., "2125551212"
- AccountUser : Account User
- AccountDomain : Account Domain
- AccountLastDial : Last Dialed Digits by the Account User
- Digits : Received Digits
- OrigCallID : (1-1188b)
- TermCallID : (1-1188b)
- ToUser : User Part input to the Responder
- ToDomain : Domain Part input to the Responder
- Play
- Gather
- Forward
All verbs take an "action" attribute. If the "action" attribute is present then control is returned to the URL given by the "action" attribute. If not present then the application ends.
The action plays the given .wav file and posts back to the given action URL. For example,
<Play action='continue.php'>
http://www.example.com/hello-world.wav
</Play>
This verb plays the .wav file and posts back (i.e., returns control) to continue.php.
To end the call, omit the action parameter.
The action gathers the given number of DTMF digits and posts back to the given action url, optionally playing the given .wav file. numDigits the number of digits to gather, e.g., '1' (default=20) For example,
<Gather numDigits='3' action='handle-account-number.php'>
<Play>
http://www.example.com/what-is-your-account-number.wav
</Play>
<Gather>
This gathers 3 digits and posts back the relative URL handle-account-number.php?Digits=555. The verb posts back to the given action URL with the following parameters: Digits the gathered digits, for example, 123
The action forwards to the given destination. The verb does NOT take an "action" parameter. The verb is effectively a "goto". For example,
<Forward>
2125551212
</Forward>