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.