Generic VXML IVR Provider Demo: Making Calls¶
Upon receiving an SMS, call the sender back and speak the content of the SMS.
The details:
- You send an SMS to the number provided to you by your SMS provider [1].
- The SMS module receives a
/incoming
HTTP request from the SMS provider and sends a correspondinginbound_sms
Motech Event.- The Tasks module listens to the
inbound_sms
Motech event and triggers [2] an outbound IVR call, passing the text of the SMS as a parameter namedmessage
.- Your IVR provider receives the outbound call request.
- Your IVR provider then asks Motech for the VXML template [3], executes the VXML.
- You receive a phone call, pick up, hear the IVR computer voice speak the content of your SMS.
[1] You must also tell your SMS provider what to do when they receive an SMS, remember?
[2] By issuing an HTTP request to an URL provided by your IVR provider.
[3] At the URI you told your provider to find the VXML for outgoing calls from your number.
Creating a Config¶
In order for the IVR provider to initiate a call, we need to create a Config, click Modules / IVR / Settings:
Note
We named ours voxeo. Note that it’s a bit different than the one we created in the incoming-calls demo, we need to tell the IVR module how to reach the IVR provider by settings the
outgoingCallUriTemplate
andoutgoingCallMethod
properties.
The VXML¶
We need a simple VXML script that will say something that was passed to the IVR provider via the outgoing call initiation HTTP request:
<?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1" > <form> <block> <prompt> <value expr="session.connection.ccxml.values.message" /> </prompt> </block> </form> </vxml>Note
session.connection.ccxml.values.message
implies Motech will have to add a parameter namedmessage
to the HTTP request querystring to the IVR provider.We’ll name this template
say
:
Gluing things together with the Tasks module¶
Drum roll...¶
Notes¶
As in the previous example, you can check the Recent tasks activity pane on the Tasks module, or check the SMS or the IVR log to see what happened.
It’s important to note that this very crude & simple demo does not deal with call status, so the IVR CallDetailRecord log will not be very useful.