Carrier mode requires Telnyx bidirectional RTP with PCMU configured by the host.
Parse a raw WebSocket frame from a Telnyx media stream.
The carrier profile (parseCarrierMedia) reads start with the nested
start.call_control_id and start.media_format, which must declare PCMU at
8 kHz mono; media with its base64 media.payload, inbound track only;
dtmf, mark and stop. An unsupported start format, an error event or
an oversized frame throws.
The legacy profile keeps the released mapping: stream_id to streamSid, a
top-level call_control_id to callSid and the audio in media.chunk, with
start, media and stop alone.
Raw WebSocket frame payload (JSON string or Buffer from Telnyx).
Normalised MediaStreamIncoming event, or null for
outbound audio tracks, unknown event types, or malformed messages.
Readonly protocolSelected once; omission preserves the old binary-output protocol.
Telnyx media parser with an explicit documented carrier profile and a retained legacy profile. Carrier mode requires PCMU 8 kHz mono and preserves carrier timestamps and chunk counters. Legacy mode exists for existing callers and fixtures; it is not a live-carrier conformance claim.