class Ari::Bridge

Attributes

bridge_class[R]
bridge_type[R]
channels[R]
creator[R]
id[R]
name[R]
technology[R]

Public Class Methods

addChannel(options = {})
Alias for: add_channel
add_channel(options = {}) click to toggle source

POST /bridges/%{bridgeId}/addChannel

Add a channel to a bridge

Parameters:

bridgeId (required) - Bridge’s id channel (required) - Ids of channels to add to bridge role - Channel’s role in the bridge

# File lib/ari/resources/bridge.rb, line 121
def self.add_channel(options = {})
  raise ArgumentError.new("Parameter bridgeId must be passed in options hash.") unless options[:bridgeId]
  raise ArgumentError.new("Parameter channel must be passed in options hash.") unless options[:channel]
  path = '/bridges/%{bridgeId}/addChannel' % options
  response = client(options).post(path, options)
end
Also aliased as: addChannel
create(options = {}) click to toggle source

POST /bridges

Active bridges

Parameters:

type - Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media). bridgeId - Unique ID to give to the bridge being created. name - Name to give to the bridge being created.

# File lib/ari/resources/bridge.rb, line 40
def self.create(options = {})
  path = '/bridges'
  response = client(options).post(path, options)
  Bridge.new(response.merge(client: options[:client]))
end
createWithId(options = {})
Alias for: create_with_id
create_with_id(options = {}) click to toggle source

POST /bridges/%{bridgeId}

Individual bridge

Parameters:

type - Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set. bridgeId (required) - Unique ID to give to the bridge being created. name - Set the name of the bridge.

# File lib/ari/resources/bridge.rb, line 57
def self.create_with_id(options = {})
  raise ArgumentError.new("Parameter bridgeId must be passed in options hash.") unless options[:bridgeId]
  path = '/bridges/%{bridgeId}' % options
  response = client(options).post(path, options)
  Bridge.new(response.merge(client: options[:client]))
end
Also aliased as: createWithId
destroy(options = {}) click to toggle source

DELETE /bridges/%{bridgeId}

Individual bridge

Parameters:

bridgeId (required) - Bridge’s id

# File lib/ari/resources/bridge.rb, line 98
def self.destroy(options = {})
  raise ArgumentError.new("Parameter bridgeId must be passed in options hash.") unless options[:bridgeId]
  path = '/bridges/%{bridgeId}' % options
  response = client(options).delete(path, options)
rescue Ari::RequestError => e
  raise unless e.code == '404'
end
get(options = {}) click to toggle source

GET /bridges/%{bridgeId}

Individual bridge

Parameters:

bridgeId (required) - Bridge’s id

# File lib/ari/resources/bridge.rb, line 78
def self.get(options = {})
  raise ArgumentError.new("Parameter bridgeId must be passed in options hash.") unless options[:bridgeId]
  path = '/bridges/%{bridgeId}' % options
  response = client(options).get(path, options)
  Bridge.new(response.merge(client: options[:client]))
end
list(options = {}) click to toggle source

GET /bridges

Active bridges

# File lib/ari/resources/bridge.rb, line 23
def self.list(options = {})
  path = '/bridges'
  response = client(options).get(path, options)
  response.map { |hash| Bridge.new(hash.merge(client: options[:client])) }
end
play(options = {}) click to toggle source

POST /bridges/%{bridgeId}/play

Play media to the participants of a bridge

Parameters:

bridgeId (required) - Bridge’s id media (required) - Media’s URI to play. lang - For sounds, selects language for sound. offsetms - Number of media to skip before playing. skipms - Number of milliseconds to skip for forward/reverse operations. playbackId - Playback Id.

# File lib/ari/resources/bridge.rb, line 212
def self.play(options = {})
  raise ArgumentError.new("Parameter bridgeId must be passed in options hash.") unless options[:bridgeId]
  raise ArgumentError.new("Parameter media must be passed in options hash.") unless options[:media]
  path = '/bridges/%{bridgeId}/play' % options
  response = client(options).post(path, options)
  Playback.new(response.merge(client: options[:client]))
end
playWithId(options = {})
Alias for: play_with_id
play_with_id(options = {}) click to toggle source

POST /bridges/%{bridgeId}/play/%{playbackId}

Play media to a bridge

Parameters:

bridgeId (required) - Bridge’s id playbackId (required) - Playback ID. media (required) - Media’s URI to play. lang - For sounds, selects language for sound. offsetms - Number of media to skip before playing. skipms - Number of milliseconds to skip for forward/reverse operations.

# File lib/ari/resources/bridge.rb, line 238
def self.play_with_id(options = {})
  raise ArgumentError.new("Parameter bridgeId must be passed in options hash.") unless options[:bridgeId]
  raise ArgumentError.new("Parameter playbackId must be passed in options hash.") unless options[:playbackId]
  raise ArgumentError.new("Parameter media must be passed in options hash.") unless options[:media]
  path = '/bridges/%{bridgeId}/play/%{playbackId}' % options
  response = client(options).post(path, options)
  Playback.new(response.merge(client: options[:client]))
end
Also aliased as: playWithId
record(options = {}) click to toggle source

POST /bridges/%{bridgeId}/record

Record audio on a bridge

Parameters:

bridgeId (required) - Bridge’s id name (required) - Recording’s filename format (required) - Format to encode audio in maxDurationSeconds - Maximum duration of the recording, in seconds. 0 for no limit. maxSilenceSeconds - Maximum duration of silence, in seconds. 0 for no limit. ifExists - Action to take if a recording with the same name already exists. beep - Play beep when recording begins terminateOn - DTMF input to terminate recording.

# File lib/ari/resources/bridge.rb, line 268
def self.record(options = {})
  raise ArgumentError.new("Parameter bridgeId must be passed in options hash.") unless options[:bridgeId]
  raise ArgumentError.new("Parameter name must be passed in options hash.") unless options[:name]
  raise ArgumentError.new("Parameter format must be passed in options hash.") unless options[:format]
  path = '/bridges/%{bridgeId}/record' % options
  response = client(options).post(path, options)
  LiveRecording.new(response.merge(client: options[:client]))
end
removeChannel(options = {})
Alias for: remove_channel
remove_channel(options = {}) click to toggle source

POST /bridges/%{bridgeId}/removeChannel

Remove a channel from a bridge

Parameters:

bridgeId (required) - Bridge’s id channel (required) - Ids of channels to remove from bridge

# File lib/ari/resources/bridge.rb, line 143
def self.remove_channel(options = {})
  raise ArgumentError.new("Parameter bridgeId must be passed in options hash.") unless options[:bridgeId]
  raise ArgumentError.new("Parameter channel must be passed in options hash.") unless options[:channel]
  path = '/bridges/%{bridgeId}/removeChannel' % options
  response = client(options).post(path, options)
end
Also aliased as: removeChannel
startMoh(options = {})
Alias for: start_moh
start_moh(options = {}) click to toggle source

POST /bridges/%{bridgeId}/moh

Play music on hold to a bridge

Parameters:

bridgeId (required) - Bridge’s id mohClass - Channel’s id

# File lib/ari/resources/bridge.rb, line 165
def self.start_moh(options = {})
  raise ArgumentError.new("Parameter bridgeId must be passed in options hash.") unless options[:bridgeId]
  path = '/bridges/%{bridgeId}/moh' % options
  response = client(options).post(path, options)
end
Also aliased as: startMoh
stopMoh(options = {})
Alias for: stop_moh
stop_moh(options = {}) click to toggle source

DELETE /bridges/%{bridgeId}/moh

Play music on hold to a bridge

Parameters:

bridgeId (required) - Bridge’s id

# File lib/ari/resources/bridge.rb, line 185
def self.stop_moh(options = {})
  raise ArgumentError.new("Parameter bridgeId must be passed in options hash.") unless options[:bridgeId]
  path = '/bridges/%{bridgeId}/moh' % options
  response = client(options).delete(path, options)
rescue Ari::RequestError => e
  raise unless e.code == '404'
end
Also aliased as: stopMoh

Public Instance Methods

add_channel(options = {}) click to toggle source
# File lib/ari/resources/bridge.rb, line 129
def add_channel(options = {})
  self.class.add_channel(options.merge(bridgeId: self.id, client: @client))
end
create_with_id(options = {}) click to toggle source
# File lib/ari/resources/bridge.rb, line 65
def create_with_id(options = {})
  self.class.create_with_id(options.merge(bridgeId: self.id, client: @client))
end
destroy(options = {}) click to toggle source
# File lib/ari/resources/bridge.rb, line 106
def destroy(options = {})
  self.class.destroy(options.merge(bridgeId: self.id, client: @client))
end
get(options = {}) click to toggle source
# File lib/ari/resources/bridge.rb, line 85
def get(options = {})
  self.class.get(options.merge(bridgeId: self.id, client: @client))
end
play(options = {}) click to toggle source
# File lib/ari/resources/bridge.rb, line 220
def play(options = {})
  self.class.play(options.merge(bridgeId: self.id, client: @client))
end
play_with_id(options = {}) click to toggle source
# File lib/ari/resources/bridge.rb, line 248
def play_with_id(options = {})
  self.class.play_with_id(options.merge(bridgeId: self.id, client: @client))
end
record(options = {}) click to toggle source
# File lib/ari/resources/bridge.rb, line 277
def record(options = {})
  self.class.record(options.merge(bridgeId: self.id, client: @client))
end
remove_channel(options = {}) click to toggle source
# File lib/ari/resources/bridge.rb, line 151
def remove_channel(options = {})
  self.class.remove_channel(options.merge(bridgeId: self.id, client: @client))
end
start_moh(options = {}) click to toggle source
# File lib/ari/resources/bridge.rb, line 172
def start_moh(options = {})
  self.class.start_moh(options.merge(bridgeId: self.id, client: @client))
end
stop_moh(options = {}) click to toggle source
# File lib/ari/resources/bridge.rb, line 194
def stop_moh(options = {})
  self.class.stop_moh(options.merge(bridgeId: self.id, client: @client))
end