SDP Signaling
Connect
Send an SDP offer and receive an answer:403.
The answer carries the call id alongside the SDP:
sdp and type is unaffected.
An offer that names the pc_id of a connection that is still open — a client
restarting ICE, or renegotiating its tracks — is that same call: it is
answered under the same call_id, and runs no call-init and creates no new
call. A pc_id from another project’s call is a 404.
If the agent cannot start (a provider with no key, say), there is no answer to give: the response is 500 with code pipeline_start_failed, the reason, and details.missing_keys when keys are missing. The call is recorded as failed.
error.raised event says why; see When a call fails.
ICE Trickle
POST that opened the
connection (admin or developer), for the project whose call it is. Without a
key it is a 401; a pc_id no call of that project holds is a 404, whether
it exists or not. pipecat’s browser transport sends the headers it was given
for the POST on every PATCH too, so a client that set Authorization
there needs nothing more.
Behind NAT: a TURN relay
TurnCall’s side of the call gathers its candidates with public STUN by default, which works when the server has a public address. Behind NAT — a Kubernetes pod, or a Cloudflare Container, which takes no inbound UDP at all — the browser can connect and still hear nothing. Give it a TURN relay withWEBRTC_ICE_SERVERS, as JSON in the browser’s RTCIceServer shape:
The greeting
The agent’sfirst_message is spoken once the browser’s peer connection is
up, not when the pipeline starts: audio written before the connection is
dropped, so a greeting that beat ICE and DTLS used to play to nobody.
Dynamic Routing
Passserver_url in requestData for pre-call initialization:
TURNCALL_ENV other than development, staging included)
server_url must be https://, or a Kubernetes Service in the same cluster
(http://<name>.<namespace>.svc.cluster.local/...), whose traffic never leaves
it; any other http:// URL is refused with a 400. ALLOW_PLAIN_HTTP_URLS
overrides the default: true allows plain http everywhere, false refuses it
in development too.
Template Variables
variables in requestData fill the agent’s {{placeholders}} (system
prompt, first message, tool descriptions) for this call:
400. With server_url, call-init receives
them as call.variables, and on a clash with call-init’s own variables the
request’s value wins.
Browser Client
See theexamples/webrtc-client directory for a complete browser client using Pipecat JS SDK + WebRTC.