Call Actions

MakeCall

This function should be used to connect the first call with another party.

The following is an example of the JSON response you would need to provide:

{
    "commands": [
    {
      "function": "MakeCall", 
      "targetMsisdn": "6512345678", 
      "sourceMsisdn": "6587654321", 
      "ringtone": "us"
    } 
    ]
}

The action should contain the following parameters:

Name

Type

Description

function

String

MakeCall – Action to Connect/Bridge call between two users

targetMsisdn

String

Number of the called party in E.164 format (The second user's number).

sourceMsisdn

String

Number of the calling party in E.164 format. This should be the Virtual Number allocated to your sub-account

ringtone

String

(Optional) Ringtone sound that the calling user will hear.
Valid values: au, eu, jp, uk, us

PlayTTS

This action should be used to play a text to speech message on the call.

The following is an example of the 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 the message “This is a test message” to be pronounced in an English female voice.

The action should contain the following parameters:

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. The calling user's dial-pad inputs will be provided to you in the Call Handle dtmf key.

Supported TTS Voice and language are:

Language

Value

Male voice (M)

Female voice (F)

English

EN

Yes

Yes

Chinese

ZN

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

PlayFile

This action should be used to play an audio file on the call.

The following is an example of the JSON response you would need to provide:

{
"commands": [ 
    {
      "function": "PlayFile",
      "type": "url",
      "value": "http://www.example.com/audio.wav", 
      "dtmfInterrupt": true,
      "dtmfLength": 5,
      "replay": 1 
    }
  ] 
}

The above example would be used if you want the audio file "audio.wav", hosted at http://www.example.com/audio.wav to be played to the calling user.

The action should contain the following parameters:

Name

Type

Description

function

String

PlayFile – Action to play an audio file to the calling user

type

String

Type of audio file. Supported values:

  • url

value

String

For type: url provide url of file that will be played to the calling user

dtmfInterrupt

Boolean

(Optional) Enables dial-pad inputs from the calling user. The # (hash) key will end the user's dial-pad input.

dtmfLength

Integer

(Optional) Maximum number of dial-pad inputs that the calling user can make. Accepted values are from 1 to 20.

replay

Integer

Replay audio file count. Valid range = 0 - 3, Default = 0

Note: if dtmf = 0, the audio file will be replayed based on replay value, if dtmf >0, the audio file will be replayed only if no dial-pad input has been provided

Please note that If dtmfInterrupt is used, dtmfLength is also required. The calling user's dial-pad inputs will be provided to you in the Call Handle dtmf key.

Recommended audio type is WAV (PCM, alaw, 8000hz, mono) and the max file size is 1MB.

Hangup

This action should be used to hang up the incoming call.

The following is an example of the JSON response you would need to provide:

{
    "commands": [ 
        {
        "function": "Hangup" 
    }
  ]
}

Note: The Hangup action is needed only if you do not want to complete any other action. This action is not necessary if the calling user hangs up the call.

Commands Example

On the following example it is demonstrated how multiple functions can be used 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"
    }
  ]
}