AgentStream
AgentStream: WSS errors and handling
4 min
short guide for agentstream applets — stream (unidirectional) and voicebot (bidirectional) — when you host a wss\ // endpoint exotel opens the websocket to your server ; json events and post call outcomes follow the main agentstream docs two places errors show up layer what it is where websocket close code standard (rfc 6455) when the socket ends logs from your websocket server (the side that accepts exotel’s connection), proxies, load balancers streaming outcome success/failure + optional detail text passthru and other callbacks — often nested as stream (same idea may appear on status callback depending on your setup) they are not the same signal correlate with callsid and time common websocket close codes code meaning 1000 normal close 1001 endpoint going away (restart, navigate, etc ) 1002–1003 protocol / data type problem 1006 abnormal — often no proper close frame (network drop, tls, timeout, lb idle timeout, crash) very common; check path and timeouts first 1007–1009 payload / policy / size 1011 server error while handling the connection 1012–1013 restart / try again (depends on stack) 1005 and 1015 are reserved or synthetic in many apis — you may still see them in logs other products may use iana registered application codes (e g 3xxx) or private use 4000–4999 on your infra — not the same as text in stream error if the socket drops often validate wss\ // , cert, firewall / ip allowlist , proxy idle timeouts , and server cold start for support callsid , utc time , close code + reason , server log snippet (redact secrets) stream error in callbacks when streaming fails, stream error may contain a short diagnostic string treat it as opaque — copy the full value for exotel support; you don’t need to parse it interpret together with stream status , disconnectedby , disposition if status and error seem inconsistent, trust the error detail and escalate with both typical focus areas situation check won’t connect url, dns, tls, firewall, allowlist times out during setup cold start, cpu, proxy timeouts dies on first events after connect upgrade path, auth, edge limits mid call load, backpressure, your app latency voicebot only bidirectional behaviour per agentstream docs passthru stream fields (when voicebot or stream ran before passthru) present when the event store has them — field names streamsid, streamurl, status, duration, recordingurl, error, disposition, disconnectedby, detailedstatus leg1ringingduration may sit next to stream, not inside it after connect , you may also get legs , dialcallstatus , dialwhomnumber , etc some parameters are tenant specific — if something is missing, check your account docs or support encoding (query vs json) follows your voice / app integration doc quick checklist make passthru handlers idempotent (retries, dedupe on callsid) log callsid , streamsid , close code , full stream error return 200 quickly; don’t log credentials in urls see agentstream applets and the unidirectional / bidirectional pages on exotel docs for event shapes
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.
