Action: IVR

The “ivr” action fills the purpose of playing a sound resource while also retrieving digits pressed by the caller (think customer support menus etc.).

Repeat

You can choose how many times the voice response, your sound resource, is repeated using the “repeat” key.

Time out

You can choose how many seconds to wait for input with the “timeout” key.

Format

Set the number of digits to wait for before the action completes with the digits parameter, default is 1. Set the number of seconds to wait for input with the timeout parameter, default is 10. Set the number of times to retry playing the message and waiting for input with the repeat parameter, default is 3. The value of timeout must be in the interval 1 to 30. Other values will default to 10.

{
  "ivr": "https://yourapp.example/menu.mp3",
  "digits": 1, // Optional
  "timeout": 10, // Optional
  "repeat": 3, // Optional
  "next": "https://yourapp.example/elks/ivr" // Optional
}

You can also supply the commands for the different alternatives directly.

{
  "ivr": "https://yourapp.example/menu.mp3",
  "digits": 1, // Optional
  "timeout": 10, // Optional
  "repeat": 3, // Optional
  "1": {"play":"https://example.com/thank_you.wav"},
  "2": "https://example.com/elks/ivr",
  "0": {"connect": "+46700000000"}
}

Variable length input

In some cases, you may not know how many digits a customer will input. You can ask the user to press "#" at the end of their input sequence which will then complete the action.

The maximum digits must be large enough to capture the predicted input.

Result

The call will end after the action is completed if the next parameter is omitted. If the next parameter is set we'll make a request to the URL as defined below. You can respond with any valid call action.

POST https://yourapp.example/elks/ivr
Parameter Description
callid The unique id of the call in our systems.
from The phone number of the person calling in to the IVR. Ex. +46700000000
result The digit sequence that the user entered, for instance ”1234”. If an error occured the value will be ”failed”.
why Only present if result is ”failed”. The value will be ”noinput” if the user did not enter the required number of digits.