calls.originate({ to, from, trunkId })
returns immediately with a sid, and the control plane is request/response, so
you re-fetch with calls.get({ sid }) to watch the call progress. Optionally
pass agent and the engine attaches a server-side voice agent on answer — no
audio bridge in your process.
Client
Every snippet below assumes a configuredVoice client.
- TypeScript
- Python
Place the call
Originate over a SIP trunk and read the returnedsid — the universal key you
use to address the call for status, transfer, hangup, and audio.
- TypeScript
- Python
trunkId names a SIP trunk you have already provisioned. Create one in the
console or via the admin API before calling originate — see
SIP trunking.Attach an AI agent on answer
Passagent and the engine wires the audio bridge automatically when the callee
answers — the server-side agent drives both legs of the conversation, so you do
not open an AudioBridge yourself.
- TypeScript
- Python
Cap the ring time
Give up after 15 seconds instead of the default 30. The server clamps this to5..120.
- TypeScript
- Python
Poll the call’s status
The control plane is request/response — re-fetch to read the latest status. Status is one ofdialing, ringing, in_progress, completed, failed, or
no_answer.
- TypeScript
- Python
Wait for the call to connect
Poll until the call leaves the ringing states, then act on the outcome.- TypeScript
- Python
Hang up
End the call when you are done. If you attached anAudioBridge yourself (rather
than passing agent), close it first so both tracks tear down cleanly.
- TypeScript
- Python
Related
Bring your own ASR
Skip the agent and bridge caller audio into your own recognizer.
Transfer to a human
Hand a live call off to a person or a different agent.
Outbound & dialer
Paced campaigns, concurrency caps, and the originate app modes.
Calls API
Full request/response shape for originate, get, transfer, and hangup.