Class: Twilio::Call
Overview
A Call represenents a connection between a telephone and Twilio. This may be inbound, when a person calls your application, or outbound when your application initiates the call, either via the REST API, or during a call via the Dial Verb.
Instance Attribute Summary
Attributes inherited from TwilioObject
#connection
Instance Method Summary
collapse
#initialize, method_missing
Instance Method Details
#get(call_sid) ⇒ Object
17
18
19
|
# File 'lib/twilio/call.rb', line 17
def get(call_sid)
Twilio.get("/Calls/#{call_sid}")
end
|
#list(optional = {}) ⇒ Object
13
14
15
|
# File 'lib/twilio/call.rb', line 13
def list(optional = {})
Twilio.get("/Calls", :query => optional)
end
|
#make(caller, called, url, optional = {}) ⇒ Object
Example:
Twilio.connect('my_twilio_sid', 'my_auth_token')
Twilio::Call.make(CALLER_ID, user_number, 'http://myapp.com/twilio_response_handler')
9
10
11
|
# File 'lib/twilio/call.rb', line 9
def make(caller, called, url, optional = {})
Twilio.post("/Calls", :body => {:Caller => caller, :Called => called, :Url => url}.merge(optional))
end
|
#notifications(call_sid) ⇒ Object
29
30
31
|
# File 'lib/twilio/call.rb', line 29
def notifications(call_sid)
Twilio.get("/Calls/#{call_sid}/Notifications")
end
|
#recordings(call_sid) ⇒ Object
25
26
27
|
# File 'lib/twilio/call.rb', line 25
def recordings(call_sid)
Twilio.get("/Calls/#{call_sid}/Recordings")
end
|
#segments(call_sid, call_segment_sid = nil) ⇒ Object
21
22
23
|
# File 'lib/twilio/call.rb', line 21
def segments(call_sid, call_segment_sid = nil)
Twilio.get("/Calls/#{call_sid}/Segments#{ '/' + call_segment_sid if call_segment_sid }")
end
|