- Print
- DarkLight
- PDF
Call control verbs are returned from 3rd party REST endpoints to control the flow of a call dynamically. We expect a JSON response as an array. Here is an example which returns some text to speech and then plays a beep:
[
{
"say" : {
"text" : [
"Welcome to callable!",
"Have a great day!"
],
"loop" : 1,
"voice" : "en-GB-Standard-A"
}
},
{
"play" : {
"url" : "https://recordable.io/sounds/beep.mp3",
"loop" : 1
}
]
To determine how your software responds, you will need to know some information about the call. We POST the following minimal payload to your registered webhook:
{
"callId":"6624872eb9991b38efa4d444",
"from":"441234567890",
"to":"441234567891",
"digits":"",
"speech":"",
"action":"start"
}
To enable a 3rd party webhook, choose Control - Generic
from the webhook list when creating a new webhook
The webhook then needs to be assigned to the call flow using a plugin to reference it.
Then include the plugin as part of the call flow.
The Verbs
The following are the set of valid verbs that can be returned as part of an array. The verbs are read sequentially.
Dial
Dial an endpoint
{
"dial" : {
"callerId" : "+441234567890",
"timeout" : 30,
"timeLimit" : 14400,
"record" : { ... },
"targets" : [ ... ]
}
}
Field | Description | Required |
---|---|---|
callerId | The number to present to the called party, if not present or invalid, the account main billing number will be presented | false |
timeout | How long to ring before cancelling call | false |
timeLimit | If call connects, how long in seconds before forcibly ending call | false |
record | Record verb, if present the call will be recorded | false |
targets | Array of type Device , SipURI, PhoneNumber or Extension. Up to 10 targets can be included | true |
Record Verb
By including an empty Record verb you can opt in to call recording. Adding a URL will stream raw audio to a websocket endpoint
{
"dial" : {
...
"record" : {
"url" : "http://www.recordable.io/ws",
"username" : "user",
"password" : "password",
}
}
}
Field | Description | Required |
---|---|---|
url | If present, redirect audio stream to URL | false |
username | URL - Basic Authentication User | false |
password | URL - Basic Authentication Password | false |
Dial Targets
Device
Target a static Flow Device Endpoint
{
"device" : {
"id" : "3334872eb9991b38efa4d999"
}
}
Field | Description | Required |
---|---|---|
id | The uuid of the static device | true |
SIP URI
Target a SIP URI
{
"sipURI" : {
"uri" : "sip:1234@1.1.1.1:5060"
}
}
Field | Description | Required |
---|---|---|
uri | A valid SIP URI | true |
Phone Number
Target a Phone Number, internal routing logic will be applied to this target
{
"phoneNumber" : {
"number" : "+441234567891"
}
}
Field | Description | Required |
---|---|---|
number | A valid E164+ telephone number | true |
Extension
*Target an extension/ddi on a Static Flow endpoint, for example sending to extension 600 on a registered client 201 *
{
"extension" : {
"extension" : "201",
"overrideTo" : "600"
}
}
Field | Description | Required |
---|---|---|
extension | A static device extension number | true |
overrideTo | a number to include in the Request URI to allow for advanced routing | false |
Say
Text to speech
{
"say" : {
"text" : [
"Welcome to callable!",
"Have a great day!"
],
"loop" : 1,
"voice" : "en-GB-Standard-A"
}
}
Field | Description | Required |
---|---|---|
text | Array of text to convert to audio | true |
loop | How many times to loop the text array | false |
voice | Google voice https://cloud.google.com/text-to-speech/docs/voices | true |
Play
Play an MP3 or WAV
{
"play" : {
"url" : "https://recordable.io/sounds/beep.mp3",
"loop" : 1
}
}
Field | Description | Required |
---|---|---|
url | URL of media file | true |
loop | How many times to loop media | true |
Gather
Wait for input from caller
{
"gather" : {
"input" : ["digits", "speech"],
"finishOnKey" : "#",
"numDigits" : 1,
"timeout" : 10,
"say" : { ... },
"play" : { ... },
"hints" : [ "never" , "eat", "yellow", "snow" ],
"language" : "en-GB",
"redirect" : { ... }
}
}
Field | Description | Required |
---|---|---|
input | Array of input can be *digits" or speech or both | true |
finshOnKey | If digits, this will end dtmf sequence and send results | false |
numDIgits | How many digits to expect before automatically sending result | false |
timeout | How many seconds to wait before ending gather | false |
say | Mutally exclusive Say verb | If no Play |
play | Mutally exclusive Play verb | If no Say |
hints | Help speech recognition with array of text hints | false |
language | Google Speech https://cloud.google.com/speech-to-text/docs/languages | true if speech input |
redirect | Redirect Verb, where to direct call after input or timeout | false |
Redirect
Redirect to a Static Flow component
{
"device" : {
"id" : "3334872eb9991b38efa4d999"
}
}
Field | Description | Required |
---|---|---|
device | Device target | true |
Tag
Tag a call for contextual information
{
"tag" : {
"data" : { "tag1", "hey", "tag2" , "yo" }
}
}
Field | Description | Required |
---|---|---|
data | key value pairs | true |
Hangup
Hangup the call
{
"hangup" : {
"reason" : "call completed"
}
}
Field | Description | Required |
---|---|---|
reason | reason for the call ending | true |
Hangup
Rejecting the call
{
"hangup" : {
"reason" : "call completed"
}
}
Field | Description | Required |
---|---|---|
reason | reason for the call ending | true |