Skip to main content
If you have a number in Twilio, one command connects it to Fonoster. The command sets up a SIP trunk between Twilio and Fonoster, moves the number onto it, and adds the number to your workspace pointing at the application you choose. Calls to the number then reach your Autopilot agent or stream, and you can place outbound calls from it.
Linking runs from the CLI. The dashboard doesn’t have a Twilio flow: once the number is linked, you manage it under Numbers like any other.

Before you begin

You need:
1

Install the CLI and log in

In the dashboard, go to API keys and create a key. Then install the fonoster CLI and log in to your workspace with the key ID and secret:
2

Run the link command

Start the command:
It asks for:Confirm with Ready?. The command returns when everything is set up.
3

Check the number

List your numbers. The linked number is there, on a trunk named Twilio Trunk, pointing at the application you picked:
Call the number from any phone. Your agent or stream answers.
Your Twilio number rings in Fonoster.

What the command sets up

The command changes both your Twilio account and your Fonoster workspace. It names everything after your workspace’s access key ID in lowercase, shown here as wo7d2kq9x4m1c8b3n6p0r5t2v9y4z7a1e3. In your Twilio account, the number +1 809 555 0123 moves onto an Elastic SIP trunk with an IP ACL for Fonoster's address and an origination URL sip:wo7d….pstn.fonoster.com. In your Fonoster workspace, a Twilio Trunk with inbound URI wo7d….pstn.fonoster.com carries the same number, which points at the Front desk agent. Incoming calls flow from Twilio to Fonoster; outbound calls flow back to wo7d….pstn.twilio.com. In your Twilio account, the number +1 809 555 0123 moves onto an Elastic SIP trunk with an IP ACL for Fonoster's address and an origination URL sip:wo7d….pstn.fonoster.com. In your Fonoster workspace, a Twilio Trunk with inbound URI wo7d….pstn.fonoster.com carries the same number, which points at the Front desk agent. Incoming calls flow from Twilio to Fonoster; outbound calls flow back to wo7d….pstn.twilio.com. In Twilio:
  • 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.
  • An origination URL sip:<access key ID>.pstn.fonoster.com on 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.
In Fonoster:
  • A trunk named Twilio Trunk, with the inbound URI <access key ID>.pstn.fonoster.com and an outbound URI pointing at the Twilio termination domain.
  • The number, on that trunk, pointing at the application you picked.
To link more Twilio numbers, run the command again. It reuses the trunks it already created on both sides and only adds the number. If the number is already in your workspace, the command replaces it.

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, Twilio has to reach your servers, not Fonoster Cloud. Pass two flags:

Troubleshooting

  • “The number … was not found in your account.” The number isn’t in the Twilio account whose SID you entered. Check the account and the E.164 format.
  • 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 the --access-control-list you passed.

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.