Configuring a SIP Trunk

Introduction

To make and receive calls, you have to create an account with a SIP trunk provider (also referred to as a VoIP provider). A SIP trunk provider will connect you to the old-style PSTN. Having your own SIP trunk provider account means you will have full control over your phone numbers and most of the time it also means lower-cost calling. 3CX supports a number of SIP trunk providers. They have been selected based on ease of configuration, ease of account setup, and support.

DID numbers

VoIP providers provide DID (Direct Inward Dialing) numbers (also known as DDI or MSN numbers) which allow you to route calls directly to a queue, ring group, extension or a digital receptionist. These virtual numbers are priced at a fraction of the cost of adding physical lines or SIP trunks.

Outbound caller ID

Outbound calls will by default get the main trunk number as their caller ID. If an extension has a DID assigned, then by default it will use this caller ID. You can still set the caller ID at extension level but only a few providers will allow so called “clip, no screening” as it's been abused by spam callers.

Selecting caller ID

If a user has multiple DIDs, it will be possible to select a caller ID for an outbound call in which case it will automatically use the trunk assigned to that DID and set the caller ID accordingly.

Caller ID reformatting

If you need to reformat a caller ID, see this guide.

IMPORTANT On-premise / Self-hosted installs should run the firewall check first! Your firewall needs to be configured correctly. See our firewall configuration guide.

Step 1: Get a supported VoIP provider / SIP trunk

Find a supported VoIP / SIP trunk provider in your country. Using a preferred or supported SIP trunk provider means 3CX is pre-configured to work with the VoIP provider and you can be sure to get support from both 3CX and the provider.

If you do not use a supported provider, make sure that the VoIP provider is familiar with 3CX and will support you in configuring the trunk. You should be aware that in many cases additional support will be required as 3CX will not assist in the configuration of an unsupported VoIP provider.

Step 2: Add the VoIP provider account in 3CX

After obtaining a VoIP provider account, you must configure the account in 3CX.

  1. Navigate to Admin > Voice & Chat. Click + Add trunk.
  2. Enter a name for this trunk.
  3. Now specify the default route, this will be the destination calls will be routed to for DIDs not assigned to an (system) extension. So as soon as you assign the main number to for example your main IVR, then the default route will be ignored for that main trunk number. The same for a DID assigned to an extension. In effect the default route is the destination for any unassigned DIDs.
  4. In “Limit to”, specify whether this will be a system wide SIP trunk or a department specific SIP trunk. If system wide, then only system owners and system admins can manage the SIP trunk. If department specific, group owners and admins can also manage the SIP trunk. If you put a SIP trunk into a department, its DIDs will only be visible within the department.
  5. Under SIP Trunk Details, select the country and use the drop-down box to select your provider under the Trunk field.
  6. If you are using a supported provider the Authentication method will be automatically selected. However some providers offer a choice and in the generic template you must configure it. A SIP trunk authentication is either register based (You will have account details) or IP based, in which case you will need to specify an IP. In the case of an IP based provider, whenever you change the host on which 3CX runs, you will need to liaise with your provider and inform them of the IP change.
  7. Now enter registration details, authentication ID and Password or IP given to you by your SIP trunk provider together with your main trunk phone number. In some cases additional options will be requested (based on SIP trunk provider requirements).
  8. Click on the DID Numbers tab on the top and click +Add to add any DID numbers associated with this account. You may also use “Import” to massively import DID numbers. Here is a sample “.txt” import file for DIDs that you can download.
  9. Click Save. You are now ready to make and receive calls. Once created, you will see a status indicator showing red for not-registered and green for registered.

Step 3: Route the DID Numbers to the destination

Now you must route the number and optional DID numbers to their destination

  • To route to an IVR, Ring Group, Queue or Digital Receptionist, go to Call handling, select the desired system extension, and select the DID from the “Assigned DID Number(s)” drop-down. 
  • To Route an extension, go to Users, select the desired user and under the “General” tab select the DID from the “Assigned DID Number(s)” drop-down.

Step 4 - Create an Outbound Rule

After you have configured the SIP Trunk, you will need to create an outbound rule which allows extension users to use this SIP Trunk. To do this you will need to create an outbound rule which will route calls depending on either a prefix, length of number or group membership. (I.e. you can either have a prefix say 0, or you can also have an outbound rule which applies to a set of extensions or all users in a department)

For more information see the Configuring Outbound Rules guide

Step 5: Configure SMS / MMS (Optional)

This option is mainly for US & Canadian customers. In the US, most DID numbers are enabled by default to send and receive SMS. When configuring one of our supported providers, the additional SMS tab will also be presented if your provider supports it.

  1. Check the Enable SMS box to get your unique 3CX webhook.
  2. Make sure that all your DID numbers have been entered as E164 numbers! So if your number is (813) 591-0130, then you must enter it as +18135910130.
  3. Go to your provider's portal and paste the webhook as explained in the guides:
  1. On the portal of your VoIP provider, obtain the “Access Key” and “Secret Key”. Enter them here and click Save.

See also

Last Updated

This document was last updated 28 February 2024

https://www.3cx.com/docs/manual/sip-trunks/ 

Discuss this article