Class: Nexmo::Calls
- Inherits:
-
Namespace
- Object
- Namespace
- Nexmo::Calls
- Defined in:
- lib/nexmo/calls.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.
56 57 58 |
# File 'lib/nexmo/calls.rb', line 56 def create(params) request('/v1/calls', params: params, type: Post) end |
#dtmf ⇒ DTMF
245 246 247 |
# File 'lib/nexmo/calls.rb', line 245 def dtmf @dtmf ||= DTMF.new(@config) end |
#earmuff(id) ⇒ Response
Earmuff an in progress call.
191 192 193 |
# File 'lib/nexmo/calls.rb', line 191 def earmuff(id) update(id, action: 'earmuff') end |
#get(id) ⇒ Response
Get detail of a specific call.
110 111 112 |
# File 'lib/nexmo/calls.rb', line 110 def get(id) request('/v1/calls/' + id) end |
#hangup(id) ⇒ Response
Hangup an in progress call.
146 147 148 |
# File 'lib/nexmo/calls.rb', line 146 def hangup(id) update(id, action: 'hangup') end |
#list(params = nil) ⇒ ListResponse
Get details of your calls.
95 96 97 |
# File 'lib/nexmo/calls.rb', line 95 def list(params = nil) request('/v1/calls', params: params, response_class: ListResponse) end |
#mute(id) ⇒ Response
Mute an in progress call.
161 162 163 |
# File 'lib/nexmo/calls.rb', line 161 def mute(id) update(id, action: 'mute') end |
#stream ⇒ Stream
233 234 235 |
# File 'lib/nexmo/calls.rb', line 233 def stream @stream ||= Stream.new(@config) end |
#talk ⇒ Talk
239 240 241 |
# File 'lib/nexmo/calls.rb', line 239 def talk @talk ||= Talk.new(@config) end |
#transfer(id, destination:) ⇒ Response
Transfer an in progress call.
227 228 229 |
# File 'lib/nexmo/calls.rb', line 227 def transfer(id, destination:) update(id, action: 'transfer', destination: destination) end |
#unearmuff(id) ⇒ Response
Unearmuff an in progress call.
206 207 208 |
# File 'lib/nexmo/calls.rb', line 206 def unearmuff(id) update(id, action: 'unearmuff') end |
#unmute(id) ⇒ Response
Unmute an in progress call.
176 177 178 |
# File 'lib/nexmo/calls.rb', line 176 def unmute(id) update(id, action: 'unmute') end |
#update(id, params) ⇒ Response
Modify an in progress call.
131 132 133 |
# File 'lib/nexmo/calls.rb', line 131 def update(id, params) request('/v1/calls/' + id, params: params, type: Put) end |