# `Chatto.Api.V1.VoiceCallService`
[🔗](https://github.com/xtian/elixir-chatto/blob/v0.1.0/lib/chatto/generated/chatto_api_v1_voice_call_service.ex#L3)

Room-scoped voice and video calls.

# `batch_get_active_calls`

```elixir
@spec batch_get_active_calls(
  Req.Request.t(),
  Chatto.Api.V1.BatchGetActiveCallsRequest.t()
) ::
  {:ok, Chatto.Api.V1.BatchGetActiveCallsResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Gets current active call snapshots for many rooms.

Rooms that do not exist, are inaccessible, or currently have no active call
are omitted. Results preserve first-seen request order and repeated room
IDs are de-duplicated. Returns an empty list when LiveKit is not configured.

# `create_call_media_publisher_token`

```elixir
@spec create_call_media_publisher_token(
  Req.Request.t(),
  Chatto.Api.V1.CreateCallMediaPublisherTokenRequest.t()
) ::
  {:ok, Chatto.Api.V1.CreateCallMediaPublisherTokenResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Issues a short-lived LiveKit token for a native companion publisher owned
by the caller. Companion publishers contribute media to the caller's
logical participant without becoming call participants themselves.

Requires room membership, call.join, call.screenshare, and participation
in the active call. Captured application audio does not need call.voice.
The credential expires after one minute; an established publisher is
checked by the same permission reconciliation as the main participant.
Returns
FAILED_PRECONDITION when no call is active, the caller has not joined it,
or voice and video calls are not configured.

# `create_call_token`

```elixir
@spec create_call_token(Req.Request.t(), Chatto.Api.V1.CreateCallTokenRequest.t()) ::
  {:ok, Chatto.Api.V1.CreateCallTokenResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Issues a LiveKit token for joining the room's active call.

Requires room membership and call.join. A call must already be active.
On a server with a participant limit, this request also reserves a place
in the call. It returns RESOURCE_EXHAUSTED if the call needs a new place
and the server is full.
The token permits microphone, camera, and screen-share sources only when
call.voice, call.camera, and call.screenshare respectively allow them.
A caller without publishing permissions can listen and watch.
Tokens expire after five minutes. Expiry does not end an established call.
Chatto checks connected participant permissions on its 30-second LiveKit
reconciliation cycle. Failed checks retry on subsequent cycles.
Returns NOT_FOUND when the room does not exist, PERMISSION_DENIED when the
caller is not a room member, and FAILED_PRECONDITION when no call is active
or voice and video calls are not configured.

# `get_active_call`

```elixir
@spec get_active_call(Req.Request.t(), Chatto.Api.V1.GetActiveCallRequest.t()) ::
  {:ok, Chatto.Api.V1.GetActiveCallResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Gets the current active call snapshot for one room.

The caller must be a member of the room. Returns NOT_FOUND when the room
does not exist, currently has no active call, or voice calls are not
configured. The returned call_id lets clients ignore stale realtime call
events from previous calls in the same room.

# `join_call`

```elixir
@spec join_call(Req.Request.t(), Chatto.Api.V1.JoinCallRequest.t()) ::
  {:ok, Chatto.Api.V1.JoinCallResponse.t()} | {:error, Chatto.Connect.Error.t()}
```

Records the caller's intent to join a room call.

Requires room membership and call.join. If no call is active, also
requires call.start. Publishing permissions do not grant admission.

Returns RESOURCE_EXHAUSTED if a new participant would exceed the server limit.
Returns joined=false when LiveKit is not configured.

# `leave_call`

```elixir
@spec leave_call(Req.Request.t(), Chatto.Api.V1.LeaveCallRequest.t()) ::
  {:ok, Chatto.Api.V1.LeaveCallResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Records the caller's intent to leave a room call.

Requires room membership, but not call.join or a publishing permission.

Returns left=false when LiveKit is not configured.

# `list_active_calls`

```elixir
@spec list_active_calls(Req.Request.t(), Chatto.Api.V1.ListActiveCallsRequest.t()) ::
  {:ok, Chatto.Api.V1.ListActiveCallsResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Lists member rooms that currently have active calls as a finite
runtime snapshot. Rooms the caller is not a member of are omitted.

Returns an empty list when LiveKit is not configured.

# `list_call_participants`

```elixir
@spec list_call_participants(
  Req.Request.t(),
  Chatto.Api.V1.ListCallParticipantsRequest.t()
) ::
  {:ok, Chatto.Api.V1.ListCallParticipantsResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Lists participants currently observed in a room's active call as a finite
runtime snapshot.

The caller must be a member of the room.
Returns NOT_FOUND when the room does not exist and PERMISSION_DENIED when
the caller is not a room member.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
