Skip to contentSkip to navigationSkip to topbar
On this page

Elastic SIP Trunking Configuration Guides


The following Configuration Guides are intended to help you connect your IP Communications Infrastructure (Contact Center, IP-PBX, SBC, etc) to a Twilio Elastic SIP Trunk.

We have configuration guides with the following types of IP communications infrastructure elements:

  1. IP Private Branch Exchange (IP-PBX)
  2. Contact Centers (CC)
  3. Unified Communications (UC)
  4. Session Border Controllers (SBC)

For comprehensive solution blueprints with leading Contact Centers, Unified Communications & SBCs please refer to our Elastic SIP Trunking - Solution Blueprints.

Be aware, due to the large number of versions, variations, add-ons, and options for many of these systems, the settings you see may differ from those shown in our Configuration Guides. As such, these documents are intended as general guidelines, rather than configuration templates. There is an assumption of familiarity with your network and SIP infrastructure, and how they work. Twilio cannot provide direct support for third-party products; you should contact the manufacturer for your IP communications infrastructure for assistance in configuring such products.

If you wish to share your Configuration guide to help us improve this section for other users, kindly submit them or any corrections to the existing guides to sip.interconnectionguides@twilio.com.

(information)

Info

If you do not yet have your Twilio Elastic SIP Trunk configured, please see documentation on creating and configuring your trunks.

VendorTypeQualified for Secure Trunking
AsteriskIP-PBXYes
FreeSwitchIP-PBXYes
3CXIP-PBXNo
ElastixIP-PBXNo
FreePBX(R)IP-PBXYes
GrandstreamIP-PBXNo
Genesys CloudCloud Contact CenterNo
xCallyCall CenterYes
Zoom PhoneUnified CommunicationsYes
Mitel MiVoice Business 7.2Unified CommunicationsYes
Ribbon CommunicationsE-SBCYes
Ribbon using Microsoft LyncE-SBCYes
Ribbon EdgeMarcE-SBCNo
AudiocodesE-SBCYes
OracleE-SBCNo
Cisco ISRE-SBCNo
inGateE-SBCYes
SansayE-SBCNo
TelcoBridgesProSBCNo

IP-PBX

ip-pbx page anchor

Asterisk IP-PBX

asterisk page anchor

Assuming you have Asterisk already set up as your IP-PBX, with one or more telephones configured and running calls between them, the following guide provides detailed step-by-step instructions of how to configure your Trunk and your Asterisk IP-PBX.

Optionally, Twilio Elastic SIP trunking also provides Secure Trunking (SIP TLS and SRTP), see guide for configuration details.

Click here to download the Asterisk Interconnection Guide(link takes you to an external page)

FreeSwitch IP-PBX

freeswitch page anchor

Assuming you have FreeSwitch already set up as your IP-PBX, with one or more telephones configured and running calls between them, the following Interconnection Guide provides you with step-by-step instructions to use FreeSwitch PBX with your Twilio Elastic SIP Trunk.

Click here to download the FreeSwitch PBX Interconnection Guide

FreeSwitch using Secure Trunking

freeswitchsecure page anchor

This is supported. At this time there is no guide published but reach out to support if you have any questions.

Twilio Elastic SIP trunking also provides Secure Trunking (SIP TLS and SRTP).

This guide provides the configuration steps required to implement FreeSwitch PBX using a Twilio Elastic SIP trunk using Secure Trunks.

Click here to download the FreeSwitch PBX with Secure Trunking Interconnection Guide(link takes you to an external page)

Click here to see the 3CX guide to configuring Twilio Elastic SIP Trunks(link takes you to an external page)

Assuming you have your 3CX already set up with one or more telephones configured and running calls between them, the following highlights specific configuration for use with your Twilio SIP Trunk.

  • Add a new VoIP Provider account in the 3CX phone system: "Twilio"
    • Set the SIP server hostname to: example.pstn.twilio.com
    • Set your Authentication ID/username and password (as you configured in your user credentials on your Twilio Trunk)
  • DID's and Inbound Call Identification: Enter your Twilio numbers under the "DID" tab.
  • "Advanced" under "Codec priorities" only include G711 U-law
  • Create Outbound Call Rules: setting calls to numbers with a length of 10, and also prepend a "+1". This will ensure E164 formatting.

Click here to download the 3CX Interconnection Guide

If you want to use Elastix IP-PBX with your Twilio Trunk, the following guide provides detailed step-by-step instructions of how to configure your Trunk and your IP-PBX.

Click here to download the Elastix Interconnection Guide

Assuming you have FreePBX already set up as your IP-PBX, with one or more telephones configured and running calls between them, the following highlights specific configuration for use with your Twilio Trunk.

Click here to download the FreePBX Interconnection Guide(link takes you to an external page)

The following Interconnection Guide provides you with step-by-step instructions to use GrandStream UCM with your Twilio Elastic SIP Trunk.

Click here to download the Grandstream Interconnection Guide(link takes you to an external page)


The following Interconnection Guide provides you with step-by-step instructions to use Genesys Cloud BYOC your with Twilio Elastic SIP Trunk.

Click here to download the Genesys Cloud Interconnection Guide(link takes you to an external page)

xCally Call Center

xcally page anchor

The following Interconnection Guide provides you with step-by-step instructions to use XCally Call Center your with Twilio Elastic SIP Trunk.

Click here to download the xCally Interconnection Guide


Zoom Phone(link takes you to an external page) is an enterprise cloud phone system. Zoom Phone offers two "bring your own carrier" (BYOC) approaches, called "Zoom Phone Premise Peering PSTN"and Zoom Phone Carrier Peering PSTN, which both provide organizations the flexibility to select their voice services for Zoom Phone.

Click here to download the Zoom Phone Configuration Guide(link takes you to an external page)

Mitel MiVoice Business 7.2

mitel page anchor

The following guide is not maintained by Twilio. Please see Mitel Knowledge base for latest guide.

Click here to download the Mitel MiVoice configuration Guide(link takes you to an external page)


Enterprise Session Border Controller (E-SBC)

enterprise-session-border-controller-e-sbc page anchor

Ribbon Communications SBCs

ribbon page anchor

Microsoft Teams and Cisco UCM using Ribbon E-SBC and Twilio Elastic SIP Trunking Configuration Guide(link takes you to an external page)

Ribbon E-SBC 5000 using Microsoft Lync

ribbonlync page anchor

Assuming you have your E-SBC already set up, the following highlights specific configuration for your Ribbon E-SBC for interworking with Microsoft's Lync Server 2013 environment using your Twilio Trunk.

Click here to download the Ribbon Microsoft Lync Interconnection Guide

Assuming you have your SBC already set up with one or more telephones configured and running calls between them, the following highlights specific configuration for use with your Twilio Trunk.

Navigate to "VoIP">"SIP" to configure the SIP server info for Twilio. Enter in the SIP Server FQDN assigned for these services under the SIP Server Address field. Fill in the SIP Server Domain field with the proper Twilio domain.

Note: Make sure to check the "Limit Inbound to listed Proxies" and "Limit Outbound to listed Proxies" boxes to help prevent fraudulent activity sourced from a LAN side PBX or a WAN side DoS attack.

EdgeMarc SIP Settings.

Navigate to "VoIP ALG" and then "B2BUA" to configure the SIP Trunk registration with the soft-switch (between the Ribbon EdgeMarc and the WAN side soft-switch), the PBX for SIP registration mode (between the PBX and LAN side of the Ribbon EdgeMarc), inbound rule (for sending SIP messages from the WAN side of the Ribbon EdgeMarc to the PBX) and outbound rule (for sending the SIP messages from the Ribbon EdgeMarc to the WAN soft-switch). RFC-4904 support will be handled by applying header manipulation action rules to the matched outbound rules.

Configuring the PBX for SIP registration mode (between PBX and the Ribbon EdgeMarc). From the "Trunking Devices" section:

  • Click the "New Row" button to get to a new entry for a Trunking Device.
  • Enter a PBX name in the "Name" field.
  • Select the correlating PBX from the drop-down list of the "Model" field.
EdgeMarc Trunking Device Settings.
  • Select IP Registration mode by selecting the radio button for using the IP field and Port field.
  • Enter the PBX IP in the "IP" field.
  • Enter 5060 in the "Port" field. Click "Update" to create a Trunking Device for PBX. Click "Submit" at the bottom of the page to send the config to the Ribbon EdgeMarc.

Configure the Ribbon EdgeMarc default inbound rule (for sending the SIP messages from the Ribbon EdgeMarc to the PBX). This is required in order for non-pilot DIDs to reach the PBX.

From the Actions section:

  • Click the "New Row" button to get a new entry for creating an inbound action.
  • Enter the action name in the "Name" field.
  • Select the radio button of "Trunking Device".
  • Select the PBX from the drop-down list next to "Trunking Device".
EdgeMarc Default Rule Settings.
  • Click the "Update" button.

From the Match section:

  • Click the "New Row" button to get a new entry for an inbound rule.
  • Select "Inbound" in the "Direction" field.
  • Select the radio button of "Default".
  • Select "InboundAction" from the drop-down list of the "Action" field.
  • Click the "Update" button.
EdgeMarc Default Rule Settings.

From the Match section:

  • Click the "New Row" button to start a new entry for an outbound rule.
  • Select "Outbound" in the "Direction" field.
  • Select the radio button of "Pattern match", select "Calling" from the drop-down list and enter a "." or match the partial DID map (for example, if there is 6785551111-1115 , then use 678555111X ) in the "Pattern match" field to match any calling numbers.
  • Select "Any" from the "Source" field.
  • Select OutboundAction1 from the drop-down list of the "Action" field.
  • Click the "Update" button.
EdgeMarc Default Rule Settings.
  • Click "Submit" at the bottom of the page to send the config to Ribbon EdgeMarc.

Click here to download the Audio Codes using Microsoft Teams Direct Routing Guide(link takes you to an external page)

Click here to download the Audio Codes using Microsoft Lync Interconnection Guide

Oracle E-SBC

oracle page anchor

Assuming you have your SBC already set up with your IP-PBX, with one or more telephones configured and running calls between them, the following highlights specific configuration for use with your Twilio trunk.

Make sure you have your Network & Physical Interfaces appropriately configured.

Configure your Trunk SIP Interface towards Twilio:

1
sip-interface
2
state enabled
3
realm-id OUTSIDE
4
description
5
sip-port
6
address X.X.X.X (add this to your Twilio IP ACL)
7
port 5060
8
transport-protocol UDP
9
tls-profile
10
allow-anonymous agents-only
11
ims-aka-profile
12
carriers
13
trans-expire 0
14
...

Configure your Session Agent towards Twilio:

1
session-agent
2
hostname example.pstn.twilio.com
3
ip-address
4
port 5060
5
state enabled
6
app-protocol SIP
7
app-type
8
transport-method UDP
9
realm-id OUTSIDE
10
egress-realm-id
11
description Twilio
12
carriers
13
allow-next-hop-lp enabled
14
constraints disabled
15
...

The second example presented here illustrates adding +1 to called numbers (To and Request-URI headers) for all SIP trunk endpoints in a particular realm.

Firstly, define the session-translation with a called rule:

1
session-translation
2
id addCalledPlusOne
3
rules-calling
4
rules-called addPlusOne

Then define the rule to append +1:

1
translation-rules
2
id addPlusOne
3
type add
4
add-string +1
5
add-index 0
6
delete-string
7
delete-index 0

Lastly, apply the translation as outgoing to the SIP trunk realm:

1
realm-config
2
identifier OUTSIDE
3
...
4
in-translationid
5
out-translationid addCalledPlusOne
6
...

Set the preferred codec to G711 mu-law. In the example below, the Net-Net SD manipulates the codec list for all PBXs in the PBXs realm such that PCMU appear first in the media descriptor offered to the SIP trunk:

1
realm-config
2
identifier PBXs
3
...
4
options preferred-codec=PCMU
5
...

Cisco ISR (Cisco 28xx, 29xx, 38xx, 39xx, 43xx etc.)

cisco page anchor

Assuming you have your ISR already set up with one or more telephones configured and running calls between them, the following highlights specific configuration for use with your Twilio Trunk.

If you use credentials for outbound calls, you must use the B2BUA built into Cisco IOS:

1
sip-ua
2
authentication username anniebp password 7 15431A0D1E0A1C171060302610 realm sip.twilio.com
3
registrar dns:example.pstn.twilio.com expires 3600
4
sip-server dns:example.pstn.twilio.com
5
!

Update your Trust List:

1
voice service voip
2
ip address trusted list
3
ipv4 54.172.60.0/23
4
ipv4 54.171.127.192/26
5
ipv4 54.65.63.192/26
6
ipv4 54.169.127.128/26
7
ipv4 54.252.254.64/26
8
ipv4 177.71.206.192/26
9
allow-connections sip to sip
10
!
  • TWILIO accepts 'Early offer' only, so Cisco users/partners would have to force call as Early offer.
  • Use SIP normalization profile to change 'From' header to include IP address of CUBE router instead of DNS name

Ensure all numbers use full E.164 format, so transform all outbound calls to E.164 before sending to Twilio. The rules below are doing 2 things: changing this outbound call from 919803331212 to +19803331212 and changing the ANI from 4002 to 9802180999.

1
voice translation-rule 1
2
rule 1 /^91/ /+1/
3
!
4
voice translation-rule 2
5
rule 1 /4004/ /9802180971/
6
rule 2 /4002/ /9802180999/
7
rule 3 /4005/ /9802180980/
8
!
9
!
10
voice translation-profile twilio
11
translate calling 2
12
translate called 1
13
!

Lastly, you may have a dial-peer with 91[2-9]..[2-9]...... in order to catch the calls. You can see the translation profile that is applied to translated the number to E.164. Also ensure G.711 codec is used. The 'session target sip-server' is what target the sip B2BUA configured above with the 'sip-ua' command.

1
dial-peer voice 200 voip
2
translation-profile outgoing twilio
3
destination-pattern 91[2-9]..[2-9]......
4
session protocol sipv2
5
session target sip-server
6
dtmf-relay rtp-nte sip-kpml sip-notify
7
codec g711ulaw
8
no vad
9
!

inGate SIParator

ingate page anchor

The following Interconnection Guide provides you with step-by-step instructions to use inGate SIParator E-SBC with Twilio Elastic SIP Trunk. Optional steps to configure SIP over TLS and SRTP ([Secure Trunking][securetrunks]) are also included in this guide.

Click here to download the inGate Interconnection Guide

Assuming you have your SBC already set up with one or more telephones configured and running calls between them, the following highlights specific configuration for use with your Twilio Trunk.

Sansay Configuration.
Sansay Configuration.
Sansay Configuration.
Sansay Configuration.

The following Interconnection Guide provides you with step-by-step instructions to use TelcoBridges ProSBC with Twilio Elastic SIP Trunking. Click here to download the TelcoBridges ProSBC Interconnection Guide(link takes you to an external page)