How to distinguish between answered calls and voicemail for outbound calls

This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.

How can I differentiate and identify an outbound call where the user picked up vs a call that went to voicemail with LiveKit SDK/webhooks?

In both situations, we’re seeing a 200 OK in the SIP response, and the sip.callStatus participant attribute shows active for both cases.

Is there a reliable way to detect if a user picked up or if it went to voicemail?

A call answer is a call answer - you’ll see a 200 OK for the INVITE regardless of what answered the call on the other end.

What most developers do is use the AI to detect voicemail and handle it accordingly. See the voicemail detection documentation:

For the SIP lifecycle states, this example may help:
https://github.com/livekit-examples/python-agents-examples/blob/main/telephony/sip_lifecycle.py