ruby - Retrieving CallSid for incoming call -


when ruby script makes outgoing calls through twilio, it's piece of cake me find, output, , reuse call sid later such :

@client = twilio::rest:client.new account_sid, auth_token

call = @client.account.calls.create({ :from=>'inc', :to=>'out', :url=>'url', :method=>'get'})

puts call.sid

this works fine outgoing calls make myself.

the issue when try call sid incoming calls.

get '/greeting' do

twilio::twiml::response.new |r|

r.say 'hello. welcome.'

r.gather :numdigits => '1', :action => '/greeting/handle-gather', :method => 'get' |g|

g.say 'for x, press 1. y, press 2. z, press 3.'

end

end.text


puts twilio::twiml::request.callsid

callsid = incoming_cid

end

the incoming_cid stored in mysql database later. i'm not sure if twilio::twiml::request.callsid correct way request parameters twilio passes application.

how retrieve callsid incoming calls?

nevermind, issue been solved using ruby's params instead of twilio http request object:

puts params['callsid']


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -