Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIP disconnect_reason don't work #294

Open
AutoScrape123TX opened this issue Feb 21, 2025 · 7 comments
Open

SIP disconnect_reason don't work #294

AutoScrape123TX opened this issue Feb 21, 2025 · 7 comments

Comments

@AutoScrape123TX
Copy link

Using Python to connect inside room with SIP Participant
livekit 0.20.1
livekit-api 0.8.2
livekit-protocol 0.9.0
sip v0.9.0 at commit bdb7658
livekit 1.8.3 at commit 4016e3dc5aa14c028d40d01dd4f42a52fc977d68

SIP Participant disconnect_reason will always be 'None'

while the event is received on room participant_disconnected event emitter.

@room.on("participant_disconnected")
def _on_participant_disconnected(participant: rtc.RemoteParticipant):
    print(participant.disconnect_reason)
Reason for the participant's disconnection.  Returns one of DisconnectReasons or None if the participant isn't disconnected. Common reasons are: - CLIENT_INITIATED - the client initiated the disconnect - DUPLICATE_IDENTITY - another participant with the same identity has joined the room - SERVER_SHUTDOWN - the server instance is shutting down - PARTICIPANT_REMOVED - RoomService. RemoveParticipant was called - ROOM_DELETED - RoomService. DeleteRoom was called - STATE_MISMATCH - the client is attempting to resume a session, but server is not aware of it - JOIN_FAILURE - client was unable to connect fully  When dialing a participant via SIP, you may see the following reasons: - USER_UNAVAILABLE - SIP callee did not respond in time - USER_REJECTED - SIP callee rejected the call (busy) - SIP_TRUNK_FAILURE - SIP protocol failure or unexpected response

While testing with 'normal' participant, the disconnect_reason will always be 'None' while checking on participant_disconnected event emitter.

@AutoScrape123TX
Copy link
Author

May it seems the right way to get the information : https://github.com/livekit-examples/outbound-caller-python/blob/main/agent.py

@AutoScrape123TX
Copy link
Author

May it seems the right way to get the information : https://github.com/livekit-examples/outbound-caller-python/blob/main/agent.py

Do not work also while directly requesting the livekit api room participant info. I didn't test it while infering from agent ctx. But the objective was to get it naturally from the room emitting events...

@javimosa
Copy link

I'm facing the same issue

@navjotdhanawat
Copy link

Facing same issue

1 similar comment
@sailorjs0804
Copy link

Facing same issue

@davidzhao
Copy link
Member

confirmed this is a bug on our side, we are working on a fix

@davidzhao
Copy link
Member

Will be fixed in livekit/python-sdks#367 for Python and livekit/node-sdks#428 for Node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants