I have trying to establish a call with javascript client:
function call() { 
// get the phone number or client to connect the call to 
   params = {"PhoneNumber": $("#number").val()}; 
   Twilio.Device.connect(params); 
} 
In incoming call back api we are got the call sid
Twilio.Device.incoming(function (conn) {
   alert(conn.parameters.CallSid);
});
And outgoing call back api we are not get the call sid:
Twilio.Device.connect(function (conn) { 
   alert(conn.parameters.CallSid); // Not working undefine
   $("#log").text("Successfully established call"); 
}); 
How to get call sid when twilio device connect successfully call(outgoing call)
Thanks
In case anyone is still looking for this answer - I found the CallSid on the incoming request, and accessed this via the Server Side. I suppose you could actually grab this on the client as well... The CallSid is just a simple HTTP Request parameter when the call is initiated to your url!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With