g
.
✅ 1
t
Thanks for reaching out, Michael. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi — I didn’t receive any details in your last message. Could you tell me what you need help with? • If it’s an error, please include the exact error text, room ID, and any logs or screenshots. • If it’s a setup or integration question, tell me which SDK or platform you’re using and what you’ve tried so far. I’ll take it from there. , with interactive elements
g
how do you detect voice mail. is there a way to build a tool to detect voice mail and handle it ina custom way
t
Thanks — I’m responding to your question about detecting voicemail and building a custom handling tool. Short answer • You can’t rely on a single built‑in “voicemail detector,” but you can detect voicemail effectively by combining approaches: LLM-based classification, silence detection, and custom audio analysis. LiveKit supports building custom tools and workflows to handle voicemail state transitions. How others do it (recommended approach) • LLM-based detection: Use an LLM to classify whether the audio stream is a voicemail/answering machine. Reported accuracy is ~70–80% for outbound scenarios. • Silence detection: Monitor for sustained silence (e.g., a configurable SILENCE_THRESHOLD like ~5s) and treat long, uninterrupted silence as a voicemail signal. Reset the timer when
user_started_speaking
(or equivalent) fires. • Hybrid: Run silence detection first for a quick heuristic, then pass a short audio snippet or call transcript to an LLM for a confidence score before taking action. How to build it in LiveKit 1. Create a detection tool (example pattern): ◦ Implement a
detect_voicemail
tool/function that: ▪︎ Streams or samples early call audio. ▪︎ Runs silence detection logic (timer reset on speech events). ▪︎ Optionally sends audio/text to an LLM classifier for final decision. ▪︎ Returns structured output (e.g.,
{ voicemail: true/false, confidence: 0.82, reason: "long_silence + LLM" }
). 1. Integrate into your call flow: ◦ Run
detect_voicemail
immediately after answer. ◦ If voicemail is detected, trigger your custom handling: leave a message, hang up, route to voicemail box, or warm-transfer with
voicemail_detected
handling. 1. Use existing helpers: ◦ Use event listeners like
user_started_speaking
to reset silence timers. ◦ The agents framework examples and the WarmTransferTask indicate how voicemail state can be integrated into tasks and transfers. Questions to narrow this for your use case • Are you detecting voicemail for outbound calls only, or inbound as well? • Which SDK/language and agent framework are you using? • Do you want immediate hangup on detection, leave a message, or hand off to human agents? If you tell me your platform and desired action on detection, I’ll give a compact code sketch and threshold recommendations for that stack. Sources: How to detect and handle silence during calls | Agents Framework | livekit/livekit_composite | DeepWiki | examples/voice_agents | livekit/livekit_composite | DeepWiki | WarmTransferTask | LiveKit Documentation, with interactive elements
g
is there no standard way of doing it
t
Short answer: There is no single built‑in, standard "voicemail detector" in LiveKit. What you can do instead • Combine simple heuristics (silence detection) with an LLM/audio classifier for higher accuracy (this is the recommended pattern). • Implement a
detect_voicemail
tool that: ◦ watches for sustained silence (reset on
user_started_speaking
), ◦ optionally samples a short audio clip or transcript and runs an LLM/classifier, ◦ returns structured output (
voicemail: true/false
,
confidence
,
reason
). • Integrate that tool into your call flow and use the existing hooks (e.g., WarmTransferTask’s
voicemail_detected
) to apply your custom handling (leave message, hang up, route, or transfer). If you want, tell me: • outbound vs inbound calls, • which SDK/language you’re using, and • the action you want on detection (hang up, record message, route to agent). I’ll give a short code sketch and threshold recommendations for your stack. , with interactive elements