Before you begin
You need:-
A Twilio account with a voice-capable phone number in it. Note the number in E.164 format, such
as
+18095550123. -
Your Twilio Account SID, which starts with
AC, and one way to sign in to Twilio:- A Standard API key (recommended): its SID, which starts with
SK, and its secret. Create one in the Twilio console under API keys & tokens. - Your Auth Token. It gives full access to your Twilio account, so prefer an API key.
- A Standard API key (recommended): its SID, which starts with
- An agent, an app or a SIP agent to send calls to. See Build an Autopilot agent or Build a stream with the Voice SDK.
- For the CLI: Node.js 22 or later.
Link the number
- Dashboard
- CLI
1
Open the link drawer
Go to Numbers, click Link number, then Twilio number.
2
Choose the number and its route
Enter the Number and choose where to send its calls.
3
Enter your Twilio credentials
Enter your Twilio Account SID. Under Credentials, choose API key or Auth
Token and fill it in.
4
Link it
Click Link number. The number shows in the list on Twilio Trunk.
Your Twilio number rings in Fonoster.
Link from a script
Without a terminal, the command never prompts: pass every value as a flag and the secret in an environment variable. This links a number to an application with a Standard API key:TWILIO_AUTH_TOKEN and pass --auth-token in place of
--api-key-sid. A missing value stops the command with exit code 1 and names the flag or variable,
such as Missing --account-sid. If the number is already in your workspace, the command stops
unless you pass --yes, which replaces the number’s trunk and route.
What linking sets up
Linking changes both your Twilio account and your Fonoster workspace. It names everything after your workspace’s access key ID in lowercase, shown here aswo7d2kq9x4m1c8b3n6p0r5t2v9y4z7a1e3.


- An Elastic SIP trunk named
Trunk-<access key ID>, with the termination domain<access key ID>.pstn.twilio.com. Fonoster sends your outbound calls there. - An IP access control list named
ACL-<access key ID>on that trunk, holding Fonoster’s signaling address. Twilio only accepts outbound calls from addresses on this list. - A SIP credential list named
CL-<access key ID>on that trunk, holding the username and password Fonoster signs outbound calls with. - An origination URL
sip:<access key ID>.pstn.fonoster.comon the trunk. Twilio sends calls to your number there. - Your number moves onto the trunk. Twilio then sends its calls over SIP, not to the number’s voice webhook.
- A trunk named Twilio Trunk, with the inbound URI
<access key ID>.pstn.fonoster.comand an outbound URI pointing at the Twilio termination domain. - A credential named
Twilio <access key ID>on that trunk, matching the one in the Twilio credential list. - The number, on that trunk, pointing at the application you picked.
Change where calls go
The linked number is a normal number in your workspace. To send its calls somewhere else, go to Numbers, open it, and pick a new destination under When this number is called, send it to. See Numbers and routing.On your own install
On a self-hosted Fonoster, the server you’re signed in to sets the address Twilio sends calls to and the addresses Twilio accepts calls from, so the command needs no extra flags. Set your install’s public SIP address first: see Carriers and phones.Troubleshooting
<number> isn't in Twilio account AC…1234. Check the number’s E.164 format and the Account SID.Twilio didn't accept these credentials. Check the SID and the key or Auth Token.This Twilio key can't …. Use a Standard API key or your Auth Token.Twilio is unavailable; try again. Try again in a few minutes.- The number rings but nothing answers. Check that the number points at an application under Numbers.
- Outbound calls fail. Twilio rejects calls from addresses outside the trunk’s access control list. On your own install, check your public SIP address in Carriers and phones.
Next steps
Numbers and routing
Send each number to the right agent, stream or SIP agent.
Make outbound calls
Call people from your Twilio number.
Connect a SIP trunk
Use another carrier.
Bring your Twilio or Pipecat app
Run a bot built for Twilio Media Streams on Fonoster.