thousands-football-71253
11/12/2025, 3:12 AMtall-airline-16756
11/12/2025, 3:12 AMtall-airline-16756
11/12/2025, 3:13 AMsip.callStatus. When this status updates to hangup, it means the call was ended by the other party.
Here’s a simple example in Python that might make things clearer:
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 has been ended by the other party")
ctx.room.on("participant_attributes_changed", on_participant_attributes_changed_handler)
Additionally, you can take advantage of system-level analytics events like SIP_CALL_ENDED or use the OnSessionEnd callback in a custom SIP service to handle this programmatically.
If you’d like, I’m here to help you walk through the implementation or answer any other questions you might have!
Sources: SIP participant | LiveKit docs | pkg/sip/inbound.go | livekit-protocol/livekit/protocol/analytics.pyi | telephony/sip_lifecycle.pythousands-football-71253
11/12/2025, 3:14 AMtall-airline-16756
11/12/2025, 3:14 AMsip.callStatus doesn’t reach active.
2. Check the Disconnect Reason: When the SIP participant disconnects, take a look at the reason behind it. For example:
◦ `USER_UNAVAILABLE`: This means the callee didn’t answer within the timeout period.
◦ `USER_REJECTED`: This indicates the callee explicitly rejected the call.
1. Try using `wait_until_answered`: When you create a SIP participant, you can set wait_until_answered=true. If the call isn’t answered or gets rejected, the API will give you an error with all the details you need.
If you’d like, I’m here to help you implement any of these methods—just let me know!
Sources: Making outbound calls | LiveKit docs | SIP participant | LiveKit docs | livekit-ffi/protocol/participant.proto | Agents telephony integration | LiveKit docs | protobufs/livekit_sip.protothousands-football-71253
11/12/2025, 3:16 AMtall-airline-16756
11/12/2025, 3:17 AMwait_to_welp isn’t a valid field in the CreateSIPParticipantRequest. The right field name you want to use is actually wait_until_answered.
Here’s a simple way to fix it:
request = CreateSIPParticipantRequest(
sip_trunk_id="<trunk_id>",
sip_call_to="<phone_number>",
room_name="my-sip-room",
participant_identity="sip-test",
wait_until_answered=True
)
Just swap out wait_to_welp for wait_until_answered in your request setup. If you have any questions or need a hand with anything else, feel free to reach out—I’m here to help!
Sources: SIP APIs | LiveKit docs | livekit-protocol/livekit/protocol/sip.py | Make outbound calls | LiveKit docs | agent.py | livekit/livekit_sip.pb.go