I’ve deployed my LiveKit agents on my own server, ...
# ask-ai
i
I’ve deployed my LiveKit agents on my own server, and I’m using LiveKit Cloud. For an inbound call, I noticed in the LiveKit Cloud dashboard that the room_closed event payload shows disconnectReason: "CLIENT_INITIATED". Could you please clarify what this means? Who actually ended the call — was it LiveKit, or was the call termination triggered by the user or client side?
t
Thanks for reaching out, Ikya. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I wanted to help clarify the
disconnectReason: "CLIENT_INITIATED"
you’re seeing in the
room_closed
event payload. This simply means that the disconnection was intentionally triggered by the client. In other words, a participant chose to leave the room by calling the
Room.disconnect()
method. So, it’s not something caused by LiveKit or the server, but a deliberate action from the client side. I hope this helps clear things up! Sources: Sources/LiveKit/Protos/livekit_models.pb.swift | Rooms, participants, and tracks | LiveKit docs | Connecting to LiveKit | LiveKit docs | lib/src/proto/livekit_models.pbenum.dart | livekit-rtc/livekit/rtc/_proto/participant_pb2.pyi
i
So was the call ended by my livekit agent or the user or something else?
t
I'd love to understand your situation better. Could you please let me know if your LiveKit agent is set up to call the
Room.disconnect()
method automatically in some cases? Also, if you have any logs or details about what the users were doing during the call, that might help us see if they disconnected manually. I'm here to help you figure this out!
i
2025-10-29 000038.792 2025-10-28 183038,792 - INFO - shutting down session, Start Processing recording for room - call-_9042464646_ERssj9UZzNPQ 2025-10-29 000038.790 2025-10-28 183038,790 - INFO - Room call-_9042464646_ERssj9UZzNPQ disconnected 2025-10-29 000008.544 2025-10-28 183008,544 - INFO - Participant sip_9042464646 disconnected from room call-_9042464646_ERssj9UZzNPQ 2025-10-29 000008.543 2025-10-28 183008,543 - INFO - Track unsubscribed: 1 from participant sip_9042464646 in room call-_9042464646_ERssj9UZzNPQ 2025-10-29 000006.314 2025-10-28 183006,313 - INFO - Call Recording started for room : call-_9042464646_ERssj9UZzNPQ
t
Thank you for sharing the logs! From what I see, the room was disconnected with the reason
CLIENT_INITIATED
. This usually means that either the user or your LiveKit agent intentionally triggered the disconnection by calling
Room.disconnect()
. Looking at the sequence of events in your logs: • The participant
sip_9042464646
disconnected at
18:30:08,544
. • The room was then fully disconnected at
18:30:38,790
, which matches the agent's log about shutting down the session and processing the recording. It seems like your LiveKit agent initiated the room disconnection after the participant left, probably as part of its designed behavior to tidy up or wrap up the session. If your agent is set up to disconnect the room when all participants leave or under certain conditions (like silence detection), this would explain what happened. If you'd like, I’m here to help you dig deeper into the logs or double-check the agent’s behavior—just let me know! Sources: livekit-android-test/src/test/java/io/livekit/android/room/RoomMockE2ETest.... | Agent Testing & CI/CD | livekit/livekit_composite | DeepWiki | Operational Guidance & Best Practices | livekit/livekit_composite | DeepWik... | Connecting to LiveKit | LiveKit docs | livekit-agents/livekit/agents/voice/room_io/room_io.py