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.