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

# handleCall()

> **handleCall**(`opts`): `Promise`\<[`HandleCallResult`](/docs/agent-sdk/internals/socket/handleCall#handlecallresult)>

Dispatch one RPC with NO connection — the transportless counterpart of a
socket `call` frame, for front-door encoders (e.g. the HTTP handler in
the `agent-http` subpath) whose requests each carry exactly one call.

The call passes every connection gate, in bootstrap order: `onConnect`
(when configured; a rejection answers as the close it chose), `authorize`
(when configured; a rejected credential answers the connection-level
`unauthorized` error frame), `onAttach` (when configured; a veto answers
as its close), then the `"rpc"` claim gate (a call-correlated
`unauthorized`) and the same method dispatch as a socket call — the same
codes for reserved / private / unknown methods, faults, and
unserializable results. Unlike a connection it never reads snapshot
sources, is never admitted as a watcher, and receives no broadcasts.

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| `opts` | [`HandleCallOptions`](/docs/agent-sdk/internals/socket/handleCall#handlecalloptions) | The call, its correlation id, and the caller's credential and request. |

**Returns**

`Promise`\<[`HandleCallResult`](/docs/agent-sdk/internals/socket/handleCall#handlecallresult)>

The answer frame, or the gate close that refused the call —
never a rejection.

## HandleCallOptions

One transportless RPC for [`handleCall`](/docs/agent-sdk/internals/socket/handleCall).

**Properties**

**args?**

> `optional` **args?**: readonly `unknown`\[]

Positional arguments, like a socket `call` frame's `args`.

***

**id**

> **id**: `string`

Correlation id stamped on the answer frame.

***

**method**

> **method**: `string`

The public method name to dispatch (same rules as a socket `call` frame).

***

**req?**

> `optional` **req?**: `Request`

The caller's request; the connection gates and `authorize` receive it.

***

**token?**

> `optional` **token?**: `string`

The caller's credential, resolved through `authorize` when configured.

## HandleCallResult

> **HandleCallResult** = \{ `frame`: `AnyKnownFrame`; } | \{ `closed`: \{ `code`: `number`; `reason`: `string`; }; }

The answer to a transportless call ([AgentSocketServer.handleCall](/docs/agent-sdk/internals/socket/handleCall)):
either `frame` — the same `result` / `error` frame a socket caller would
receive for this call — or `closed`, the close code/reason an application
gate (`onConnect` rejection, `onAttach` veto) refused the call with
instead of a frame, exactly as it would have closed a socket.
