Twilio javascript client callback when answering a call
1 answer
Twilio js client has a Device property which has the following methods that you can use.
Twilio.Device.incoming(softPhoneIncoming);
Twilio.Device.connect(softPhoneConnect);
function softPhoneIncoming(conn) {
console.log(conn.parameters.From); // who is calling
conn.accept(); //This will accept the incoming phone call
}
function softPhoneConnect(conn)
{
// Called for all new connections, you could start the timer here
}
+1
source to share