calls.originate({ to, from, trunkId })
returns immediately with a sid. The control plane is request/response, so you
re-fetch with calls.get({ sid }) to watch the call progress. You can also pass
agent. The engine then attaches a server-side voice agent on answer, with 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 sid is the
universal key that addresses the call for status, transfer, hangup, and audio.
- TypeScript
- Python
trunkId names a SIP trunk that you already provisioned. Create one in the
console or via the admin API before you call originate. See
SIP trunking.Attach an AI agent on answer
Passagent. The engine then connects 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
This example stops the attempt after 15 seconds instead of the default 30 seconds. The server clamps this value 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
instead of passing agent, close the bridge first so that both tracks close
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.

