Available in
Beta
|
Python
Overview
Use send_dtmf_events to send DTMF (dual-tone multi-frequency) tones to telephony providers. This is essential for navigating phone systems, IVR menus, and automated phone services.
The send_dtmf_events tool:
- Sends DTMF events sequentially with a 0.3-second delay between each event (defined by
DEFAULT_DTMF_PUBLISH_DELAY). - Returns a success message listing all sent events if all events are sent successfully.
- Returns an error message if any event fails to send (stops sending remaining events on first failure).
Handling DTMF
Sending and receiving DTMF in LiveKit telephony apps.
GetDtmfTask
Prebuilt task for collecting DTMF input from users.
Bank IVR example
Full agent that navigates a bank IVR using send_dtmf_events (via ivr_detection=True).
Usage
Add send_dtmf_events as a tool to your agent:
from livekit.agents.beta.tools import send_dtmf_eventsfrom livekit.agents import Agent, function_toolclass IVRAgent(Agent):def __init__(self):super().__init__(instructions="You are an IVR navigation assistant. Help users navigate phone systems.",tools=[send_dtmf_events],)
Parameters
For a full list of parameters, see the send_dtmf_events reference.
events
list[DtmfEvent]RequiredList of DTMF events to send to the telephony provider. Available events include digits, special characters, and letters.