I keep getting the same error since I upgraded to:
gem 'twilio-ruby', '~> 5.0.0.rc4'
The call was successful set to Twilio, but the getting some error.
app/controllers/home_controller.rb:59:in `rescue in call'
require "rubygems"
require "twilio-ruby"
def call
@twilio = Twilio::REST::Client.new account_sid, auth_token
begin
@call = @twilio.account.calls.create({
:to => ,
:from => twilio_number,
:url => url,
:method => "GET",
:if_machine => "Hangup",
:timeout => "20"
})
# Getting current call status (seems like error here...!)
get_status(@call.sid)
rescue Twilio::REST::RequestError => error
@err_msg = error.message
puts @err_msg
#returned error is like below:
#NameError (uninitialized constant Twilio::REST::RequestError)
end
end
Code for getting current call status:
def get_status(sid)
@twilio = Twilio::REST::Client.new account_sid, auth_token
@call = @twilio.account.calls.get(sid)
puts "Process Status : " + @call.status
return @call.status
end
Please help to figure it out.
Thank you!