> ## Documentation Index
> Fetch the complete documentation index at: https://anam.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Session Termination Reasons

> Understand why a session ended: the exit status and termination reason shown on the sessions page, grouped by integration

An exit status tells you the broad category of how a session ended. You can
see it in Anam Lab and in the response from
[`GET /v1/sessions/{id}`](/docs/api-reference/sessions/get-session).

A termination reason gives you the specific cause. Anam Lab shows it as a
chip on the [sessions page](https://lab.anam.ai/sessions) only for the reasons
listed below. When a reason is not listed, the session shows its exit status
alone.

## LiveKit

| Reason                                                | Exit status                | What it means                                                                                                                                                                                                                                                                                                                                                                         |
| ----------------------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Room closed** (`ROOM_CLOSED`)                       | OK                         | The avatar left because the LiveKit room ended normally: the room was deleted or closed, the avatar participant was removed, or the disconnect was client initiated. This is the expected end when you delete the room or remove the avatar. If the room should still have been running, check what deleted it or removed the avatar participant.                                     |
| **Room emptied** (`TIMEOUT_EMPTY_ROOM`)               | Timed out                  | Every regular participant left the LiveKit room and none rejoined within the departure timeout (10 seconds by default), so the avatar left too. Agent and egress participants do not count as occupants. This is the normal end when participants hang up. To allow longer reconnects, set a longer departure\_timeout on the room; the avatar uses the room's value when one is set. |
| **Nobody joined** (`TIMEOUT_INITIAL_JOIN`)            | Never joined               | No regular participant joined the LiveKit room within 30 seconds of the session starting, so the session ended. Agent and egress participants do not count as occupants. Start the Anam session when a participant is about to join, or have the participant join first. A shorter empty\_timeout on the room lowers this limit; it cannot raise it.                                  |
| **Duplicate identity** (`livekit_duplicate_identity`) | Client configuration error | LiveKit removed the avatar because another participant joined the room with the avatar's identity. This usually means the session was started twice for the same room, or a participant identity or token was reused. Start one Anam session per room and give every participant a unique identity.                                                                                   |
| **Room not found** (`livekit_room_not_found`)         | Client configuration error | The avatar could not join because the LiveKit room named in its token does not exist: it was never created, was already closed, or the token's room grant names a different room. Create the room (or let the first participant create it) before starting the Anam session, and check that the room name in the session request matches.                                             |

## Daily

| Reason                          | Exit status | What it means                                                                                                                                                                                                                                                                                                |
| ------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Room closed** (`ROOM_CLOSED`) | OK          | The last remote participant left the Daily room, so the avatar left too. Daily reports a deliberate leave and a dropped connection the same way, so this also covers a participant whose connection dropped. If sessions end while participants are still present, check that everyone joined the same room. |

## Agora

| Reason                      | Exit status | What it means                                                                                                                                                                                                                                                                                               |
| --------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **User left** (`USER_LEFT`) | OK          | The Agora session was closed without a more specific reason: the client ended it, or Anam tore the session down without a recorded cause. This is the normal end for an Agora session. If it happens sooner than expected, check whether your integration stops the session or the user leaves the channel. |

## Turnkey

| Reason                                                                    | Exit status  | What it means                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **User left** (`USER_LEFT`)                                               | OK           | The client ended the session or its connection to Anam closed: the SDK stopped streaming, the page was closed, or the signalling WebSocket dropped and was not recovered. This is the normal end for a Turnkey session, and also the fallback recorded when the engine has no more specific reason. If it happens sooner than expected, check whether your integration stops the client or the user navigates away.                                                                      |
| **Stopped via API** (`api_requested_stop`)                                | OK           | The session was force-terminated by a call to the stop-session endpoint (POST /v1/sessions/:id/stop). This is the expected end when your backend stops a session deliberately. If you did not expect it, check which of your services calls the stop endpoint.                                                                                                                                                                                                                           |
| **Client never connected** (`user_never_connected_to_websocket`)          | Never joined | The client never opened its signalling WebSocket within a minute of the session being created. This usually means the session token was created but the SDK never started streaming, or the client could not reach Anam. Check that your client starts streaming after obtaining the session token, and that the network allows WebSocket connections.                                                                                                                                   |
| **WebRTC connection failed** (`user_never_established_webrtc_connection`) | Never joined | The client opened its signalling WebSocket, but the WebRTC media connection was not established within a minute. Anam already falls back to a TURN relay over TLS on port 443, so a blocked UDP path alone is rarely the cause. This usually means the network also blocks outbound TLS to the TURN relay, or a browser policy or extension disables WebRTC. Check that the network allows WebRTC and outbound TLS on port 443, and test with the SDK's iceTransportPolicy set to relay. |

## All integrations

| Reason                                                   | Exit status          | What it means                                                                                                                                                                                                                                                                                                                |
| -------------------------------------------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **User asked to end** (`USER_REQUESTED_END`)             | OK                   | The persona ended the conversation with the end\_call system tool after the user confirmed they wanted to finish. This is the expected end for personas that have the end\_call tool attached. Remove the tool from the persona if you do not want the persona to end conversations.                                         |
| **Anam duration limit** (`session_max_duration_reached`) | Max duration reached | The session reached Anam's platform-wide maximum session length, currently two hours, and was ended. This limit applies to every session regardless of persona settings. Start a new session to continue.                                                                                                                    |
| **User inactive** (`user_inactivity_timeout`)            | Timed out            | The user stayed silent past the persona's silenceBeforeSessionEndSeconds window (60 seconds by default), so the persona ended the session. A spoken warning precedes the end when the window is at least 10 seconds. Raise the window in the persona's voice detection options, or set it to 0 to disable the automatic end. |

## Related

<CardGroup cols={3}>
  <Card title="LiveKit configuration" icon="video" href="/docs/integrations/livekit/configuration">
    Configure LiveKit rooms, credentials, and avatar sessions.
  </Card>

  <Card title="Session performance" icon="gauge-high" href="/docs/resources/session-performance">
    Understand the latency indicators shown for your sessions.
  </Card>

  <Card title="Get a session" icon="brackets-curly" href="/docs/api-reference/sessions/get-session">
    Retrieve a session's exit status and other details through the API.
  </Card>
</CardGroup>
