can we detect voicemail with ivr_detection with ac...
# ask-ai
h
can we detect voicemail with ivr_detection with accuracy, if so how?
✅ 1
t
Thanks for reaching out, utkarshsteve7. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you’re asking whether
ivr_detection
can accurately detect voicemail and how to set it up. Short answer: yes — it can detect IVR/voicemail, but for best reliability you should combine it with other methods. What
ivr_detection
does • Enable
ivr_detection=True
in the AgentSession to detect automated IVR interactions (this includes voicemail). • It’s a built‑in boolean session option and requires no extra model setup on LiveKit Cloud. Expected accuracy • Voicemail/answering‑machine detection with LLM‑based approaches is typically around 70–80% accuracy.
ivr_detection
helps, but voicemail behavior varies by carrier and region, so it won’t be perfect alone. How to improve accuracy (recommended) • Combine methods: ◦ Keep
ivr_detection=True
. ◦ Add LLM‑based classification of the early speech segment to decide “human vs machine” using content/pattern signals. ◦ Use silence detection (e.g., disconnect if no user speech for ~5 seconds after greeting) to flag voicemails. • Test with real call samples and tune thresholds (silence timeout, confidence cutoffs) against your target carriers and languages. If you want, tell me: • whether this is for outbound or inbound calls, • which language(s) you need to support, • and whether you can run LLM classification in your pipeline— and I’ll give concrete config suggestions and threshold values to try. Sources: Agent session | LiveKit Documentation | How to detect and handle silence during calls, with interactive elements
h
so it is not supported in self hosted approach?
t
Thanks — you're asking if
ivr_detection
works with a self‑hosted LiveKit deployment. Short answer: It's not confirmed that
ivr_detection=True
is fully supported self‑hosted. The session option exists, but the IVR/voicemail models and inference used by
ivr_detection
appear to be deployed in LiveKit Cloud, so that behavior may be cloud‑only. What you can do instead (self‑hosted): • Implement LLM‑based voicemail detection locally to classify early call audio (LLM approaches reach ~70–80% accuracy). • Add silence detection (e.g., disconnect or flag when no user speech for ~5s after the greeting). • Combine LLM classification + silence rules for higher reliability. If you want, tell me: • whether this is outbound or inbound, • what languages/carriers you must support, • and whether you can run an LLM locally— and I’ll propose concrete implementation steps and threshold settings for a self‑hosted setup. Sources: Agent session | LiveKit Documentation | send_dtmf_events | LiveKit Documentation | How to detect and handle silence during calls | examples/voice_agents | livekit/livekit_composite | DeepWiki | examples/drive-thru | livekit/livekit_composite | DeepWiki, with interactive elements
h
outbound calls english openai realtime model
t
Thanks — this is helpful context. Quick summary:
ivr_detection
may not work in self‑hosted deployments (its models/inference appear cloud‑hosted). For outbound English calls using an OpenAI realtime model on self‑hosted infrastructure, use an LLM‑based classifier + silence heuristics. Here’s a concise plan you can implement: 1) Capture the early audio • After call connect, record or stream the first 2–6 seconds of the callee audio to the OpenAI realtime model for analysis. 2) LLM realtime classification • Send the early transcript (or short audio) to the OpenAI realtime model and ask a compact prompt to classify: human answered, voicemail/answering machine, or IVR. • Use confidence thresholds (e.g., treat >0.8 as voicemail, 0.6–0.8 as uncertain). 3) Silence & timing heuristics (combine with LLM) • If no speech detected for ~5 seconds after the greeting, flag as voicemail. • If a long prerecorded greeting pattern (monotone or TTS‑like) is detected, flag as voicemail/IVR. • Use both signals: require either LLM=voicemail OR (silence >5s AND greeting detected) to mark voicemail. 4) Retry / fallback behavior • If flagged voicemail, optionally leave message or schedule retry. • If uncertain, either attempt a short live agent callback or escalate to additional checks (longer audio sample). 5) Practical settings to try (starting point) • Audio sample: 2–6s (start at 4s). • Silence threshold: 5s. • LLM confidence cutoffs: voicemail >= 0.8, human >= 0.8; 0.6–0.8 = uncertain. 6) Observability & tuning • Log decisions, store labeled samples, and iterate thresholds per carrier/region. • Run A/B tests on sample sets to measure real accuracy and adjust. If you’d like, I can: • Provide a sample prompt for the OpenAI realtime model, • Show example code to stream audio + call the model, • Or propose exact thresholds after you share some labeled call samples. Which of those would you like next? , with interactive elements