Interface NormalizedDtmfReceived

DTMF (Dual-Tone Multi-Frequency) digit received during a call.

DTMF events do NOT trigger a call state transition -- the call remains in its current state (typically listening or active). They are relayed as informational events so higher-level logic (e.g., IVR menus, PIN entry) can react to caller key-presses.

Provider behavior differences

  • Twilio: DTMF arrives both via <Gather> webhook callbacks (as Digits param) and via the media stream WebSocket (as dtmf events with duration).
  • Telnyx: DTMF arrives only via call.dtmf.received HTTP webhooks -- never over the media stream WebSocket.
  • Plivo: DTMF arrives via <GetDigits> XML callback (as Digits param) in webhook POST bodies.

Example

if (event.kind === 'call-dtmf') {
console.log(`User pressed ${event.digit} for ${event.durationMs}ms`);
}
interface NormalizedDtmfReceived {
    eventId: string;
    providerCallId: string;
    timestamp: number;
    kind: "call-dtmf";
    digit: string;
    durationMs?: number;
}

Hierarchy

  • NormalizedEventBase
    • NormalizedDtmfReceived

Properties

eventId: string

Provider-assigned event ID for idempotency.

providerCallId: string

Provider-assigned call ID.

timestamp: number

Unix timestamp (ms).

kind: "call-dtmf"
digit: string

The digit pressed by the caller.

Standard DTMF digits: '0'-'9', '*', '#'. Extended DTMF (rarely supported): 'A'-'D'.

durationMs?: number

How long the key was pressed in milliseconds, when available.

Not all providers report duration -- Twilio's media stream includes it, but Telnyx and Plivo webhook payloads typically omit it.