Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

twilio javascript api through get call sid is that possible?

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

like image 569
Pratik Bhiyani Avatar asked Nov 10 '22 06:11

Pratik Bhiyani


1 Answers

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!

like image 133
Jeremi Ross Avatar answered Nov 14 '22 21:11

Jeremi Ross