Skip to main content
Build an IVR (Interactive Voice Response) menu in LiveKit that responds to both voice commands and keypad presses (DTMF tones).

View on GitHub

Clone and run the full working example

Getting started

Overview

Some callers are in noisy environments or prefer pressing keys over speaking. This example shows how to build a LiveKit agent that handles both speech input and DTMF keypad input simultaneously - providing a reliable IVR experience for all callers.

How it works

  1. The agent presents menu options via text-to-speech.
  2. The agent listens for both speech (“press 1 for billing”) and DTMF tones.
  3. Whichever is detected first triggers the routing logic.
  4. The appropriate sub-menu or action is invoked.

IVR menu structure

DTMF detection

LiveKit forwards DTMF tones from the SIP leg through the SIP INFO method. The agent subscribes to DTMF events on the room and maps digits to menu choices.

Environment variables

.env