faint-arm-51818
10/07/2025, 12:49 PMtall-airline-16756
10/07/2025, 12:49 PMtall-airline-16756
10/07/2025, 12:50 PMsip.callStatus participant attribute. If a call moves straight from dialing (for outbound) or ringing (for inbound) to hangup without ever becoming active, that’s a sign it wasn’t answered.
In your agent code, you can listen for changes in sip.callStatus by using the on("participant_attributes_changed") event. Here’s a little example to guide you:
def on_participant_attributes_changed_handler(changed_attributes: dict, participant: rtc.Participant):
if participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP:
if 'sip.callStatus' in changed_attributes:
call_status = changed_attributes['sip.callStatus']
if call_status == 'hangup':
print("Call was not picked up.")
Also, for outbound calls, you might find it helpful to use wait_until_answered=True in the create_sip_participant method. This way, the call will pause until it’s either answered or fails. If it’s not answered, an error will be raised that you can catch and handle in your code.
If you’d like, I’m here to help you through the implementation or answer any other questions you might have!
Sources: SIP participant | LiveKit Docs | telephony/sip_lifecycle.py | agent.py | How to detect and handle silence during calls | pkg/sip/participant.go