Configuring a Twilio SIP Trunk

About Twilio

Twilio is a global telecoms provider listed on the Nasdaq stock exchange. It is a leader in the Voip communications field and has strong support and number availability worldwide.

3CX has integrated with Twilio via its API making setup quick and reliable. It offers a quick way of ordering individual phone numbers for international customers via its portal. 3CX uses the “Elastic SIP Trunking” product. In this guide we explain how to set it up.

Step 1: Create an account with Twilio

Account Creation with Twilio

To be able to auto create a Twilio SIP trunk in 3CX you will need to have a Twilio account as you will need to authenticate to the Twilio API using your Twilio’s account SID and Authentication token located on the Twilio Account Dashboard.  If you don't have a Twilio account yet, head over to Twilio’s site and create an account.

Step 2: Buy phone numbers

After you have created an account you will need to buy phone numbers. You can buy numbers by navigating to “Explore products and selecting the “Phone Numbers” option found under “Super Network”. If you want to use SMS then make sure the numbers you buy are SMS capable.

Step 3: Setting up your trunk in 3CX

Now you need to set up a trunk in 3CX. This can be done using the “Auto Setup” option. 3CX will create the trunk automatically and set the parameters automatically:

  1. In the 3CX Admin Console navigate to Voice & Chat and select the “Add Trunk” option.
  2. From the drop down list select your country and Twilio (Auto-setup) as your provider. Click OK to launch the configuration wizard
  3. Input your Account SID and Auth Token gathered from the Twilio Dashboard in Step 1.
  4. Select the numbers you want to associate with your trunk. If you want to have SMS messaging over this trunk, enable messaging by checking the messaging box next to the number.
  5. Specify a trunk name and leave it “System Wide”. This means the trunk can be used across all departments. If you want to limit it to a department select the department.
  6. Select “Create Now” to create the trunk and an outbound rule. Select “Later” if you want to manually create an outbound rule.
  7. 3CX will create your trunk in Twilio's portal and configure all necessary details. Your trunk is now ready to make and receive calls as well as messages. You might have to check the outbound rule settings.

Creating a Twilio Trunk manually

For those who want to manually create their trunk here are some tips on how to do so.

  1. 3CX only supports the “Elastic SIP Trunking” product from Twilio.  
  2. An Origination and Termination URI must be created in Twilio's portal.
  1. The termination URI must be added in the “Registrar/Server” field of the  PBX during the creation of the trunk.
  2. The “Origination URI” is the FQQN of your PBX.
  1. In the Authentication section of the SIP Trunk settings in Twilio's portal create a set of credentials that will be needed during the trunk creation in the PBX.
  2. Add all numbers in the E164 number format eg. +18135791691

See More

Last Updated

This document was last updated on 21 February 2025

https://www.3cx.com/docs/sip-trunk/twilio/