# Method IDs

> The full set of RPC methods and their u32 method_id constants.

Every frame on the wire carries a 4-byte little-endian `method_id`. The
IDL compiler writes the constants below into every SDK at build time.
These constants are the source of truth.

## Method table

| Method                  | `method_id` (decimal) | `method_id` (hex) | Request DTO                  | Response DTO                  |
| ----------------------- | --------------------: | ----------------- | ---------------------------- | ----------------------------- |
| `Originate`             | `1430677891`          | `0x554d_8a83`     | `OriginateRequest`           | `OriginateResponse`           |
| `OriginateBulk`         | `721069100`           | `0x2af9_a52c`     | `BulkRequest`                | `BulkResponse`                |
| `AbortBulk`             | `3861915064`          | `0xe629_4af8`     | `AbortBulkRequest`           | `BulkResponse`                |
| `Terminate`             | `3834253405`          | `0xe486_24dd`     | `TerminateRequest`           | `TerminateResponse`           |
| `StreamEvents`          | `959835745`           | `0x3935_e0e1`     | `EventStreamRequest`         | `CallEvent` (server-streamed) |
| `SetInboundRouting`     | `1933986897`          | `0x7345_15d1`     | `SetInboundRoutingRequest`   | `Empty`                       |
| `GetIncomingCalls`      | `1161946746`          | `0x4540_dffa`     | `GetIncomingCallsRequest`    | `GetIncomingCallsResponse`    |
| `AnswerIncomingCall`    | `2990157256`          | `0xb234_0e08`     | `AnswerIncomingCallRequest`  | `AnswerIncomingCallResponse`  |
| `GetActiveBuckets`      | `2624504207`          | `0x9c70_734f`     | `Empty`                      | `ListBucketsResponse`         |
| `GetBucketCalls`        | `1217351135`          | `0x489c_d49f`     | `BucketRequest`              | `BucketCallList`              |
| `ExecuteBucketAction`   | `4030863293`          | `0xf04f_36fd`     | `BucketActionRequest`        | `BucketActionResponse`        |
| `ExecuteDialplan`       | `3514036100`          | `0xd166_7944`     | `ExecuteDialplanRequest`     | `ExecuteDialplanResponse`     |
| `Barge`                 | `3854301714`          | `0xe5b0_6412`     | `BargeRequest`               | `Empty`                       |
| `AudioFrame`            | `2991054320`          | `0xb241_b9b0`     | `AudioFrame` (uni-stream)    | `AudioFrame` (uni-stream)     |
| `ReloadCertificates`    | `3357922138`          | `0xc827_06da`     | `Empty` (admin)              | `Empty`                       |

`method_id` is a CRC32-based hash of `service_name`, method name, and the
fully-qualified DTO names. It is stable across versions if none of those
three change. **Do not fork the table.** If you change anything,
regenerate the table from the IDL.

## How to use

1. Pick the method.
2. Encode its request DTO as a serde envelope.
3. Prepend the [envelope header](/rpc/envelope-format).
4. Write the frame onto a fresh QUIC bidirectional stream.

For single-shot RPCs, the gateway responds on the same stream. For
streaming methods like `StreamEvents` and `AudioFrame`, it responds on a
server-initiated unidirectional stream.

## Method semantics

  **Originate**

Place a single outbound call. The gateway assigns a `call_sid` if the
    request omits one. Later state changes arrive as `CallEvent`s on the
    event stream that you subscribed to via `StreamEvents`.

  **OriginateBulk / AbortBulk**

The bulk dialer. It reads phone numbers from `csv_url`. It paces at
    `calls_per_second` and caps at `max_concurrent_calls`. `AbortBulk`
    cancels a campaign by `campaign_id`.

  **Terminate**

Hang up an active call by `call_sid`.

  **StreamEvents**

Subscribe to call lifecycle events. The `client_id` should be a stable
    UUID per process. The gateway uses it to demux uni-streams across many
    parallel SDK instances.

  **SetInboundRouting**

Tell the gateway what to do with PSTN-originated calls that hit
    `trunk_id`. The options are: reject, play and hangup, fire a webhook,
    or hand off to the AI bridge.

  **GetIncomingCalls / AnswerIncomingCall**

Poll incoming calls (per trunk). Answer one explicitly. Use these RPCs
    when the SDK acts as a click-to-answer agent instead of letting
    `SetInboundRouting` auto-handle the call.

  **GetActiveBuckets / GetBucketCalls / ExecuteBucketAction**

Operational cleanup tooling. A "bucket" is a server-side set of calls
    that share an attribute that the gateway tracks for triage. Typical
    buckets are parked-too-long, abandoned, or orphaned (no SDK heartbeat).
    Use these RPCs to list stuck calls and act on them in bulk. The
    intended `action` is `0=hangup` to clear them during ops incidents.
    These RPCs are **not** a transfer or conferencing primitive. The
    platform supports neither capability.

  **ExecuteDialplan**

Override the in-flight dialplan for a `call_sid`: hang up, park,
    music-on-hold, playback, unpark+bridge, answer, or open the AI
    bidirectional stream.

  **Barge**

The platform's **AI-network unblocker**. While the AI talks, the
    gateway watches the inbound leg for the human caller's voice
    (energy / VAD / semantic detection, per trunk via `auto_bargein_mode`).
    When the human starts to speak, the gateway gates the AI's outbound
    audio within `barge_in_patience_ms`. The human is then heard
    immediately. This RPC is the explicit handle to trigger or arm
    barge-in for a `call_sid`. The per-call knobs `auto_barge_in` and
    `barge_in_patience_ms` on `OriginateRequest` arm it automatically.
    It is **not** the supervisor-injection feature found in legacy PBXs.

  **AudioFrame**

Bidirectional audio. You write outbound frames on a client → server
    uni-stream. Inbound frames arrive on a server → client uni-stream.
    See [Audio Frames](/rpc/audio-frames).
