Play

About Play

Play media to the caller, either from a file hosted in the 2600Hz account, or accessible via a URI.

Schema

Validator for the play callflow data object

KeyDescriptionTypeDefaultRequiredSupport Level
answerWhether to answer an unanswered callboolean()false
endless_playbackLoop the media continuouslyboolean()falsefalse
idMedia ID or URL of the media to playstring()false
loop_countHow many times to loop the mediainteger(1..)false
skip_moduleWhen set to true this callflow action is skipped, advancing to the wildcard branch (if any)boolean()false
terminators.[]string()false
terminatorsWhat DTMF can terminate playback of the audioarray(string())["1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "0", "#"]false

Loop Count

If you want to play the media a number of times, include loop_count to do so.

Endless Playback

Endless playback is exactly that - playback of the media will not stop on the channel until the channel is hung up. The media is uninterruptible.

endless_playback=true takes precedence over loop_count>0 if both are included.

Examples

Play sample

The initial 2600Hz JSON to play a file could look something like:

{
    "module": "play",
    "data": {
        "id": "media_id"
    },
    "children": {
        "_": {
            "module": "play",
            "data":{
                "id": "http://some.file.server/some/file.mp3"
            },
            "children": {}
        }
    }
}

Here we see two play actions, one that uses a media file hosted by 2600Hz and one that fetches the file from an HTTP server.