Bridges¶
Method | Path (Parameters are case-sensitive) | Return Model | Summary |
---|---|---|---|
GET | /bridges | List[Bridge] | List all active bridges in Asterisk. |
POST | /bridges | Bridge | Create a new bridge. |
POST | /bridges/{bridgeId} | Bridge | Create a new bridge or updates an existing one. |
GET | /bridges/{bridgeId} | Bridge | Get bridge details. |
DELETE | /bridges/{bridgeId} | void | Shut down a bridge. |
POST | /bridges/{bridgeId}/addChannel | void | Add a channel to a bridge. |
POST | /bridges/{bridgeId}/removeChannel | void | Remove a channel from a bridge. |
POST | /bridges/{bridgeId}/videoSource/{channelId} | void | Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. |
DELETE | /bridges/{bridgeId}/videoSource | void | Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. When no explicit video source is set, talk detection will be used to determine the active video stream. |
POST | /bridges/{bridgeId}/moh | void | Play music on hold to a bridge or change the MOH class that is playing. |
DELETE | /bridges/{bridgeId}/moh | void | Stop playing music on hold to a bridge. |
POST | /bridges/{bridgeId}/play | Playback | Start playback of media on a bridge. |
POST | /bridges/{bridgeId}/play/{playbackId} | Playback | Start playback of media on a bridge. |
POST | /bridges/{bridgeId}/record | LiveRecording | Start a recording. |
list¶
GET /bridges¶
List all active bridges in Asterisk.
create¶
POST /bridges¶
Create a new bridge. This bridge persists until it has been shut down, or Asterisk has been shut down.
Query parameters¶
- type: string - Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single).
- bridgeId: string - Unique ID to give to the bridge being created.
- name: string - Name to give to the bridge being created.
createWithId¶
POST /bridges/{bridgeId}¶
Create a new bridge or updates an existing one. This bridge persists until it has been shut down, or Asterisk has been shut down.
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Unique ID to give to the bridge being created.
Query parameters¶
- type: string - Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single) to set.
- name: string - Set the name of the bridge.
get¶
GET /bridges/{bridgeId}¶
Get bridge details.
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id
Error Responses¶
- 404 - Bridge not found
destroy¶
DELETE /bridges/{bridgeId}¶
Shut down a bridge. If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id
Error Responses¶
- 404 - Bridge not found
addChannel¶
POST /bridges/{bridgeId}/addChannel¶
Add a channel to a bridge.
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id
Query parameters¶
- channel: string - (required) Ids of channels to add to bridge
- Allows comma separated values.
- role: string - Channel's role in the bridge
- absorbDTMF: boolean - Absorb DTMF coming from this channel, preventing it to pass through to the bridge
- mute: boolean - Mute audio from this channel, preventing it to pass through to the bridge
Error Responses¶
- 400 - Channel not found
- 404 - Bridge not found
- 409 - Bridge not in Stasis application; Channel currently recording
- 422 - Channel not in Stasis application
removeChannel¶
POST /bridges/{bridgeId}/removeChannel¶
Remove a channel from a bridge.
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id
Query parameters¶
- channel: string - (required) Ids of channels to remove from bridge
- Allows comma separated values.
Error Responses¶
- 400 - Channel not found
- 404 - Bridge not found
- 409 - Bridge not in Stasis application
- 422 - Channel not in this bridge
setVideoSource¶
POST /bridges/{bridgeId}/videoSource/{channelId}¶
Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants.
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id * channelId: string - Channel's id
Error Responses¶
- 404 - Bridge or Channel not found
- 409 - Channel not in Stasis application
- 422 - Channel not in this Bridge
clearVideoSource¶
DELETE /bridges/{bridgeId}/videoSource¶
Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. When no explicit video source is set, talk detection will be used to determine the active video stream.
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id
Error Responses¶
- 404 - Bridge not found
startMoh¶
POST /bridges/{bridgeId}/moh¶
Play music on hold to a bridge or change the MOH class that is playing.
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id
Query parameters¶
- mohClass: string - Channel's id
Error Responses¶
- 404 - Bridge not found
- 409 - Bridge not in Stasis application
stopMoh¶
DELETE /bridges/{bridgeId}/moh¶
Stop playing music on hold to a bridge. This will only stop music on hold being played via POST bridges/{bridgeId}/moh.
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id
Error Responses¶
- 404 - Bridge not found
- 409 - Bridge not in Stasis application
play¶
POST /bridges/{bridgeId}/play¶
Start playback of media on a bridge. The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id
Query parameters¶
- 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.
- Allowed range: Min: 0; Max: None
- skipms: int - Number of milliseconds to skip for forward/reverse operations.
- Default: 3000
- Allowed range: Min: 0; Max: None
- playbackId: string - Playback Id.
Error Responses¶
- 404 - Bridge not found
- 409 - Bridge not in a Stasis application
playWithId¶
POST /bridges/{bridgeId}/play/{playbackId}¶
Start playback of media on a bridge. The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id * playbackId: string - Playback ID.
Query parameters¶
- 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.
- Allowed range: Min: 0; Max: None
- skipms: int - Number of milliseconds to skip for forward/reverse operations.
- Default: 3000
- Allowed range: Min: 0; Max: None
Error Responses¶
- 404 - Bridge not found
- 409 - Bridge not in a Stasis application
record¶
POST /bridges/{bridgeId}/record¶
Start a recording. This records the mixed audio from all channels participating in this bridge.
Path parameters¶
Parameters are case-sensitive. * bridgeId: string - Bridge's id
Query parameters¶
- 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 - Bridge not found
- 409 - Bridge is not in a Stasis application; 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