Commands
Make a call
This function should be used to connect the first call with another party.
The following is an JSON response example you would need to provide:
{
"commands": [
{
"function": "MakeCall",
"targetMsisdn": "6512345678",
"sourceMsisdn": "6587654321",
"ringtone": "us"
}
]
}
The command should contain mandatory fields:
Name | Type | Description |
---|---|---|
function | string | MakeCall – Connect / bridge call function |
targetMsisdn | string | Number of the called party in E.164 format i.e the number being call |
sourceMsisdn | string | Number of the calling party in E.164 format i.e the number making the call this should be the Virtual Number |
ringtone | string | “Optional - Play ringtone: valid values: au, eu, jp, uk, us” |
Play TTS
This function should be used to play a text to speech message on the call.
The following is an example JSON response you would need to provide:
{
"commands": [
{
"function": "PlayTTS",
"message": "Hello This is a test message",
"voice": "f",
"language": "en",
"dtmfInterrupt": true,
"dtmfLength": 5
}
]
}
The above example would be used if you want for the meesgae “This is a test message” to be pronounced in an English female voice.
The command should contain the following:
Name | Type | Description |
---|---|---|
function | String | PlayTTS – Text to speech function |
message | String | The text to speech on the call voice |
language | String | “The language of the spoken text, see below of supported languages” |
dtmfInterrupt | Boolean | Optional - Provide feedback of any keys pressed during the call |
dtmfLength | Number | Optional - How many numbers to listen for before # is pressed. Accepted 0-20 |
Please note that If dtmfInterrupt is used, dtmfLength is also required. Key press information will be sent to the handleURL defined above.
Supported TTS Voice and language are:
Language | Value | Male voice (M) | Female voice (F) |
---|---|---|---|
English | EN | Yes | Yes |
Chinese | ZH | No | Yes |
Danish | DA | Yes | Yes |
Dutch | NL | Yes | Yes |
French | FR | Yes | Yes |
German | DE | Yes | Yes |
Hindi | HI | No | Yes |
Icelandic | IS | Yes | Yes |
Italian | IT | Yes | Yes |
Japanese | JA | Yes | Yes |
Korean | SV | No | Yes |
Norwegian | NB | No | Yes |
Polish | PL | Yes | Yes |
Portuguese | PT | Yes | Yes |
Romanian | RO | No | Yes |
Russian | RU | Yes | Yes |
Spanish | ES | Yes | Yes |
Swedish | SV | No | Yes |
Thai | TH | No | Yes |
Turkish | TR | No | Yes |
Vietnamese | VN | Yes | Yes |
Welsh | CY | No | Yes |
Play File
This function should be used to play an audio file on the call.
The following is an example JSON response you would need to provide:
{
"commands": [
{
"function": "PlayFile",
"type": "url",
"value": "http://www.pachd.com/sfx/applause.wav",
"dtmfInterrupt": true,
"dtmfLength": 5,
"replay": 1
}
]
}
The above example would be used if you want for the meesgae “This is a test message” to be pronounced in an English female voice.
The command should contain the following:
Name | Type | Description |
---|---|---|
function | String | PlayFile – Audio file function |
type | String | Type of audio file. Supported: url |
value | String | “For type url provide url of file to play” |
dtmfInterrupt | Boolean | Optional - Provide feedback of any keys pressed during the call,Optional - Replay media,Valid range = 0 ~ 3,Default = 0 |
replay | Number | “Note: if dtmf = 0, media will replay based on replay value, if dtmf >0, mdeia will replay only if no input” |
Please note If dtmfInterrupt is used, Key press information will be sent to the handleURL defined above.
Recommended audio type is WAV (pcm, alaw, 8000hz, mono) and the max file size is 1MB.
Hangup
This command should be used to hang up the call.
The following is an example JSON response you would need to provide:
{
"commands": [
{
"function": "Hangup"
}
]
}
Note: The above is needed only if you do not want to complete any other action. This command is not necessary if the calling party hangs up the call.
Commands Example
On the following example it is demonstrated how multiple functions can be use in commands:
{
"commands": [
{
"function": "PlayTTS",
"message": "Hello This is a test message",
"voice": "f",
"language": "en",
"dtmfInterrupt": true,
"dtmfLength": 5
},
{
"function": "MakeCall",
"targetMsisdn": "6512345678",
"sourceMsisdn": "6587654321",
"ringtone": "us"
}
]
}