presently how to differentiate and identify, an ou...
# ask-ai
o
presently how to differentiate and identify, an outbound call which user picked up, and where the call went to voicemail with livekit? both from telnyx vendor are showing up with 200ok in sip response, and we are seeing sip.callStatus participant attribute as active only for both the cases. is there a reliable way to detect user picked up or voicemail?
t
Thanks for reaching out, Jaivarsan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about detecting whether an outbound call was answered by a human or by voicemail (both showing 200 OK and
sip.callStatus = active
). Short answer: SIP signaling won’t reliably tell you human vs voicemail. Use audio/behavioral signals instead. Recommended approaches (pick one or combine): • Silence / speech-pattern detection ◦ Monitor
user_started_speaking
/
user_ended_speaking
events. If no speech occurs for several seconds after
sip.callStatus
becomes
active
(e.g., 5–10s), it’s likely voicemail. Quick short interactive speech soon after answer suggests a human. • Transcription / keyword detection ◦ Transcribe the first few seconds and check for voicemail phrases like “you’ve reached”, “leave a message”, “after the beep”, etc. A match → voicemail. • LLM / heuristic classifier on initial audio ◦ Run a short classifier on the initial N seconds of audio (silence patterns + transcript). This reduces false positives vs simple silence rules. Notes: •
wait_until_answered: true
(CreateSIPParticipant) returns only after answer but does not distinguish voicemail from a human — both can result in
active
. • These methods are probabilistic; combining silence detection + transcription gives the best practical accuracy. If you’d like, tell me: 1) How you currently receive speech events/transcripts (Agents events or other), and 2) The exact timing you consider acceptable for detection (e.g., 5s, 10s), and I’ll give a concise implementation sketch you can drop into your agent flow. Sources: Agents Framework | livekit/livekit_composite | DeepWiki | Agents telephony integration | LiveKit docs | SIP APIs | LiveKit docs | Agent session | LiveKit docs