Class: Nexmo::Voice
- Inherits:
-
Namespace
- Object
- Namespace
- Nexmo::Voice
- Defined in:
- lib/nexmo/voice.rb
Defined Under Namespace
Classes: DTMF, ListResponse, Stream, Talk
Instance Method Summary collapse
-
#create(params) ⇒ Response
Create an outbound Call.
- #dtmf ⇒ DTMF
-
#earmuff(id) ⇒ Response
Earmuff an in progress call.
-
#get(id) ⇒ Response
Get detail of a specific call.
-
#hangup(id) ⇒ Response
Hangup an in progress call.
-
#list(params = nil) ⇒ ListResponse
Get details of your calls.
-
#mute(id) ⇒ Response
Mute an in progress call.
- #stream ⇒ Stream
- #talk ⇒ Talk
-
#transfer(id, destination:) ⇒ Response
Transfer an in progress call.
-
#unearmuff(id) ⇒ Response
Unearmuff an in progress call.
-
#unmute(id) ⇒ Response
Unmute an in progress call.
-
#update(id, params) ⇒ Response
Modify an in progress call.
Instance Method Details
#create(params) ⇒ Response
Create an outbound Call.
57 58 59 |
# File 'lib/nexmo/voice.rb', line 57 def create(params) request('/v1/calls', params: params, type: Post) end |
#dtmf ⇒ DTMF
246 247 248 |
# File 'lib/nexmo/voice.rb', line 246 def dtmf @dtmf ||= DTMF.new(@config) end |
#earmuff(id) ⇒ Response
Earmuff an in progress call.
192 193 194 |
# File 'lib/nexmo/voice.rb', line 192 def earmuff(id) update(id, action: 'earmuff') end |
#get(id) ⇒ Response
Get detail of a specific call.
111 112 113 |
# File 'lib/nexmo/voice.rb', line 111 def get(id) request('/v1/calls/' + id) end |
#hangup(id) ⇒ Response
Hangup an in progress call.
147 148 149 |
# File 'lib/nexmo/voice.rb', line 147 def hangup(id) update(id, action: 'hangup') end |
#list(params = nil) ⇒ ListResponse
Get details of your calls.
96 97 98 |
# File 'lib/nexmo/voice.rb', line 96 def list(params = nil) request('/v1/calls', params: params, response_class: ListResponse) end |
#mute(id) ⇒ Response
Mute an in progress call.
162 163 164 |
# File 'lib/nexmo/voice.rb', line 162 def mute(id) update(id, action: 'mute') end |
#stream ⇒ Stream
234 235 236 |
# File 'lib/nexmo/voice.rb', line 234 def stream @stream ||= Stream.new(@config) end |
#talk ⇒ Talk
240 241 242 |
# File 'lib/nexmo/voice.rb', line 240 def talk @talk ||= Talk.new(@config) end |
#transfer(id, destination:) ⇒ Response
Transfer an in progress call.
228 229 230 |
# File 'lib/nexmo/voice.rb', line 228 def transfer(id, destination:) update(id, action: 'transfer', destination: destination) end |
#unearmuff(id) ⇒ Response
Unearmuff an in progress call.
207 208 209 |
# File 'lib/nexmo/voice.rb', line 207 def unearmuff(id) update(id, action: 'unearmuff') end |
#unmute(id) ⇒ Response
Unmute an in progress call.
177 178 179 |
# File 'lib/nexmo/voice.rb', line 177 def unmute(id) update(id, action: 'unmute') end |
#update(id, params) ⇒ Response
Modify an in progress call.
132 133 134 |
# File 'lib/nexmo/voice.rb', line 132 def update(id, params) request('/v1/calls/' + id, params: params, type: Put) end |