Dual-tone multi-frequency (DTMF) for production voice AI

A telecom engineer sends paired DTMF waveforms from a telephone keypad into an IVR call path.
A telecom engineer sends paired DTMF waveforms from a telephone keypad into an IVR call path.

A voice agent can understand a menu perfectly and still fail when it presses a key. Dual-tone multi-frequency (DTMF) reliability depends on tone transport, timing, call state, carrier behavior, and proof that the interactive voice response (IVR) system accepted the input. Technical teams need an end-to-end model for keypad events across real phone routes.

DTMF in 60 seconds

Dual-tone multi-frequency (DTMF) is the signaling system behind telephone keypad input. Pressing a key represents one low-frequency tone and one high-frequency tone at the same time. A receiver identifies the pair and maps it to a digit or symbol.

DTMF still handles tasks such as selecting an interactive voice response (IVR) option, entering an extension, supplying an account number, and confirming an action. In voice AI, it works in both directions:

  • A caller presses keys and the voice agent receives the digits.
  • A voice agent sends digits to navigate another system's IVR menu.

The second case is harder than a conceptual sendDigits() operation suggests. The digit has to reach the correct call leg in a format the destination accepts, at a time when it is listening. The agent then needs evidence that the menu moved to the intended state.

Our configurable IVR detection lets an outbound agent identify an automated system. Optional menu navigation is enabled separately and uses the digits 0-9, *, and # to work through a phone tree. The production acceptance bar remains end-to-end success on the routes and IVRs the product will call.

How dual-tone multi-frequency works

The standard keypad is a frequency matrix. Each row supplies a low-group frequency and each column supplies a high-group frequency. The intersection identifies the key.

Low group1209 Hz1336 Hz1477 Hz1633 Hz
697 Hz123A
770 Hz456B
852 Hz789C
941 Hz*0#D

For example, the digit 1 combines 697 Hz and 1209 Hz. The two-tone design gives the decoder a specific pair to detect and reduces the chance that ordinary speech will be mistaken for a key press. The full 4-by-4 layout includes A through D, although consumer phones usually expose only 0-9, *, and #.

The tone definitions come from ITU-T Recommendation Q.23. Modern IP calls can carry the resulting input as audio, a Real-time Transport Protocol (RTP) telephone event, or application data in Session Initiation Protocol (SIP) signaling. That distinction determines whether a clean key press survives the call path.

The three DTMF signaling modes

Teams often use in-band and out-of-band as if they name two universal settings. The real path has three common modes, and the terms describe different layers.

ModeWhat crosses the networkBest fitMain failure risk
In-band audioThe two-frequency waveform is mixed into the voice audioA destination that detects audible tones and accepts no event formatSpeech codecs, transcoding, packet loss, gain control, or audio processing distort the tone
RTP telephone eventsA named event travels in an RTP payload separate from audio samplesSIP and Voice over Internet Protocol (VoIP) paths that negotiate telephone-eventSession Description Protocol (SDP) negotiation, payload mapping, or an intermediary drops or mistranslates the event
SIP INFOA SIP request carries digit data inside the established dialogEndpoints and providers with an agreed INFO conventionSession border controllers (SBCs) or call legs disagree about the body format, negotiation, or forwarding behavior

In-band audio

In-band DTMF is literal sound in the media stream. It can work well on a clean G.711 codec path. Reliability falls when a speech-oriented codec, transcode, noise processor, or lossy network changes the waveform. A recording that sounds acceptable to a person does not prove that an IVR decoder received both frequencies for long enough.

RTP telephone events

RFC 4733 defines named telephone events in RTP and obsoletes RFC 2833. Providers still commonly call the mode “RFC 2833.” An SDP offer often advertises a dynamic payload mapping such as telephone-event/8000 and a supported event range.

DTMF events 0-9 use event codes 0-9, while *, #, and A-D use codes 10-15. The payload also carries an end flag, volume, and cumulative duration. Repeated packets can report the same event for resilience. A receiver must distinguish that redundancy from a second key press.

RTP events are out-of-band relative to audio samples, yet they still travel in the RTP media session. Every gateway, carrier, session border controller, and transfer path still has to preserve the event or convert it correctly.

SIP INFO

SIP INFO moves application information inside a SIP dialog. DTMF conventions built on INFO are less uniform. The SIP INFO framework notes that legacy DTMF mechanisms were proprietary and created interoperability problems. INFO is reliable only when the endpoints and intermediaries agree on the convention and forward it through the whole dialog.

A provider API may hide these modes behind one “send digit” operation. That is useful abstraction, but the underlying call leg still uses audio, RTP events, SIP INFO, or a provider-specific conversion. An accepted API request proves that the command entered the provider. It does not prove that the destination IVR acted on it.

How a voice agent should navigate an IVR

Reliable navigation is a state machine with an AI decision inside it. The transport and retry logic belong in deterministic runtime code.

  1. Classify the answer. The runtime distinguishes a human, voicemail, an IVR greeting, and early media.
  2. Build the current menu state. The agent extracts the available options and keeps digit strings as strings, preserving leading zeros and terminators such as #.
  3. Wait for an input window. A prompt boundary, beep, silence interval, or explicit call state establishes when the IVR is ready.
  4. Choose an allowed action. The model selects from the valid menu options or a deterministic policy supplies the digit.
  5. Emit one semantic DTMF event. The telephony layer maps that event to the negotiated transport for the active call leg.
  6. Observe the result. A new prompt, transfer tone, ringback, human speech, or terminal response shows whether the menu advanced.
  7. Apply a bounded recovery policy. No progress can trigger one slower retry, a different transport where the route supports it, a human handoff, or a clean exit.

This separation matters. Sending both an RTP event and an audible fallback at the same time can create a duplicate digit. Letting the language model write raw media packets gives it responsibility for timing and protocol state it cannot observe reliably.

The success signal is the IVR's next state. A completed SIP request, a sent RTP packet, or the local sound of a tone is only delivery evidence for one layer.

Production DTMF failures and their causes

The call legs use different modes

A platform sends RTP telephone events while the destination listens only for in-band audio. The reverse can happen after a carrier or private branch exchange (PBX) converts an event into a waveform. Mode support has to be understood per leg, including any gateway between VoIP and the public switched telephone network (PSTN).

The digit arrives too early

A call may still be playing early media, a greeting, or a prompt that ignores input. Fixed sleeps hide the race on one route and expose it on another. Prompt-aware state and a conservative input window are more stable than a single global delay.

Tone duration or interdigit gaps are wrong

A digit that is too short may be ignored. A long digit can have a special meaning on some equipment. A fast sequence can merge or overrun a legacy decoder. RFC 4733 cites 40 ms as a legacy minimum recognizable signal duration and 40 ms as a minimum pause in the equipment surveyed by ITU-T Q.24. Those values describe a compatibility floor, not a universal production setting. Destination behavior and the negotiated transport determine the accepted timing envelope.

Redundant packets become duplicate digits

RTP telephone events repeat state so a receiver can survive packet loss. A naive consumer that creates one application event per packet can turn 5 into 555. Deduplication uses the event code, RTP timestamp, synchronization source, duration progression, and end flag.

The mode changes during the call

Transfers, bridges, conferences, re-INVITEs, and carrier failover can create a new media leg or SDP mapping. DTMF that worked before a transfer can fail afterward if the runtime keeps using stale payload or route assumptions.

Audio processing damages in-band tones

Voice activity detection, echo control, automatic gain control, denoising, and speech codecs are optimized for conversation. In-band tones need a path that preserves the frequency pair and duration. DTMF bypasses speech-to-text; sending the tone through the transcription path adds delay and another decoder with no benefit.

Sensitive digits leak into AI and observability systems

DTMF can carry account numbers, access codes, or payment data. Raw values do not belong in language-model prompts, transcripts, recordings, analytics properties, or ordinary logs. The event pipeline can expose direction, count, timing, transport, and outcome while redacting the value. Workflows that collect regulated data need a purpose-built compliant path.

An implementation pattern for reliable keypad handling

A production design treats a digit as a semantic event from the application to the telephony edge.

At the application layer, the navigation policy produces a conceptual action such as send_dtmf("2"). The action includes the call ID, leg ID, direction, and correlation ID. Secret sequences are marked before they enter logging or model context.

At the session layer, call state establishes whether media is ready and which leg is active. The system serializes a sequence, applies duration and gap policy, and prevents concurrent speech or a second navigation action from creating overlapping input.

At the transport layer, the runtime uses the negotiated RTP payload, an agreed SIP INFO convention, or controlled in-band generation. One edge owns conversion. Parallel fallbacks stay disabled unless the destination's behavior explicitly requires them.

At the receiving side, repeated RTP reports collapse into one digit event. A complete event records start, duration, end, source, and transport. The application receives a normalized digit instead of raw packets or a transcript token.

At the outcome layer, the next IVR state closes the loop. Each attempt ends as accepted, rejected, timed out, duplicated, or unknown. Retries are bounded and carry the original correlation ID.

This model makes a transport change local. The conversation policy still chooses “billing” or “operator,” while the telephony edge handles how 2 or 0 crosses a specific route.

A production DTMF acceptance suite

A local tone generator proves the frequencies. Production acceptance has to exercise the complete path from agent decision to destination behavior.

Use the matrix to assign test IDs, then complete a route record and an attempt record for each case. One route record covers one real carrier and gateway path to a destination IVR. A different route needs its own record. Scope transport cases to supported paths; record unavailable evidence as unknown.

Coverage and acceptance requirementTest IDs and results
Send and receive: agent-to-IVR and caller-to-agent digits. Each semantic digit appears once and reaches the expected application or IVR state.…
Symbols and sequences: 0-9, *, #, leading zeros, terminators, long IDs, rapid and slow entry. Preserve exact count and order without loss, merge, or duplication.…
Transport: each supported in-band, RTP event, SIP INFO, and provider-API path. Show the negotiated or agreed mode and destination acceptance separately.…
Telephony route: each carrier, SIP trunk, region, number type, and PSTN gateway in scope. Outcomes meet the product's stated release threshold.…
Media conditions: packet loss, jitter, transcoding, low audio level, and noise processing. Show recovery or a classified failure, never silent false success.…
Call lifecycle: early media, answer, hold, transfer, bridge, re-INVITE, and failover. Follow the active leg and current negotiation.…
IVR behavior: prompt barge-in, delayed prompts, repeated menus, invalid options, and slow transfers. Bounded recovery reaches a known terminal state.…
Privacy: secret entry with recording, transcription, tracing, and analytics active. Values remain absent from unapproved storage and model surfaces.…

Fillable record for one real call route

Replace … with evidence or an explicit status. Keep raw values only for non-sensitive test inputs. For sensitive flows, use approved evidence references, redacted values, counts, and timing without copying secrets into the record.

Route fieldEntry
Record identity… Route ID, test IDs, environment, run time, and reviewer
Path and direction… Carrier, SIP trunk, region, number type, gateway sequence, destination IVR, and send/receive direction
Correlation… Call ID, dialog ID, leg IDs, policy version, and correlation ID
Release rule… Required cases, outcome threshold, retry limit, and allowed fallback or exit
Evidence handling… Approved evidence locations, access restrictions, and redaction result

Complete the next block once per call leg, identifying both endpoints and the direction. Repeat it when a transfer, re-INVITE, or failover changes the leg or negotiation. Different modes on adjacent legs are valid when a defined conversion connects them.

Per-leg fieldEntry
Leg and state… Leg ID, endpoint pair, direction, lifecycle state, and effective time
Mode and agreement… Configured and negotiated/agreed mode, with SIP/SDP or provider-configuration evidence references
Mode details… RTP payload mapping, clock rate, and event range; agreed INFO body convention; or in-band codec and audio-processing path, as applicable
Conversion… Ingress mode → egress mode, responsible gateway/edge, configuration reference, and observed input/output evidence or unknown

Fillable record for each digit attempt

Keep all times on a stated clock or relative to a common origin. Record clock offsets or uncertainty when correlating different sources. Configured duration and gap are policy inputs; observed event or audio timing is separate evidence. Neither establishes when the IVR was ready.

Attempt fieldEntry
Identity and decision… Attempt ID, parent correlation ID, active leg, menu state, selected action, and policy version
Expected input… Non-sensitive sequence as a string, semantic digit count, and expected next state; redact sensitive values
Prompt readiness… Prompt/menu evidence reference, readiness cue, and cue time
Command delivery… Request time, acknowledgment time/status if present, and the layer each acknowledgment proves
Digit timing… Configured duration and interdigit gap; observed start, duration/end, and gaps for each digit, with evidence references
Observed input… Ordered semantic sequence/count, application-event count, and RTP-event or audio evidence references; use unknown for unobserved layers
IVR acceptance… Next prompt, transfer state, human answer, or explicit rejection, with time and evidence reference; accepted, rejected, timed out, or unknown
Recovery and decision… Delivery result, duplicate status, retry/new attempt ID, fallback or exit, final navigation result, and reviewer pass/fail/unknown with reason

For RTP evidence, retain the event code, event timestamp, synchronization source (SSRC), duration progression, and end flag. Group reports of the same event, accounting for event segmentation, before comparing the observed semantic count with the expected count. Packet count and RTP sequence numbers are not digit identities. A repeated key with a new event timestamp is a distinct event. For in-band evidence, distinguish a local tone-generation record from audio observed farther along the path.

The acceptance field stays separate from command delivery. A sent event, generated tone, API acknowledgment, or SIP response cannot fill in an unobserved IVR outcome. The route passes only when its required cases meet the release rule; an unknown outcome is not a pass.

Synthetic case: a digit arrives before the input window

Assume a non-sensitive menu choice 2, expected sequence "2", count 1. The synthetic scenario places its event start before the readiness cue, followed by a repeated menu.

Enter the readiness and digit-start evidence in separate timing fields. Delivery may be recorded as sent on the observed leg, while IVR acceptance remains unknown: a repeated menu does not establish explicit rejection or prove the cause by itself. The timing supports an early-input diagnosis. Without that evidence, the cause stays unknown.

If the route policy permits a retry, create a new attempt under the same correlation ID and send after the observed readiness cue. Only the expected next IVR state establishes acceptance. No global sleep or universal tone duration follows from this example.

Synthetic case: one key becomes duplicate application events

Assume the non-sensitive input is "5", expected count 1. In this synthetic scenario, repeated RTP reports describe one event, but a naive consumer emits three application events, "555".

Record one transport-level semantic event and three application events. The application-count requirement fails even though multiple RTP reports are normal. Use the event identity and duration/end progression to locate the duplication rather than treating every packet as a key press. A second intentional 5 with a new event timestamp must remain a separate digit.

Keep IVR acceptance independent. If only the local event pipeline is observed, its acceptance field is unknown. Correcting the consumer requires another attempt record; a deduplication change alone is not destination acceptance.

Synthetic case: a suspected per-leg mode mismatch

Assume the non-sensitive input is "2", expected count 1. The synthetic route has RTP telephone events on the upstream leg and an in-band-only downstream leg. Conversion is required at their boundary.

An upstream event establishes evidence for that leg. It does not establish downstream tone generation. If the conversion or downstream observation is unavailable, enter unknown for that evidence and classify a mode mismatch as suspected, not proven. If downstream evidence establishes that the required tone was not generated, classify the delivery failure at the conversion boundary.

Record the IVR's response separately. No observed next state means acceptance is unknown, regardless of upstream delivery. A recovery attempt uses a supported conversion or route configuration and its own record, without sending parallel event and audio fallbacks.

A synthetic IVR gives deterministic regression coverage. Real destination systems expose the carrier, gateway, timing, and decoder differences that a lab cannot reproduce. The release gate uses both. Our broader voice agent testing guide shows how these cases fit into scenario suites, failure injection, and production release controls.

How to evaluate DTMF support in a voice AI platform

“Supports DTMF” is too broad to serve as an acceptance criterion. Technical evaluation needs a defined contract and observable proof.

Evaluation questionProduction-grade answer
Can the platform send and receive digits?Direction, channel, symbols, and limits are stated separately
Which transports work?In-band, RFC 4733 events, SIP INFO, and provider abstractions are named per call type
How is a mode selected?SDP negotiation, provider configuration, and any conversion rules are visible
Can timing be controlled?Duration, interdigit gap, sequencing, prompt timing, and retry behavior have explicit policies
What happens after a transfer?The active leg and renegotiated payload mapping replace stale call assumptions
How are duplicates prevented?RTP retransmissions and application retries have separate deduplication rules
What proves success?The platform correlates digit delivery with the IVR's resulting state
Can failures be debugged?Call, SIP, RTP or audio, decision, and outcome evidence share one correlation path
Are secrets protected?Redaction covers recordings, transcripts, prompts, traces, webhooks, and analytics
Is compatibility demonstrated?The acceptance matrix uses the actual carriers, routes, codecs, transfers, and destination IVRs

Carrier setup is part of that proof. Our SIP trunking guide explains how signaling, SDP, RTP, codecs, and gateways form the call path around a voice agent.

We are a fit when DTMF navigation is one requirement inside a production conversational AI product that also needs telephony, agent behavior, integrations, testing, and monitoring. A simple IVR or PBX feature may be sufficient when the entire job is collecting a few fixed digits with no conversational agent.

A representative evaluation runs one real outbound flow through the intended SIP route and target IVR. Gate deployment on prompt-level navigation success, leg-aware traces, and redacted digit handling. Evaluate Dasha for voice AI.

Share

Subscribe

Sign up to our e-mail list to get the best of the Dasha blog sent directly to your inbox.

We use cookies for functional and analytical purposes. Please refer to our Privacy Policy for details.