Generic VXML IVR Provider Demo: Making Calls

Upon receiving an SMS, call the sender back and speak the content of the SMS.

The details:

  1. You send an SMS to the number provided to you by your SMS provider [1].
  2. The SMS module receives a /incoming HTTP request from the SMS provider and sends a corresponding inbound_sms Motech Event.
  3. 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 named message.
  4. Your IVR provider receives the outbound call request.
  5. Your IVR provider then asks Motech for the VXML template [3], executes the VXML.
  6. 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:

IVR Demo - Creating a IVR Provider Config for outgoing calls

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 and outgoingCallMethod 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 named message to the HTTP request querystring to the IVR provider.

We’ll name this template say:

IVR Demo - The ``say`` VXML template

Gluing things together with the Tasks module

Let’s create a task which, upon receipt of an SMS, initiates an outgoing call and passes a message for the VXML script to say:

IVR Demo - Task: IVR call on SMS receipt

Note

we specify the number to call (in this case the sender of the SMS) and what do say (the content of the SMS) using a map notation in the action Parameters field.

Drum roll...

Now send an SMS with a simple ‘hello world’. Wait a few seconds [4]. You should receive a ‘hello world’ voice call from your IVR provider. Et voila!

[4]Crossing your fingers always helps

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.