0
votes

I'm working on an in-browser call-centre application and am using the Twilio JavaScript SDK to achieve this. I have created a TwiML application in the Twilio console and provided a 'voice request URL' to return the TwiML, and this works successfully.

The part I'm struggling with is getting the call status returned once the call has ended. The console allows me to provide a 'Status Callback URL' however I need to also pass a dynamic reference to this url to look up specific details about the context of the call within my database.

To initiate the call, I call the connect method passing my reference ie..

Twilio.Device.connect({
    Reference: $(this).data('reference')
});

However this does not get passed along with the parameters within the status callback url.

1
have you tried this [twilio.com/docs/api/twiml/client]. there is attr(statusCallback) url which hit every time call status changeJohn Ambrose

1 Answers

1
votes

Twilio developer evangelist here.

I assume you are storing some details about the call already. I recommend you also store the call's SID. This is the id for the call within Twilio and will be sent in the parameters of the status callback URL. If you store the Call SID with the other details you keep, then you can match up the callback too.