command

websocket server => jambonz

A command message is sent by the websocket server to jambonz when the server wants to asynchronously provide a new set of instructions to jambonz.

propertytypemeaningrequired
typestring “command”indicates this is a command messageyes
commandstringdescribes the action to take, see allowed commands belowyes
queueCommandbooleanif true, queue this command until previous commands are completed; otherwise, interrupt and flush all previous commands and execute this command immediatelyno
dataarray or objectdata pertaining to the requested commandyes

The command property must be one of the values shown below.

Note: redirect is the most commonly-used value.

command valuemeaningdata requirements
redirectexecute the application provideddata must be an array of jambonz verbs; i.e. a jambonz application.
call:statuschange the call status (e.g. hangup the call)data must include a call_status property with a value of ‘completed’ or ‘no-answer’
mute:statusmute or unmute the calldata must include a mute_status property with a value of ‘mute’ or ‘unmute’
conf:mute-statusmute or unmute all non-moderator conference legsdata must include a conf_mute_status property with a value of either ‘mute’ or ‘unmute’
conf:hold-statusplace a conference leg on hold or take off holddata must include a conf_hold_status property with a value of either ‘hold’ or ‘unhold’
listen:statusChange the status of a listen streamdata must include a listen_status property with a value of ‘pause’ or ‘resume’
recordmanage call recording that is done via SIPREC to a remote recording serverdata must include an action with one of “startCallRecording”, “stopCallRecording”, “pauseCallRecording”, or “resumeCallRecording”. When starting a recording you must also supply “recordingID” and “siprecServerURL”. You may optionally supply a headers object with custom headers to be sent to the remote SIPREC recording server.
whisperPlay a whisper prompt to the caller (i.e only one party hears the prompt)data must include a whisper property that can be an array of say or play verbs
sip:requestSend a SIP INFO, NOTIFY, or MESSAGE request to the far end partydata must include a ‘method’ property (allowed values: ‘INFO’, ‘NOTIFY’, ‘MESSAGE’) and can include ‘content_type’, ‘content’, and ‘headers’ properties.
dubadd, remove or operate on a dub track.The data must include the properties defined for the dub verb

Note: In the data payload when redirect is used, each jambonz verb in the data array may optionally include an id property. If present, jambonz will provide verb:status notifications when the verb starts and ends execution.

1 {
2 "type": "command",
3 "command": "redirect",
4 "queueCommand": true,
5 "data": [
6 {
7 "say": {
8 "id": "b5e39996",
9 "text": "Hello it's me Mario"
10 }
11 }
12 ]
13}