Overview
Agent Stream is a WebSocket endpoint that lets a telephony provider point its media stream at a single URL and drive a EESI agent run. The agent UUID in the URL selects the agent, and the provider path segment selects the streaming protocol. Provider-specific identifiers come from the stream protocol itself. For Cloudonix, EESI reads the domain from thestart.accountSid field, then uses the matching stored telephony configuration to validate the session and issue provider API calls (hangup, transfer) during the call.
This is useful when:
- You’re integrating EESI into a SIP gateway or in-house dialer that already speaks a supported provider’s streaming protocol
- You want one stable endpoint per agent rather than wiring up an inbound webhook per phone number
Endpoint
{provider} is the registered provider name, currently cloudonix. {agent_uuid} is the agent’s stable UUID (see Get the Agent UUID below). On self-hosted deployments, replace api.eesi.ai with your backend host.
Prerequisites
- A EESI agent (workflow) — published or in draft is fine
- A Cloudonix telephony configuration in your EESI organization whose
domain_idmatches theaccountSidCloudonix sends in the streamstartmessage. EESI uses the bearer token from this configuration to validate the call session and to issue provider API calls (hangup, transfer).
Get the Agent UUID
The Agent UUID is the workflow’s stable identifier — it doesn’t change when versions are published. To find and copy it in the UI, see Agent UUID.Connect to the WebSocket
Path parameters
Cloudonix example
<Stream> your Cloudonix Voice Application returns when the call needs to be bridged to the EESI agent:
connected and start events (Twilio-compatible framing). EESI extracts streamSid, callSid, session, accountSid, from, to, context, tracks, and mediaFormat from the start event payload. It validates the session against Cloudonix using the bearer token from the stored telephony configuration matched by accountSid, then begins streaming audio.
Workflow run lifecycle
When the WebSocket is accepted, EESI:- Looks up the workflow by
agent_uuid - Runs a quota check against the workflow’s owning user
- Creates a new
WorkflowRun(call_type=inbound,mode=cloudonix, nameWR-AGS-XXXXXXXX) - Transitions the run to
running - Reads and validates the Cloudonix
startmessage, then stamps thefrom/tonumbers oninitial_context, storessessionascall_idongathered_context, and recordsaccountSidunder the run’sinbound_webhooklog - Starts the agent pipeline
Close codes
Security notes
- Treat the URL as a secret — the agent UUID itself authorizes the connection. Store and transmit it only over TLS, and avoid logging the raw URL in places where access is broader than your operations team.
- No bearer tokens or provider secrets are passed in the URL. Provider credentials live in the stored telephony configuration (matched by
start.accountSidfor Cloudonix) and are used server-side by EESI to validate the session and issue provider API calls.