Skip to main content
DTMF (Dual-Tone Multi-Frequency) events are generated when a participant presses keys (0-9, *, #) on their phone or SIP device during a call. These events are useful for building IVR flows, collecting user input, or triggering actions in your application.
This page covers the SIP platform side: enabling DTMF on the gateway and the event payload. To handle DTMF from your agent code, see DTMF Handling.

Enabling DTMF Events

DTMF event detection can be enabled in two ways:
  • Via Dashboard:
    • When creating or editing a SIP gateway in the Zero Runtime dashboard, enable the DTMF option.
  • Via API:
    • Set the enableDtmf parameter to true when creating or updating a SIP gateway using the API.
Once enabled, DTMF events will be detected and published for all calls routed through that gateway.

Listening to DTMF Events

To listen DTMF events in a Zero Runtime room, you can subscribe to the DTMF_EVENT topic using the PubSub system. This allows your application to react to DTMF input in real time. Sample Event Payload:
Payload Fields:
  • message: Description of the event.
  • senderId: The unique ID of the participant who sent the DTMF input.
  • timestamp: When the event was received (ISO format).
  • topic: Always DTMF_EVENT for these events.
  • senderName: Name of the participant (if available).
  • id: Unique event/message ID.
  • payload.number: The DTMF digit pressed (0-9, *, #).
  • payload.timestamp: Timestamp (in ms) when the digit was pressed.

Use Cases

  • Build IVR menus and collect user input during calls.
  • Trigger actions in your app based on keypresses (e.g., press 1 for support, 2 for sales).
  • Log or analyze DTMF input for compliance or analytics.
DTMF events are available for both inbound and outbound SIP calls, as long as the gateway is configured with DTMF enabled.