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.

How to Enable Bidirectional Media Streams for Twilio Conference Calls Using a TwiML App?

Question

How can I enable bidirectional media streams for PSTN calls which are part of Twilio conference calls using a TwiML App?

How to Connect Your Voice AI Agent to a Twilio Conference with Bi-Directional Media Streams Using TwiML Apps?

 

Product

Programmable Voice

 

Answer

To enable bidirectional media streams for PSTN calls with Twilio Media Streams, you need to use a TwiML Application with the <Connect><Stream> verb in a conference setup. This approach allows you to both receive audio from the caller and send audio back to the caller in real time. The recommended steps are:

  1. Start a conference for the call ( for example, using <Dial><Conference> )
  2. Add a participant to the conference via the Conference /Participants endpoint, where the TO parameter for the participant is set to app:<APP_SID> that will provide the next instructions
  3. The TwiML Application should return <Connect><Stream>, which enables the media stream
<Response>
   <Connect>
       <Stream url="wss://example.com/audiostream" />
   </Connect>
</Response>

  3. Your server can then receive and send audio in real time through the media stream

 

Additional Information 

For more details and step-by-step instructions, see Twilio’s guide on connecting a TwiML App to a Twilio Conference.

 

 

 

 

Have more questions? Submit a request
Powered by Zendesk