I have twilio.js setup in my rails application and works well, now what I need is after the call is disconnected I want to know the call status, if the call is not attended I have to call another number this is my disconnect function, how to check the call status using twilio.js?
Twilio.Device.disconnect(function(connection) {
// Disable the hangup button and enable the call buttons
hangUpButton.prop("disabled", true);
callCustomerButtons.prop("disabled", false);
callSupportButton.prop("disabled", false);
updateCallStatus("Ready");
});