SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Pass the Status of a Second Call Leg to the Browser in Twilio Voice JavaScript SDK Calls

The Twilio Voice JavaScript SDK does not have a built-in ability to relay the status of a child call back to the user. That said, it is possible to build this into your application.

A simple way to do this would be for the Voice SDK app to make an AJAX or WebSocket request to your server where your TwiML webhook is hosted. This request can check if certain TwiML has been requested, and then pass that information in a response to the AJAX request. Here are some examples you could use to check:

  • a <Number> url attribute call "whisper tone" or pre-answer announcement to the callee - this indicates the call has been answered.
  • a <Dial> action attribute post call URL fetch - this indicates the call has ended.
Have more questions? Submit a request
Powered by Zendesk