Before you begin
You need:- A number in your workspace, on a trunk that can send calls out. See Link a Twilio number or Connect a SIP trunk.
- An Autopilot agent or a stream, and its ref.
- An API key. In the dashboard, go to API keys and create one.
Place a call
Pass three things:
You can also pass:
- SDK
- CLI
This script calls a customer and connects them to the agent Front desk. It prints each
status as the call progresses:Run it with your key:When the person answers, it prints:
call.js
createCall in the Node SDK reference and
sipnet:calls:create in the CLI reference.
Follow the call
The SDK’sstatusStream and the CLI report the dial status:
Your application only gets the call once the person answers. On a busy line or no answer, it never
hears about the call. To follow calls without keeping a stream open, use
webhooks:
call.startedwhen the person answers and the call reaches your application.call.endedwhen it ends, with how long it lasted and why it ended.call.failedwhen it never reached your application, with areasonsuch asbusyorno_answer.
createCall returns. When the call ends, its
call record has the transcript and, if recording is on, the recording.
Use the metadata
A stream reads themetadata object from session.metadata when the call is answered. Use it to
tell your code who it called and why. See
Build a stream with the Voice SDK.
Autopilot agents don’t read
metadata on live calls yet. The agent’s system prompt and first
message are the same for every call.Detect voicemail
If you call people who might not pick up, turn on answering-machine detection on the application. Your stream then learns whether a person or a voicemail answered, and can leave a message or hang up. See Detect answering machines.Call many people
createCall places one call. To call a list of numbers, call it once per number from your own
code, and spread the calls out so your carrier doesn’t throttle you.
From an AI client such as Claude or Cursor, the Fonoster MCP server has a create_call_batch
tool. It takes one from, a list of numbers in to_array, the app_ref, an optional timeout
and metadata, and calls_per_minute (1 to 60, default 20). It places the calls in the
background at that rate and returns right away. See
Use Fonoster from an AI client.
The MCP server places batch calls while it runs. If the AI client’s MCP server stops, the calls
not placed yet are dropped.
Troubleshooting
If the call fails right after
TRYING, check that the number’s trunk has an outbound URI and that
your carrier accepts calls from Fonoster. See Connect a SIP trunk.
Next steps
Detect answering machines
Know whether a person or a voicemail picked up.
Webhooks
Get told when calls start, end or fail.
Call records
Read the transcript and recording of each call.
Use Fonoster from an AI client
Place calls and batches from Claude or Cursor.