Skip to main content
Register a handler that fires whenever the caller presses a DTMF digit (0–9, *, #, A–D) on their keypad.
Caller keypresses only. on_caller_dtmf fires for digits pressed by the caller. To enable the agent itself to send DTMF tones (e.g. to navigate an IVR system it has called into), use call.set_agent_dtmf(enabled=True) instead, and register on_agent_dtmf to observe the digits it presses.
Previously on_dtmf: this callback was named on_dtmf before on_agent_dtmf existed. The old name still registers the same handler and keeps working — it just no longer says which side of the call pressed the keys.
The DTMFPressedEvent is a pydantic model imported from guava.events:

Signature

signature
Return value: None

Example

controller.py