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 account_sid, auth_token, from_number, to_number, url, calling_time calling_time ||= 8 client = Twilio::REST::Client.new(account_sid, auth_token) account = client.account #calling #{calling_time} sec call = account.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 |