Sha256: b407c699f6b6ff643d006819e52df76af1fee9061dadd514bd3cc4b9635396a4

Contents?: true

Size: 1.26 KB

Versions: 6

Compression:

Stored size: 1.26 KB

Contents

module Twilio
    # 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. 
  class Call < TwilioObject
    #  Example:
    #  c = Twilio::Connection.new('my_twilio_sid', 'my_auth_token')
    #  call = Twilio::Call.new(c)
    #  response = call.make(CALLER_ID, user_number, 'http://myapp.com/twilio_response_handler')
    def make(caller, called, url, optional = {})
      self.connection.class.post("/Calls", :body => {:Caller => caller, :Called => called, :Url => url}.merge(optional))
    end

    def list(optional = {})
      self.connection.class.get("/Calls", :query => optional)  
    end
        
    def get(call_sid)
      self.connection.class.get("/Calls/#{call_sid}")  
    end
    
    def segments(call_sid, call_segment_sid = nil)
      self.connection.class.get("/Calls/#{call_sid}/Segments#{ '/' + call_segment_sid if call_segment_sid }")
    end
    
    def recordings(call_sid)
      self.connection.class.get("/Calls/#{call_sid}/Recordings")
    end
    
    def notifications(call_sid)
      self.connection.class.get("/Calls/#{call_sid}/Notifications")
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
webficient-twilio-1.3.0 lib/twilio/call.rb
webficient-twilio-1.4.0 lib/twilio/call.rb
webficient-twilio-2.0.0 lib/twilio/call.rb
webficient-twilio-2.1.0 lib/twilio/call.rb
webficient-twilio-2.2.0 lib/twilio/call.rb
twilio-1.4.0 lib/twilio/call.rb