ruby - Twilio: Finding the SID of a call or a conference -
i having trouble find sid of call or conference once created.
i need these parameters, in order modify live call, or kick participant conference.
starting basic example (i'm coding in ruby) :
//paramaters\
require 'twilio-ruby'
account_sid = '//myaccount#'
auth_token = '//myauthtoken'
creating call :
@client = twilio::rest::client.new account_sid, auth_token
call = @client.account.calls.create({:from => '//outgoing#', :to => '//incoming#', :method => 'get'})
puts call.sid
then hangup part :
@hangup = @client.account.calls.get("callsid")
@call.update(:status => 'completed')
puts @call.direction
so can see, execute second part (hangup), need have sid of call created in order modify later (either redirect it, put in conference, or hang up.)
puts call.sid
should outputting sid console.
if need use later, can assign variable instead:
@sid = call.sid @hangup = @client.account.calls.get(@sid)
Comments
Post a Comment