Skip to main content

Carrier

The carrier delivers the phone call to Patter. Patter supports Twilio and Telnyx. Both share DTMF, call transfer, AMD, status callbacks, and cost tracking; recording is Twilio-only. You configure one carrier per Patter instance by passing an instance to the carrier field. Each carrier class falls back to environment variables when constructor arguments are omitted. Both carriers are imported by name from the package barrel: import { Twilio, Telnyx } from "getpatter".

Twilio

On serve(), Patter automatically sets the voice_url on the Twilio number to https://<webhookUrl>/webhooks/twilio/voice via the Twilio REST API — no manual Console configuration needed.

How caller / callee reach the agent

Inbound Twilio calls deliver the caller and callee numbers via TwiML <Parameter name="caller" value="..."/> / <Parameter name="callee" value="..."/> children of <Stream> — Twilio surfaces these on the WS start frame as start.customParameters. Patter’s /webhooks/twilio/voice route emits this TwiML automatically. If you construct the TwiML yourself, build it with TwilioAdapter.generateStreamTwiml(streamUrl, { caller, callee }) so the values land on the WS start frame. Query-string parameters on the <Stream url=...> are stripped by Twilio before the WS handshake and will not work.

Signature verification

The Auth Token is also used to verify every Twilio webhook with HMAC-SHA1 against the X-Twilio-Signature header. Requests with invalid signatures are rejected with HTTP 403.

Telnyx

How caller / callee reach the agent

The Telnyx WS upgrade URL carries the metadata as query-string parameters: wss://<webhookUrl>/ws/stream/<callControlId>?caller=<from>&callee=<to>. Telnyx preserves the query string through the WebSocket handshake, so no equivalent of TwiML <Parameter> is needed.

Signature verification

When publicKey is set (or TELNYX_PUBLIC_KEY is present), every Telnyx webhook is verified with Ed25519. Requests older than 5 minutes are rejected (replay protection).

Webhook Endpoints

The embedded server exposes these endpoints regardless of carrier choice:

What’s Next

STT

Speech-to-text providers.

LLM

Language model providers.

TTS

Text-to-speech providers.

Tunneling

Expose your local server publicly.