class Asterisk::ARI::Bridges

Defined in:

asterisk/ari/resources/bridges.cr
asterisk/ari/models/bridges_bridge.cr

Instance Method Summary

Instance methods inherited from class Asterisk::ARI::Resources

ari : ARI ari

Constructor methods inherited from class Asterisk::ARI::Resources

new(ari) new

Instance Method Detail

def add_channel(bridge_id : String, channel : String, role : String? = nil, absorb_dtmf : Bool? = false, mute : Bool? = false) #

Add a channel to a bridge.

Arguments:

  • bridge_id - bridge's id. (required);
  • channel - ids of channels to add to bridge. (required). Allow multiple instances (comma-separated list);
  • role - channel's role in the bridge;
  • absorb_dtmf - absorb DTMF coming from this channel, preventing it to pass through to the bridge;
  • mute - 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

[View source]
def clear_video_source(bridge_id : String) #

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.

Arguments:

  • bridge_id - bridge's id. (required);

Error responses:

  • 404 - Bridge not found

[View source]
def create(type : String? = nil, bridge_id : String? = nil, name : String? = nil) : HTTP::Client::Response | Bridges::Bridge #

Create a new bridge.

Arguments:

  • type - comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu);
  • bridge_id - unique ID to give to the bridge being created;
  • name - name to give to the bridge being created;

[View source]
def create_with_id(bridge_id : String, type : String? = nil, name : String? = nil) : HTTP::Client::Response | Bridges::Bridge #

Create a new bridge or updates an existing one.

Arguments:

  • bridge_id - unique ID to give to the bridge being created. (required);
  • type - comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu) to set;
  • name - set the name of the bridge;

[View source]
def destroy(bridge_id : String) #

Shut down a bridge.

Arguments:

  • bridge_id - bridge's id. (required);

Error responses:

  • 404 - Bridge not found

[View source]
def get(bridge_id : String) : HTTP::Client::Response | Bridges::Bridge #

Get bridge details.

Arguments:

  • bridge_id - bridge's id. (required);

Error responses:

  • 404 - Bridge not found

[View source]
def list : HTTP::Client::Response | Array(Bridges::Bridge) #

List all active bridges in Asterisk.


[View source]
def play(bridge_id : String, media : String, lang : String? = nil, offsetms : Int32? = 0, skipms : Int32? = 3000, playback_id : String? = nil) : HTTP::Client::Response | Playbacks::Playback #

Start playback of media on a bridge.

Arguments:

  • bridge_id - bridge's id. (required);
  • media - media URIs to play. (required). Allow multiple instances (comma-separated list);
  • lang - for sounds, selects language for sound;
  • offsetms - number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified;
  • skipms - number of milliseconds to skip for forward/reverse operations;
  • playback_id - playback Id;

Error responses:

  • 404 - Bridge not found
  • 409 - Bridge not in a Stasis application

[View source]
def play_with_id(bridge_id : String, playback_id : String, media : String, lang : String? = nil, offsetms : Int32? = 0, skipms : Int32? = 3000) : HTTP::Client::Response | Playbacks::Playback #

Start playback of media on a bridge.

Arguments:

  • bridge_id - bridge's id. (required);
  • playback_id - playback ID. (required);
  • media - media URIs to play. (required). Allow multiple instances (comma-separated list);
  • lang - for sounds, selects language for sound;
  • offsetms - number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified;
  • skipms - number of milliseconds to skip for forward/reverse operations;

Error responses:

  • 404 - Bridge not found
  • 409 - Bridge not in a Stasis application

[View source]
def record(bridge_id : String, name : String, format : String, max_duration_seconds : Int32? = 0, max_silence_seconds : Int32? = 0, if_exists : String? = "fail", beep : Bool? = false, terminate_on : String? = "none") : HTTP::Client::Response | Recordings::LiveRecording #

Start a recording.

Arguments:

  • bridge_id - bridge's id. (required);
  • name - recording's filename. (required);
  • format - format to encode audio in. (required);
  • max_duration_seconds - maximum duration of the recording, in seconds. 0 for no limit;
  • max_silence_seconds - maximum duration of silence, in seconds. 0 for no limit;
  • if_exists - action to take if a recording with the same name already exists;
  • beep - play beep when recording begins;
  • terminate_on - dTMF input to terminate recording;

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

[View source]
def remove_channel(bridge_id : String, channel : String) #

Remove a channel from a bridge.

Arguments:

  • bridge_id - bridge's id. (required);
  • channel - ids of channels to remove from bridge. (required). Allow multiple instances (comma-separated list);

Error responses:

  • 400 - Channel not found
  • 404 - Bridge not found
  • 409 - Bridge not in Stasis application
  • 422 - Channel not in this bridge

[View source]
def set_video_source(bridge_id : String, channel_id : String) #

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.

Arguments:

  • bridge_id - bridge's id. (required);
  • channel_id - channel's id. (required);

Error responses:

  • 404 - Bridge or Channel not found
  • 409 - Channel not in Stasis application
  • 422 - Channel not in this Bridge

[View source]
def start_moh(bridge_id : String, moh_class : String? = nil) #

Play music on hold to a bridge or change the MOH class that is playing.

Arguments:

  • bridge_id - bridge's id. (required);
  • moh_class - channel's id;

Error responses:

  • 404 - Bridge not found
  • 409 - Bridge not in Stasis application

[View source]
def stop_moh(bridge_id : String) #

Stop playing music on hold to a bridge.

Arguments:

  • bridge_id - bridge's id. (required);

Error responses:

  • 404 - Bridge not found
  • 409 - Bridge not in Stasis application

[View source]