Skip to main content

Socket ingest

The socketIngress resource streams raw media or data frames into a room over a WebSocket. socketIngress.create returns a single-use WebSocket URL that stays valid for about 90 seconds. Connect to that URL, push your frames, and close the socket when you are done.

const socket = await client.socketIngress.create(roomId, { participantId: "telephony-leg" });
socket.wsUrl;
socket.expiresIn;

Options: participantId, name, metadata, agent, region.

Full streaming example

Creating the URL is only the first step. For the complete flow (opening the WebSocket, streaming PCM16 audio frames, and receiving room audio), see the Custom WebSocket guide.

The ingress object

Returned by socketIngress.create.

FieldTypeDescription
wsUrlstringSingle-use WebSocket URL (valid about 90s).
roomIdstringRoom being streamed into.
expiresInnumberSeconds until the URL expires (about 90).
refstringSingle-use ref handle parsed from wsUrl.

Got a Question? Ask us on discord


Was this helpful?