Skip to content

DTMF events

DTMF events are fired when callers press keys on their phone keypad. These include individual key-press events and aggregated digit collection results from the play_and_get_digits command.

Fired when the caller presses a DTMF key during the call. This event fires independently of any command — individual key presses are reported in real time during playback, recording, or any other call state.

Payload schema

FieldTypeDescription
eventstringAlways "dtmf". required
session_uuidstringUnique session identifier. required
digitstringSingle DTMF character: 0-9, A-D, *, or #. required
duration_msintegerKey press duration in milliseconds. required
{
"event": "dtmf",
"session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
"digit": "5",
"duration_ms": 120
}

Fired when the play_and_get_digits command completes DTMF collection. This aggregates multiple key presses into a single result with a status indicating success, timeout, or failure.

Payload schema

FieldTypeDescription
eventstringAlways "digits.collected". required
session_uuidstringUnique session identifier. required
command_uidstringThe command_uid from the play_and_get_digits request. required
digitsstringThe collected DTMF digit string. May be empty on timeout. required
terminatorstringThe DTMF key that terminated collection (0-9, A-D, *, #) or empty on timeout. required
statusstringCollection result. One of success, timeout, failure, unknown. required

Collection statuses

StatusDescription
successThe required number of digits was collected (or a terminator key was pressed).
timeoutThe collection timed out before the minimum number of digits was received.
failureThe collection failed (e.g. channel hangup during collection).
unknownThe collection status could not be determined.

Example — success:

{
"event": "digits.collected",
"session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
"command_uid": "collect-pin-001",
"digits": "1234",
"terminator": "#",
"status": "success"
}

Example — timeout:

{
"event": "digits.collected",
"session_uuid": "acW68-f47ac10b-58cc-4372-a567-0e02b2c3d479",
"command_uid": "collect-pin-001",
"digits": "",
"terminator": "",
"status": "timeout"
}
  • dtmf — automatic: fires on every DTMF key press during active calls.
  • digits.collectedplay_and_get_digits command.