DTMF and WebRTC
Due to the audio codec used in WebRTC connections, DTMF tones are inaudible when using WebRTC. The
Due to the audio codec used in WebRTC connections, DTMF tones are inaudible when using WebRTC. The
playDtmfSounds tool is intended for use with telephony integrations.Receiving DTMF Tones
Ultravox automatically converts incoming DTMF tones to text, making it easy to build interactive voice applications that respond to keypad input. When a caller presses keys on their phone keypad, the tones are converted to text that your AI agent can understand and respond to. For example, if a caller presses “5” on their keypad, your agent will receive this as text and can respond accordingly:Sending DTMF Tones
The built-inplayDtmfSounds tool allows your AI agent to send DTMF tones, which is useful for navigating Interactive Voice Response (IVR) systems or other phone trees. To enable the tool, add it to the selectedTools array when creating a call or call stage:
playDtmfSounds tool accepts a string parameter named digits and works with the following tones: 0-9, *, #, A-D.
For example:
In-band vs out-of-band DTMFThe
playDtmfSounds tool is so named because it defaults to playing DTMF tones as audio (in-band) for compatibility with all phone systems.However, out-of-band DTMF (where tones are sent as signals rather than audio) is generally preferable for its improved reliability and may be required by some telephony stacks.
The same tool will use out-of-band DTMF when the call’s medium supports it and Ultravox has the information available to support it. To use out-of-band
DTMF with supported telephony platforms such as Telnyx or Plivo, add your telephony credentials so Ultravox can send
out-of-band DTMF on your behalf where supported by your provider. (Alternatively you can create your own tool of course.)Common Use Cases
- Building interactive phone trees or IVR systems
- Creating agents that can navigate existing phone systems
- Enabling quick responses through keypad input
- Collecting numeric input (e.g., account numbers, PIN codes)
- Building hybrid voice/keypad interfaces