Skip to Content
SessionPBXCalling & Phone NumbersConnect a SIP Trunk
SessionPBX

Connect a SIP Trunk

A SIP trunk connects SessionPBX to a telephone carrier. You need one when users must receive calls on public phone numbers or dial numbers outside the workspace.

SessionTalk uses a bring-your-own-carrier model. Your carrier supplies the SIP service, phone numbers and call charges; SessionTalk supplies the hosted phone-system features.

Information to obtain from your carrier

  • Carrier or proxy hostname
  • SIP port and transport: UDP, TCP or TLS
  • Whether the trunk uses source-IP authentication or a username and password
  • Authentication username, password and realm when credentials are required
  • From-domain value, if different from the carrier host
  • Carrier signalling IP addresses or CIDR ranges
  • Inbound phone numbers
  • An authorised default outbound caller ID

Ask the carrier to send incoming calls with the dialled number in international format with the +, and tell it which SessionTalk regional address to send calls to. See What your carrier needs from you.

What your carrier needs from you

Carriers send calls to the SessionTalk region your workspace is in:

RegionHostnameIP address
Londonuk.sip.sessiontalk.io206.189.121.32
New Yorkus.sip.sessiontalk.io134.122.14.236
Singaporeasia.sip.sessiontalk.io152.42.251.112
  • Incoming calls: carriers should send calls on UDP port 5060 or TLS port 5061.
  • Called number: the carrier should put the dialled number in international format with the +, for example +442071234567. A leading 00 is converted to +. National formats, such as 02071234567, don’t match.
  • Outgoing calls: SessionPBX can reach the carrier over UDP, TCP or TLS on the carrier’s port.
  • DTMF: RFC 2833 telephone events only.

Add the trunk

Adding a trunk is a short wizard. Each step is checked before you move on, so a mistake is caught where it was made.

  1. Open the SessionPBX project.
  2. Select Call Routing.
  3. On SIP trunks, select Add trunk.

Provider — name the trunk and choose your carrier. Picking a carrier fills in the settings we know for it and tells you what you still need to supply. Twilio, Telnyx, SignalWire and Plivo can also read your account and fill in your phone numbers; see Carrier Guides. Choose Other / not listed for a carrier with no template.

Connection — the carrier host, port and transport, and whether the trunk carries calls in both directions or only one.

Authentication — how the carrier recognises you: By our IP address, or Username and password, with or without registration.

Inbound — the numbers this trunk brings in, and whether to refuse calls for numbers not listed.

Outbound — the caller ID to present, which calls leave this way, and any additional gateways.

IP authentication

Use IP authentication when the carrier recognises the source and destination IP addresses without a SIP password. Enter every signalling source that the carrier may use under Carrier IP addresses, one IP address or CIDR range per line. Unless the trunk registers, SessionPBX accepts calls only from the addresses listed here.

These are the carrier’s addresses, not your own. Only add ranges the carrier has confirmed: broad allowlists increase exposure to unwanted traffic and toll fraud.

Credential authentication

Use credential authentication when the carrier requires a password on outbound calls. Enter the Username and Password. Leave Auth realm or From domain blank unless the carrier gave you specific values. Register to this carrier turns on automatically when you enter a username and password. Leave it on if the trunk receives calls: a username-and-password trunk has no Carrier IP addresses list, so with registration off it can’t receive incoming calls. Turn it off only on an outbound-only trunk, for example when the carrier sends incoming calls to a separate IP-authenticated trunk.

When editing an existing credential trunk, leave the password blank to keep the stored secret. Enter a value only when rotating it.

Registration

Turn on Register to this carrier when the carrier expects the phone system to sign in rather than recognising its address. Most UK and European providers work this way. Registration uses the Username and Password above; set Registration user only if the carrier gave you a different one. Registration runs only when the trunk carries calls in both directions or is outbound only. TLS registration isn’t available yet, so use UDP or TCP for registration. See Registration-based Carriers.

Add numbers and caller ID

Enter inbound numbers one per line under Inbound numbers, in international format with the + and country code, for example +442071234567. Numbers in other formats aren’t accepted.

Set Caller ID to a number that belongs to this carrier account, in the same international format. It’s presented on every outbound call this trunk carries. To present a different number for some destinations, add a caller ID to an Outbound number rule (see below). Caller ID comes from the trunk, not from individual members.

Caller ID is sent in the From header by default. If the carrier screens your caller ID and reads it from P-Asserted-Identity or Remote-Party-ID rather than From, set Assert caller ID in accordingly. From is always sent either way, so leave this alone unless the carrier asked for it.

More than one carrier, or more than one gateway

A workspace can have several trunks. Use Outbound number rules to say which calls leave by which trunk, one rule per line as a dialling prefix, an optional priority and an optional caller ID: prefix [priority [caller ID]]. The longest matching prefix wins; if two rules match equally, the lower priority number wins. A trunk with no rules carries every outbound call. Only the best-matching trunk is tried: if it fails, the call doesn’t move to another trunk.

If a single carrier gave you several hosts for resiliency, add the extras under Additional gateways rather than creating a second trunk. Calls try them in priority order, and share between gateways at the same priority. A lower number wins: the trunk’s main host is priority 0, so give a backup gateway priority 10.

Enable and test the trunk

A new trunk is enabled as soon as it’s created. Check that its switch in the Enabled column of the BYO SIP trunks list, on the SIP trunks tab, is on. Test in this order:

  1. Call an inbound number from an outside phone.
  2. Confirm the expected SessionCloud extensions ring.
  3. Enable Outbound PSTN for one test member.
  4. Call a permitted public destination.
  5. Confirm two-way audio and the presented caller ID.

If inbound signalling does not arrive, verify the carrier destination, allowed source IPs, port and transport. The carrier should send to UDP 5060 or TLS 5061. If a call connects with one-way audio, collect the time, calling number, called number and affected networks before contacting support.

Edit, disable or delete a trunk

  • Edit a trunk to change its carrier details, numbers or credentials.
  • Turn off its switch in the Enabled column of the BYO SIP trunks list to stop using it without deleting its configuration.
  • Delete it only when its numbers and routes are no longer required.

Deleting a trunk also removes its inbound-number routing from SessionPBX.

Carrier guides

Carrier Guides lists every carrier guide and the settings each carrier needs. Guides include:

Continue with routing phone numbers and enabling outbound calls.

Last updated on