Module: Wangiry

Defined in:
lib/wangiry.rb,
lib/wangiry/version.rb

Constant Summary collapse

VERSION =
"0.0.4"

Class Method Summary collapse

Class Method Details

.call(account_sid, auth_token, from_number, to_number, url, calling_time) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/wangiry.rb', line 5

def self.call , auth_token, from_number, to_number, url, calling_time
  calling_time ||= 8

  client = Twilio::REST::Client.new(, auth_token)
   = client.
  #calling #{calling_time} sec
  call = .calls.create({:from => from_number, :to => to_number, :url => url, :timeout => calling_time})
  #cancel if over calling_time
  call.tap {|t| sleep(calling_time)}.cancel
end