Class: Telapi::Participant
- Defined in:
- lib/telapi/participant.rb
Overview
A Participant is always generated via Conferences but this class also provides some convenience methods to access them directly, thereby reducing API calls.
Class Method Summary collapse
-
.get(conference_sid, call_sid) ⇒ Object
Convenient alternative to Conference::participant.
-
.list(conference_sid, optional_params = {}) ⇒ Object
Convenient alternative to Conference::participants.
Instance Method Summary collapse
-
#deaf ⇒ Object
Deaf a participant of a conference call, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/deaf-or-mute/.
-
#hangup ⇒ Object
Hangup a participant of a conference call, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/hangup-participant/.
-
#mute ⇒ Object
Mute a participant of a conference call, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/deaf-or-mute/.
-
#play_audio(sound_url = 'http://www.telapi.com/audio.mp3') ⇒ Object
Play pre-recorded sound from a file to conference members, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/play-audio/.
-
#undeaf ⇒ Object
Undeaf a participant of a conference call, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/deaf-or-mute/.
-
#unmute ⇒ Object
Unmute a participant of a conference call, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/deaf-or-mute/.
Methods inherited from Resource
Methods included from Network
api_uri, default_options, delete, post, response_format
Constructor Details
This class inherits a constructor from Telapi::Resource
Class Method Details
.get(conference_sid, call_sid) ⇒ Object
Convenient alternative to Conference::participant
13 14 15 |
# File 'lib/telapi/participant.rb', line 13 def get(conference_sid, call_sid) Conference.participant(conference_sid, call_sid) end |
.list(conference_sid, optional_params = {}) ⇒ Object
Convenient alternative to Conference::participants
8 9 10 |
# File 'lib/telapi/participant.rb', line 8 def list(conference_sid, optional_params = {}) Conference.participants(conference_sid, optional_params) end |
Instance Method Details
#deaf ⇒ Object
Deaf a participant of a conference call, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/deaf-or-mute/
20 21 22 23 |
# File 'lib/telapi/participant.rb', line 20 def deaf response = Network.post(['Conferences', self.conference_sid, 'Participant', self.call_sid], { :Deaf => true }) Participant.new(response) end |
#hangup ⇒ Object
Hangup a participant of a conference call, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/hangup-participant/
48 49 50 51 |
# File 'lib/telapi/participant.rb', line 48 def hangup response = Network.delete(['Conferences', self.conference_sid, 'Participant', self.call_sid]) Participant.new(response) end |
#mute ⇒ Object
Mute a participant of a conference call, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/deaf-or-mute/
34 35 36 37 |
# File 'lib/telapi/participant.rb', line 34 def mute response = Network.post(['Conferences', self.conference_sid, 'Participant', self.call_sid], { :Muted => true }) Participant.new(response) end |
#play_audio(sound_url = 'http://www.telapi.com/audio.mp3') ⇒ Object
Play pre-recorded sound from a file to conference members, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/play-audio/
Required params:
sound_url
-
URL containing an audio file
58 59 60 61 |
# File 'lib/telapi/participant.rb', line 58 def play_audio(sound_url = 'http://www.telapi.com/audio.mp3') response = Network.post(['Conferences', self.conference_sid, 'Participant', self.call_sid], { :AudioUrl => sound_url }) Participant.new(response) end |
#undeaf ⇒ Object
Undeaf a participant of a conference call, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/deaf-or-mute/
27 28 29 30 |
# File 'lib/telapi/participant.rb', line 27 def undeaf response = Network.post(['Conferences', self.conference_sid, 'Participant', self.call_sid], { :Deaf => false }) Participant.new(response) end |
#unmute ⇒ Object
Unmute a participant of a conference call, returning a Telapi::Participant object See www.telapi.com/docs/api/rest/conferences/deaf-or-mute/
41 42 43 44 |
# File 'lib/telapi/participant.rb', line 41 def unmute response = Network.post(['Conferences', self.conference_sid, 'Participant', self.call_sid], { :Muted => false }) Participant.new(response) end |