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.

Can You Send DTMF Digits During a Bidirectional Media Stream Call?

Question

How can I send or inject DTMF digits into an active call while using bidirectional Media Streams (<Connect><Stream>) without interrupting the existing WebSocket connection?

 

Product

Programmable Voice, Media Streams

 

Answer

The raw Media Streams WebSocket protocol does not currently support outbound DTMF injection. Using <Play digits="..."/> is the only way to emit RFC-2833 DTMF, but it requires interrupting and reconnecting the stream.

Consider these alternatives to avoid interrupting the active call:

  1. Twilio Conversation Relay: If building an AI voice agent, Conversation Relay natively supports sending mid-call DTMF directly over the WebSocket via a sendDigits message without dropping the stream.
  2. Pre-Dialing (SendDigits): If the IVR path is known in advance, pass the SendDigits parameter (e.g., SendDigits="wwww1234#") when creating the outbound call via the REST API to play the tones automatically upon answer.

 

Additional Information

Have more questions? Submit a request
Powered by Zendesk