Class: Exotel::Call

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/exotel/call.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCall

Returns a new instance of Call.



8
# File 'lib/exotel/call.rb', line 8

def initialize; end

Class Method Details

.connect_to_agent(params = {}) ⇒ Object



15
16
17
# File 'lib/exotel/call.rb', line 15

def self.connect_to_agent(params={})
  self.new.connect_to_agent(params)
end

.connect_to_flow(params = {}) ⇒ Object

TODO check if this is a good decision to provide a wrapper.



11
12
13
# File 'lib/exotel/call.rb', line 11

def self.connect_to_flow(params={})
  self.new.connect_to_flow(params)
end

.details(params = {}) ⇒ Object



19
20
21
# File 'lib/exotel/call.rb', line 19

def self.details(params={})
  self.new.details(params)
end

Instance Method Details

#connect_to_agent(params = {}) ⇒ Object



30
31
32
33
34
35
# File 'lib/exotel/call.rb', line 30

def connect_to_agent(params={})
  if valid?(params, {:type => 'agent'})
    params = transfrom_params(params, {:type => 'agent'})
    make_call(params)
  end
end

#connect_to_flow(params = {}) ⇒ Object



23
24
25
26
27
28
# File 'lib/exotel/call.rb', line 23

def connect_to_flow(params={})
  if valid?(params, {:type => 'flow'})
    params = transfrom_params(params, {:type => 'flow'})
    make_call(params)
  end
end

#details(sid) ⇒ Object



37
38
39
40
# File 'lib/exotel/call.rb', line 37

def details(sid)
  response = self.class.get("/#{Exotel.exotel_sid}/Calls/#{sid}",  :basic_auth => auth)
  handle_response(response)
end