Every RPC request, response, audio frame, and event uses the same envelope.

Frame layout

length does not include the four bytes of the length field itself. A zero-arg request (Empty) has length = 4 + sizeof(serde-envelope-header), not zero.

Serde envelope

The body of every frame is a serde envelope:
A receiver that does not recognize a tail of newer fields skips (payload_size - bytes_consumed) bytes and continues. This is how forward compatibility works.

Field encoding

Primitives are little-endian and two’s-complement, with no padding:
Strings are length-prefixed, not null-terminated. Binary payloads (e.g. µ-law audio) are also encoded with the string shape. The bytes are treated as opaque.

Worked example: BargeRequest

Schema:
Serialize call_sid = "abc" with method_id = 3854301714 (Barge):
On the wire (hex, spaces for clarity):
Total bytes written: 18 (4 + length).

Reading a frame

Then parse the serde envelope structurally per the schema for that method_id.