Is it possible to modify the statusCallback, statusCallbackEvent and statusCallbackMethod of the live call ?
I've used this article as a reference https://www.twilio.com/docs/voice/modify-live-calls
In the article, it said you can POST to update the live call but when I tried to update the statusCallback URL, it's not working. There is nothing trigger new statusCallback URL when the call end.
My use case is to
- Tracking call status of inbound call
- Tracking call status of outbound call from Web Client (which we use TwilioClient SDK to make a call to Twiml App)
I know that I can set the statusCallback URL in phone number page for inbound call and in Twiml App page for outbound call. But there are 2 problems with that.
- There is no field to specify the statusCallbackEvent type I need.
- my statusCallback URL is generated dynamically so I can't use hardcode the statusCallback URL. (that's why I'm trying to update the statusCallback URL)
(eg. ${BASE_URL}/voice/:conferenceKey/call/callback)
I'm using NodeJS and here is the example code I used to update the statusCallback. I've also double check that call_sid is matched with live call sid.
return client.calls(call_sid)
.update({
statusCallback: `${process.env.API_HOST}/voice/${conferenceKey}/call/callback`,
statusCallbackMethod: 'POST',
statusCallbackEvent: ['answered', 'completed'],
});
Any help is appreciated, thanks! :)