We have an existing application that I am trying to add a new feature to. The platform has Twilio webhooks handled by a dotnet backend and a Twilio client in a Next.js application to handle the calling itself.
I would like the server to be able to make information available to the client by setting custom parameters in the call. This is working great for incoming calls to the Twilio client, but not for outgoing calls.
I am putting the custom parameters in the returned Twiml for the outgoing call webhook. I can see in the Twilio console that these parameters are present and have the correct values:
However these custom parameters, it seems, are not passed back to the client that's making the call. If I dump the call object into the dev console, we see that only the two custom parameters that I generated on the client are present:
How can I make the Twilio call in the JS application "refresh" itself? The Twilio docs don't mention anything of the sort. Failing that, is there some other mechanism provided that I can use to provide the server-sourced information back to the client?