...
Method | Path<br>h5. Parameters are case-sensitive | Return Model | Summary |
---|
GET | List all active channels in Asterisk. | ||
POST | Create a new channel (originate). | ||
POST | Create channel. | ||
GET | Channel details. | ||
POST | Create a new channel (originate with id). | ||
DELETE | void | Delete (i.e. hangup) a channel. | |
POST | void | Exit application; continue execution in the dialplan. | |
POST | void | Redirect the channel to a different location. | |
POST | void | Answer a channel. | |
POST | void | Indicate ringing to a channel. | |
DELETE | void | Stop ringing indication on a channel if locally generated. | |
POST | void | Send provided DTMF to a given channel. | |
POST | void | Mute a channel. | |
DELETE | void | Unmute a channel. | |
POST | void | Hold a channel. | |
DELETE | void | Remove a channel from hold. | |
POST | void | Play music on hold to a channel. | |
DELETE | void | Stop playing music on hold to a channel. | |
POST | void | Play silence to a channel. | |
DELETE | void | Stop playing silence to a channel. | |
POST | Start playback of media. | ||
POST | Start playback of media and specify the playbackId. | ||
POST | Start a recording. | ||
GET | Get the value of a channel variable or function. | ||
POST | void | Set the value of a channel variable or function. | |
POST | Start snooping. | ||
POST | Start snooping. | ||
POST | void | Dial a created channel. |
...
- 400 - Invalid parameters for originating a channel.
- 409 - Channel with given unique ID already exists.
Anchor | ||||
---|---|---|---|---|
|
create: POST /channels/create
...
- endpoint: string - (required) Endpoint for channel communication
- app: string - (required) Stasis Application to place channel into
- appArgs: string - The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.
- channelId: string - The unique id to assign the channel on creation.
- otherChannelId: string - The unique id to assign the second channel when using local channels.
- originator: string - Unique ID of the calling channel
- formats: string - The format name capability list to use if originator is not specified. Ex. "ulaw,slin16". Format names can be found with "core show codecs".
Error Responses
- 409 - Channel with given unique ID already exists.
Anchor | ||||
---|---|---|---|---|
|
get: GET /channels/{channelId}
...
- channelId: string - Channel's id
Error Responses
- 404 - Channel not found
Anchor | ||||
---|---|---|---|---|
|
...
- variables: containers - The "variables" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { "endpoint": "SIP/Alice", "variables": { "CALLERID(name)": "Alice" } }
Error Responses
- 400 - Invalid parameters for originating a channel.
- 409 - Channel with given unique ID already exists.
Anchor | ||||
---|---|---|---|---|
|
hangup: DELETE /channels/{channelId}
...
- reason: string - Reason for hanging up the channel
- Allowed values: normal, busy, congestion, no_answer
Error Responses
- 400 - Invalid reason for hangup provided
- 404 - Channel not found
...
- context: string - The context to continue to.
- extension: string - The extension to continue to.
- priority: int - The priority to continue to.
- label: string - The label to continue to - will supersede 'priority' if both are provided.
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- endpoint: string - (required) The endpoint to redirect the channel to
Error Responses
- 400 - Endpoint parameter not provided
- 404 - Channel or endpoint not found
- 409 - Channel not in a Stasis application
- 422 - Endpoint is not the same type as the channel
- 412 - Channel in invalid state
...
- channelId: string - Channel's id
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- channelId: string - Channel's id
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- channelId: string - Channel's id
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- dtmf: string - DTMF To send.
- before: int - Amount of time to wait before DTMF digits (specified in milliseconds) start.
- between: int - Amount of time in between DTMF digits (specified in milliseconds).
- Default: 100
- duration: int - Length of each DTMF digit (specified in milliseconds).
- Default: 100
- after: int - Amount of time to wait after DTMF digits (specified in milliseconds) end.
Error Responses
- 400 - DTMF is required
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- direction: string - Direction in which to mute audio
- Default: both
- Allowed values: both, in, out
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- direction: string - Direction in which to unmute audio
- Default: both
- Allowed values: both, in, out
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- channelId: string - Channel's id
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- channelId: string - Channel's id
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- mohClass: string - Music on hold class to use
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- channelId: string - Channel's id
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- channelId: string - Channel's id
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- channelId: string - Channel's id
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- media: string - (required) Media URIs to play.
- Allows comma separated values.
- lang: string - For sounds, selects language for sound.
- offsetms: int - Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.
- skipms: int - Number of milliseconds to skip for forward/reverse operations.
- Default: 3000
- playbackId: string - Playback ID.
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- media: string - (required) Media URIs to play.
- Allows comma separated values.
- lang: string - For sounds, selects language for sound.
- offsetms: int - Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.
- skipms: int - Number of milliseconds to skip for forward/reverse operations.
- Default: 3000
Error Responses
- 404 - Channel not found
- 409 - Channel not in a Stasis application
- 412 - Channel in invalid state
...
- name: string - (required) Recording's filename
- format: string - (required) Format to encode audio in
- maxDurationSeconds: int - Maximum duration of the recording, in seconds. 0 for no limit
- Allowed range: Min: 0; Max: None
- maxSilenceSeconds: int - Maximum duration of silence, in seconds. 0 for no limit
- Allowed range: Min: 0; Max: None
- ifExists: string - Action to take if a recording with the same name already exists.
- Default: fail
- Allowed values: fail, overwrite, append
- beep: boolean - Play beep when recording begins
- terminateOn: string - DTMF input to terminate recording
- Default: none
- Allowed values: none, any, *, #
Error Responses
- 400 - Invalid parameters
- 404 - Channel not found
- 409 - Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail
- 422 - The format specified is unknown on this system
...
- variable: string - (required) The channel variable or function to get
Error Responses
- 400 - Missing variable parameter.
- 404 - Channel or variable not found
- 409 - Channel not in a Stasis application
...
- variable: string - (required) The channel variable or function to set
- value: string - The value to set the variable to
Error Responses
- 400 - Missing variable parameter.
- 404 - Channel not found
- 409 - Channel not in a Stasis application
...
- spy: string - Direction of audio to spy on
- Default: none
- Allowed values: none, both, out, in
- whisper: string - Direction of audio to whisper into
- Default: none
- Allowed values: none, both, out, in
- app: string - (required) Application the snooping channel is placed into
- appArgs: string - The application arguments to pass to the Stasis application
- snoopId: string - Unique ID to assign to snooping channel
Error Responses
- 400 - Invalid parameters
- 404 - Channel not found
...
- spy: string - Direction of audio to spy on
- Default: none
- Allowed values: none, both, out, in
- whisper: string - Direction of audio to whisper into
- Default: none
- Allowed values: none, both, out, in
- app: string - (required) Application the snooping channel is placed into
- appArgs: string - The application arguments to pass to the Stasis application
Error Responses
- 400 - Invalid parameters
- 404 - Channel not found
...
- caller: string - Channel ID of caller
- timeout: int - Dial timeout
- Allowed range: Min: 0; Max: None
Error Responses
- 404 - Channel cannot be found.
- 409 - Channel cannot be dialed.