Features
Advanced capabilities available in the Patter TypeScript SDK.Call Recording
Enable call recording via the Twilio Recordings API. Recordings are stored in your Twilio account./webhooks/twilio/recording endpoint to receive recording status callbacks. Recording URLs are logged to the console when they become available.
Answering Machine Detection (AMD)
Detect voicemail systems on outbound calls and optionally leave a message. AMD is available with Twilio only.- Plays the
voicemailMessageas TwiML - Hangs up the call
voicemailMessage is set, the call proceeds normally even when a machine is detected.
DTMF Input
Keypad presses (DTMF tones) during a call are automatically forwarded to the AI agent as text in the format[DTMF: N], where N is the digit pressed (0-9, *, #).
Call Transfer
Thetransfer_call system tool is automatically available to every agent. The AI model invokes it when the caller asks to speak to a human.
Barge-In
Patter supports barge-in — the caller can interrupt the AI agent while it is speaking. The SDK uses mark-based audio tracking to detect when the caller starts speaking during AI playback. When barge-in occurs:- The current TTS audio is immediately stopped
- The caller’s speech is processed normally
- The AI generates a new response
Dynamic Variables
Use{placeholder} syntax in system prompts for per-call customization:
Per-Call Variable Override
Override agent-level variables for individual outbound calls:Variables are sanitized before substitution. Keys like
__proto__, constructor, and prototype are stripped to prevent prototype pollution.Conversation History
Every call maintains a conversation history that accumulates throughout the call. The history is:- Passed to
onMessagecallbacks asdata.history - Included in
onCallEndasdata.transcript - Capped at 200 entries per call (oldest entries are dropped when the limit is reached)
AI Disclosure
An AI disclosure message is automatically played at the start of every call. This is non-optional and ensures compliance with regulations requiring callers to be informed they are speaking with an AI.Outbound Calls
Make outbound calls in local mode:LocalCallOptions
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
to | string | Yes | — | Destination phone number (E.164 format). |
agent | AgentOptions | Yes | — | Agent configuration for the call. |
machineDetection | boolean | No | false | Enable AMD (Twilio only). |
voicemailMessage | string | No | — | Message to leave on voicemail. Requires machineDetection: true. |
variables | Record<string, string> | No | — | Per-call variable overrides merged into agent.variables. |
to parameter must be in E.164 format (e.g., +15559876543). The SDK validates this and throws if the format is invalid.
