If you want an agent to handle voicemail in LiveKit, you can set up voicemail detection using a function tool. This tool kicks in whenever the agent picks up that it’s reached an answering machine or voicemail system. Then, the agent can leave a message and end the call smoothly.
Here’s a quick rundown:
•
Define a Function Tool: Build a tool that activates once the voicemail greeting is detected. For example, it can leave a message and hang up the call.
•
Integrate with Call Flow: Make sure the agent waits for the recipient to speak first and uses the LLM to figure out if the audio is a voicemail greeting.
•
Dispatch Properly: Set clear dispatch rules so the voicemail handling task goes to the right agent.
•
Test the Flow: Use the LiveKit CLI to send the agent and start a call to check that voicemail handling works as expected.
Would you like me to walk you through the detailed steps or help you set this up?
Sources:
livekit-agents/livekit/agents/voice/agent_activity.py |
agent.py |
ivr-nagivator/agent.py |
Agents telephony integration | LiveKit Docs |
Agent Testing & Evaluation | livekit/livekit_composite | DeepWiki