what does CLIENT_INITIATED mean for a participant ...
# ask-ai
i
what does CLIENT_INITIATED mean for a participant disconnection
t
Thanks for reaching out, Ed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You’re asking what "CLIENT_INITIATED" means for a participant disconnection — here’s the short answer. "CLIENT_INITIATED" means the client (the participant’s app or user) intentionally ended the session — for example, the user clicked “leave,” closed the app/tab, or the app called a disconnect API. It indicates the disconnection was started by the participant’s side rather than the server or a network/server error. Note: LiveKit’s documented disconnection reasons list other server-side or system-triggered reasons (like
DUPLICATE_IDENTITY
,
ROOM_DELETED
,
PARTICIPANT_REMOVED
, etc.). If you’re seeing
CLIENT_INITIATED
in logs and want help confirming the exact client action that caused it, tell me which SDK (web, iOS, Android, or server) and any relevant log snippets or timestamps and I’ll help trace it. Sources: Connecting to LiveKit | LiveKit docs
i
im seeng an instance where a participant disconnceted (they were the caller since they made an inbound call to our agent) and the reason is CLIENT_INITIATED but Twilio is saying the callee hung up
t
Thanks — I understand you're seeing a participant disconnected with reason CLIENT_INITIATED while Twilio reports the callee hung up. That’s confusing; let’s narrow it down. Quick clarification: CLIENT_INITIATED indicates the participant’s client triggered the disconnect (user clicked leave, app closed, or the app called disconnect). Twilio reporting the callee hung up can align with this if the callee’s client initiated the hangup. They can both be true if the same endpoint initiated the termination. To investigate this specific instance, please provide: • Which SDK/platform the participant used (Web, iOS, Android, or server). • Exact timestamps (UTC) of the disconnection event. • The LiveKit participant identity or room name for the session. • Any LiveKit or client-side logs around the disconnect (client disconnect call, websocket close, error codes). • The Twilio call SID and Twilio timestamps or webhook events showing the callee hangup. With those I can help correlate events and pinpoint whether the client or Twilio-side action caused the disconnect and suggest next steps.
Thanks — I’ve reviewed the session details you provided (RM_mj7msQGx9Q3J, room call-_+14167103439_Tf8LfP6HtVKL, Nov 25 2025 31411 PM ET, Python SDK). Short answer: those two signals are consistent. LiveKit’s
CLIENT_INITIATED
means the participant’s client explicitly requested to leave (e.g., your Python client called disconnect, user hit hang‑up, or the SIP endpoint sent BYE). Twilio reporting the callee “hung up” is the same event from Twilio’s side — a SIP BYE from the callee results in LiveKit interpreting the close reason as
CLIENT_INITIATED
. What I can help confirm next: • Check your Python app logs around the timestamp for any
Room.disconnect()
(or equivalent) calls. • Check LiveKit webhook
ParticipantLeft
events at that time. • Check Twilio call SID events / debug logs for the SIP BYE that matches the timestamp. Tell me which of those logs you want me to help correlate (paste relevant snippets/timestamps or the Twilio call SID) and I’ll walk through the exact event correlation. Would you like me to start with the Python client logs or the Twilio call events? Sources: Server Core & Participant Management | livekit/livekit_composite | DeepWiki | Connecting to LiveKit | LiveKit docs | Inbound calls with Twilio Voice | LiveKit docs | Webhooks | LiveKit docs
i
The callee is the agent in this case, since it was an inbound call. How can both the user (the caller) hang up and twilio show it as a callee hangup?
t
Thanks — I see why this feels contradictory. Here are the likely explanations and the next checks to correlate events. Possible reasons both sides can report different hung‑up roles • Signaling role vs. SIP role: LiveKit’s
CLIENT_INITIATED
means the LiveKit participant (the client connected to LiveKit) sent a leave. Twilio labels the SIP/PSTN side that sent the BYE as the “callee” in its call leg view — roles can differ between your app (caller/callee) and the SIP leg topology. • Proxying or bridging behavior: If Twilio was bridging the inbound PSTN call to your agent, Twilio may show the agent leg ending (callee hangup) even if the LiveKit participant that initiated the LiveKit disconnect was the caller. A BYE on the Twilio agent leg will appear as a callee hangup. • App flow: Your application or agent UI might have executed a disconnect (calling Room.disconnect()) in response to a Twilio event (or vice versa), so both systems log their own viewpoint: LiveKit logs the client-initiated leave while Twilio logs the agent leg hangup. • Timing and race conditions: The disconnect could be initiated by one side but reflected in logs on the other side slightly later; different systems may attribute the action to the party on their call leg. Quick checks to confirm the root cause 1. Get the Twilio Call SID and examine Twilio webhook/events around the timestamp for a SIP BYE and which call leg (from/to) sent it. 2. Check your Python client logs around Nov 25 2025 31411 PM ET for any explicit
Room.disconnect()
or handler that triggers disconnect on agent hangup. 3. Inspect LiveKit webhooks (
ParticipantLeft
) and any server-side logic that reacts to Twilio webhooks — look for code that issues a LiveKit disconnect when Twilio reports a hangup. 4. Compare timestamps (UTC) of: ◦ Twilio BYE event ◦ LiveKit
ParticipantLeft
webhook ◦ Your Python client disconnect call/log entry If you want, paste the Twilio Call SID and the exact log lines (or timestamps) for the Twilio BYE, the LiveKit
ParticipantLeft
, and your Python client disconnect; I’ll correlate them and point to which side initiated the termination from each system’s perspective. Which log set would you like me to check first?