Twilio SIP Trunk to a Hosted PBX: Setup Guide (2026)

Tom Reed · Updated 2 December 2026
Yes, Twilio is a SIP trunk provider. Its Elastic SIP Trunking connects a PBX to the phone network, but doesn't give you extensions, call queues or apps. To use a Twilio SIP trunk with a hosted PBX, connect the trunk to SessionPBX with a standard API key. SessionPBX fills in the trunk and can finish the Twilio-side setup for you.
This guide is for teams and MSPs that already use Twilio for numbers and Elastic SIP Trunks and want a business phone system on top, without writing code. It explains the decisions and what SessionPBX automates, and links our docs for the exact clicks. It's written by the SessionPBX team.
What is Twilio Elastic SIP Trunking, and what does a PBX add?
Elastic SIP Trunking is Twilio's SIP trunk service. It does two jobs. Termination carries outbound calls from your PBX to the phone network, and origination delivers inbound calls to your Twilio numbers to your PBX. That's what a SIP trunk is used for: connecting a phone system to public phone numbers.
What a trunk doesn't do is run your phone system. There are no members, extensions, ring groups, queues, IVR menus or call flows in Twilio SIP trunking on its own, and no apps for your team. That's the PBX's job. SessionPBX, the hosted phone system, supplies those and connects to Twilio over the trunk. Team members then call from the SessionTalk apps on iOS, Android and desktop, signed in as extensions, so the result is a Twilio PBX setup without a server to run.
If you also use Telnyx, or want the wider picture of who owns each layer, our guide to running a hosted PBX on the carrier you already use covers both carriers.
What do you need before you connect Twilio?
Have these ready before you open the SessionPBX wizard:
- An Elastic SIP Trunk in your Twilio console, with its Termination SIP URI noted (it looks like yourtrunk.pstn.twilio.com)
- The Twilio numbers you want to use, already on the account
- A standard Twilio API key, not your Auth Token, with three values: the Account SID (starting AC), the API Key SID (starting SK) and the API Key secret, which Twilio shows only once
- Which SessionPBX region your workspace is in: London, New York or Singapore
Why a standard API key? An Auth Token has full access to your Twilio account and can't be revoked on its own. A standard API key can be revoked separately whenever you need to.
How do you connect your Twilio account to SessionPBX?
The connection takes four steps in SessionPBX:
- Open Call Routing, then SIP trunks, and select Add trunk.
- Name the trunk and choose Twilio Elastic SIP Trunking as the provider.
- Choose your Twilio region and enter the Account SID, API Key SID and API Key secret.
- Select Connect account.
SessionPBX then reads your account and fills in your purchased numbers as inbound numbers, the termination host from your Elastic SIP Trunk, and Twilio's signalling IP ranges, transport and port. Keep all of the signalling ranges it lists.
If your trunks aren't listed, the API key probably came from a parent project. Twilio scopes the trunk list to the project that issued the key, so paste the Trunk SID (starting TK) into the box SessionPBX shows, or create the key in the project that owns the trunk. The Twilio carrier guide has every field.

What does SessionPBX set up on the Twilio side for you?
"Finish the setup in Twilio for me" is ticked by default. When you create the trunk, SessionPBX does the Twilio-side steps below. If you untick it, you do them in the Twilio console instead.
| Twilio-side step | Done by SessionPBX when "Finish the setup in Twilio for me" is ticked | If you do it yourself |
|---|---|---|
| Origination URI (inbound) | Added, pointing at your SessionPBX region | Add sip:region.sip.sessiontalk.io, for example sip:uk.sip.sessiontalk.io for London |
| Numbers on the trunk | The numbers you selected are attached | Add them under Numbers on the trunk |
| IP access control list (outbound) | Your region's SessionPBX address is added | Add the region address from the docs table |
| A step that fails | Reported by name; Try again repeats only the failed steps | Follow "Finish in the Twilio console" in the docs |
A step usually fails because the API key doesn't have permission for that resource. The trunk is saved either way, and SessionPBX carries on with the remaining steps. For the region addresses and Twilio IP addresses, use the docs table rather than copying them from elsewhere.
How do you handle more than one Twilio region?
Many accounts have one Twilio trunk per region, for example a US trunk and a European one. Twilio treats regional trunks as separate services, so add one SessionPBX trunk for each. Then use outbound number rules to route by dialling prefix: +1 to the US trunk and +44 to the European one. The longest matching prefix wins, so a more specific rule beats a general one.
Be clear about what this does and doesn't do. Each call tries the best-matching trunk only. If that trunk can't place the call, SessionPBX doesn't move it to a different trunk. Outbound rules are covered in the SIP trunks guide.
Should you use TLS on a Twilio SIP trunk?
If you want encrypted signalling for inbound calls, yes. SessionPBX accepts calls from carriers on UDP port 5060 or TLS port 5061. For TLS, set the origination URI on your Twilio trunk to the TLS form of your region's address, for example sip:uk.sip.sessiontalk.io:5061;transport=tls for London. Encrypting the call audio is a separate, optional setting on both sides, so check it in the docs before you rely on it. Our guide to choosing a carrier explains the wider choice between IP and credential authentication; with Twilio, SessionPBX uses IP.
How do you route your Twilio numbers and let members call out?
Routing happens in SessionPBX:
- Inbound: on Call Routing, Inbound number routing chooses where each Twilio number rings: everyone, a team member, a ring group, a call queue or a call flow.
- Outbound: outbound calling is off for new members. Edit the member in Team Members and turn on Outbound PSTN under Access & features.
- Dialling: members dial in international format, and SessionPBX sends numbers to Twilio the same way. Twilio expects full international format (+E.164) in both directions.
- Outgoing number: on the trunk's Outbound settings, choose a number on this Twilio account.

How do you test a Twilio SIP trunk?
Run through this before you publish the numbers:
- Call each Twilio number from an outside phone, and check that the right destination rings
- Turn on Outbound PSTN for one member, then call a public number
- Check that audio works both ways
- Press keys in an external IVR menu and check they register (SessionPBX sends key presses as RFC 2833 telephone events)
- With more than one region, call out once for each prefix rule
- Repeat from the desktop app and a mobile app
For a carrier-neutral version of these steps, see the carrier-neutral checklist.
Why do Twilio trunk calls fail, and what do you check first?
Most failures come down to three things:
- Inbound calls never arrive: the origination URI in Twilio is the usual cause. Check it points at your SessionPBX region.
- Outbound calls fail: check that the termination host in SessionPBX matches your Twilio trunk exactly, and that your region's SessionPBX address is on the trunk's IP access control list.
- Some numbers fail: check they're in full international format (+E.164).
If none of these explains it, note the time of the call, the number you called from and the number you called before you contact support.
FAQ
Is Twilio a SIP trunk provider?
Yes. Twilio's Elastic SIP Trunking connects your PBX to the public phone network for outbound and inbound calls. It doesn't include extensions, queues or apps, so you pair it with a phone system such as SessionPBX to give your team a working business phone system.
Should I give the PBX my Twilio Auth Token?
No. Use a standard API key instead. An Auth Token has full access to your Twilio account and can't be revoked on its own, while a standard API key can be revoked separately. SessionPBX needs the Account SID, API Key SID and API Key secret.
How much does a Twilio SIP trunk cost?
Twilio sets its own rates and bills calls and numbers on your Twilio account, so check Twilio's pricing for your countries. You pay Twilio directly for the trunk, and calls between your team members stay on SessionPBX without using it.
Can I keep using my Twilio numbers?
Yes. When you connect your account, SessionPBX lists the numbers already on it. You choose which ones the trunk uses, then route each one to a member, ring group, queue or call flow in Inbound number routing.
Can I text from the same Twilio number?
Texting is a separate connection from the voice trunk described here. If that's what you need, our post on texting from Twilio numbers explains how that connection is set up. Your voice trunk and calls work the same either way.
Sources
Twilio settings follow the SessionTalk Twilio guide, which is checked against Twilio's published Elastic SIP Trunking documentation. SessionPBX field names come from the Add SIP trunk wizard.
- Twilio: Elastic SIP Trunking documentation
- Twilio: IP addresses for Elastic SIP Trunking
- SessionTalk: Connect Twilio Elastic SIP Trunking to SessionPBX
Put your Twilio numbers on a phone system your team can use
Put your Twilio numbers on a phone system your team can use. Start with SessionPBX on your Twilio trunk, and get the SessionTalk apps for your team.