10. Configuring a SIP Trunk / VoIP Provider - 3CX
pixel500w-500x1
Zero Admin
With the new Dashboard
pixel500w-500x1
Bulletproof Security
With SSL certs and NGINX
pixel500w-500x1
Install on $150 Appliance
Intel MiniPC architecture
pixel500w-500x1
New, Intuitive Windows Client
More themes, more UC
pixel500w-500x1
More CRM Integrations
Scripting Interface to add your own
pixel500w-500x1
Improved Integrated Web Conferencing
iOS and Android apps included
pixel500w-500x1
Personal Click2Meet URLs

10. Configuring a SIP Trunk / VoIP Provider

SIP Trunks / VoIP Providers / VoIP Gateways

On this topic

SIP Trunks / VoIP Providers / VoIP Gateways

Introduction

Requirements for using a VoIP Provider / SIP Trunk

Requirements for VoIP Gateways

Configuring a VoIP Provider / SIP Trunk

Step 1: Create an Account with a VoIP Provider

Step 2: Conduct the Firewall Test

Step 3: Add the VoIP Provider Account in 3CX Phone System

Step 4: Create an Outbound rule to route calls over the SIP Trunk

Configuring a VoIP Gateway

Step 1: Find the VoIP Gateway and update its firmware

Step 2: Configure the VoIP Gateway in 3CX Phone System

Step 3 - Upload the configuration file to the VoIP Gateway

Step 4: Create an Outbound rule to route calls over the PSTN Gateway

See Also

Introduction

To be able to make outbound calls on the PSTN you will have to configure at least one SIP trunk / VoIP Provider or VoIP Gateway.

VoIP / SIP Trunk providers “host” phone lines and replace the traditional telco lines. VoIP providers can assign local numbers in one or more cities or countries and route these to your phone system. In most cases they also support number porting. Typically SIP trunks are cheaper than traditional PSTN lines. However, be aware that each VoIP call requires bandwidth. 3CX supports both registration based VoIP providers (Trunk logs on with username and password) and IP based trunks (PBX is linked to the Provider based on your public IP).

If you still have traditional PSTN/Phone lines, or prefer to use those, you can connect them to 3CX using VoIP Gateways. A VoIP gateway is a device which converts telephony traffic into data, so that it can be transmitted over a computer network. In this manner PSTN/telephone lines are “converted” to a SIP trunk, allowing you to receive and place calls via the regular telephony network. VoIP Gateways exist for analog lines as well as BRI, PRI/E1 lines and T1 lines. The VoIP Gateway will bundle these lines / ports into a single SIP trunk inside 3CX.

Requirements for using a VoIP Provider / SIP Trunk

  • A firewall/router/NAT device that supports STATIC PORT MAPPINGS. Often routers will perform port address translation, which will cause problems such as one way audio, failing inbound calls and so on. It is also highly recommended that you have an FQDN that resolves to a static external IP. If your external IP changes intermittently, inbound calls will fail. See the Firewall & Router Configuration for details to configure your firewall/router/NAT device.
  • Adequate Bandwidth. VoIP is real time, so it does place a demand on your Internet connection. As a rule of thumb, each call will consume approximately 30-120 kb per second, depending on which codec you use. The document, Bandwidth Overhead over DSL connections, includes detailed information about bandwidth consumption, including particular codecs bandwidth usage.
  • A supported VoIP provider. All supported VoIP providers have been tested for interoperability with 3CX, and are re-tested with each new build. Their configuration templates are also included with 3CX Phone System to allow you to quickly, easily add them correctly. See the list of 3CX Supported SIP Trunk Providers.

Requirements for VoIP Gateways

  • A 3CX supported VoIP gateway. Supported gateways have been tested by 3CX and are automatically configured with their correct settings. If using the default configuration, 3CX will also provide first line support of their use with 3CX Phone System. A list of the latest supported gateway hardware, can be found on the Supported VoIP Gateways & ATA's page.

Configuring a VoIP Provider / SIP Trunk

Step 1: Create an Account with a VoIP Provider

First, you need to have an account with a VoIP service provider. 3CX supports most popular SIP based VoIP service providers and we recommend using one that has been tested by 3CX as 3CX includes pre-configured templates for these VoIP providers. Go to http://www.3cx.com/partners/voip-providers/ to see a list of supported providers.

Step 2: Conduct the Firewall Test

3CX will prompt you to conduct a Firewall Test. Frequently, the internet facing firewall sitting between 3CX Phone System and the VoIP provider is not correctly configured or is not able to correctly route VoIP traffic. To check the firewall configuration, it is important to perform a firewall check using the inbuilt firewall checker. To do this:

  1. In the 3CX Management Console, go to the System Status page.
  2. In the section “PBX Status” select the “Firewall Check” entry.
  3. Click Run. 
  4. Ensure that the tests for the SIP Port (default port 5060), and the Audio Port range (default ports 9000-9255) pass.
  5. If the firewall check fails, you must go to your firewall and troubleshoot why the test failed.

Note: 3CX does not provide specific firewall configuration support. Configurations for popular firewalls can be found here.

Step 3: Add the VoIP Provider Account in 3CX Phone System

After you have created the VoIP provider account, you will need to configure the account in 3CX Phone System. To do this:

  1. In the 3CX Management Console menu, select SIP Trunks > Add SIP Trunk.
  2. Select the Country that the VoIP provider operates in.
  3. Select your VoIP provider from the Provider drop down list. Important: If the provider is not listed, select the “Generic” option in Country drop down menu and then choose between  “Generic VoIP Provider,” or “Generic SIP Trunk,” (If using a generic provider we will not be able to guarantee that 3CX will work with this VoIP provider).
  4. Enter the Main Number assigned to this SIP Trunk. If you just have DIDs and no main number you can select one of the DIDs as the main number. Click OK.” The SIP Trunk will be created and a new dialog will open.
  5. Enter a name for this VoIP provider account. The SIP server hostname or IP and optional Outbound Proxy will be pre-filled. Compare these with the details you have received from your VoIP provider and check that these are indeed correct.
  6. Specify the number of simultaneous calls your provider allows.
  7. In Authentication, specify whether authentication is based on IP or based on Account/Registration. If you selected a template, this will be automatically pre populated and you must leave as is. If IP based, the password will be greyed out, since authentication is linked to your IP. The outbound or inbound only are not applicable in most cases and can be ignored.
  8. Specify how calls to the main number should be routed. The routing configured here will be for calls matching the main number.
  9. If you have DID numbers, you will need to specify these in the DIDs tab. Click on the “DIDs” tab and add the DID numbers associated with this account. The DID will be created and linked to the operator extension. You can change this later from the “Inbound Rules” node by adding an inbound rule for the DID and routing to the desired destination.
  10. In the Caller ID tab, add the caller ID you wish to have appear on outbound calls.
  11. Click OK to save the trunk settings.

Step 4: Create an Outbound rule to route calls over the SIP Trunk

Now you need to create an outbound call rule. To do this:

  1. Go to the Outbound Rules node and press “Add” to create a new rule.
  2. Decide what calls should be routed over this trunk.
  3. In the Make Outbound Calls section select the trunk you just created.
  4. Click OK to create the outbound rule.
  5. For more detailed information about creating Outbound rules see this document.

Configuring a VoIP Gateway

Step 1: Find the VoIP Gateway and update its firmware

As a first step you need to connect the gateway and update its firmware. To do this:

  1. Connect the gateway to the network. Now obtain its IP:
  • If using a Beronet, use the “bfdetect tool. More information about Configuring Beronet BeroFIX.
  • If using a Patton, use the “SmartNode” Discovery Tool. More information about Connecting A SmartNode to the Network.
  • If using a Welltech, plug in an analog phone into the device and dial #126# on FXS devices. For FXO devices connect your LAN to the device’s WAN port which will acquire an IP address via DHCP.
  1. Login to the device’s web interface and update the firmware to the latest version.
  2. Assign a static IP and take note of this IP.

Step 2: Configure the VoIP Gateway in 3CX Phone System

The second step is to create the VoIP gateway in the 3CX Management Console and configure it.

  1. First of all Update 3CX to download and use the latest Gateway Template.
  2. In the 3CX Management Console, click the SIP Trunks node and then click Add Gateway.
  3. Select the Brand and the model/device.”
  4. Enter the Number of Physical PSTN ports on the device.”
  5. Enter a Main Trunk number associated with the gateway. Click OK. The Gateway will be added and a new dialog will open.
  6. Now enter a name for the Trunk (VoIP gateway).
  7. Enter the Hostname or IP of the VoIP Gateway in the Gateway Hostname or IP field, and specify the SIP Port on which the gateway is operating. By default this is 5060. Important: Do not change the SIP User ID & Password fields in the Authentication section. The device will be provisioned with these values and use them to register with 3CX.  
  8. Specify how calls to the main number should be routed. The routing configured here will for calls matching the main number.
  9. If you have DID numbers, you will need to specify these in the DID tab. Click on the “DIDs” tab and add the DID numbers associated with your account. An Inbound Rule will be created for each DID and linked to the operator extension. You can change this later from the Inbound Rules node.
  10. Click on the Generate device config at the top. This will create a file which you must upload to the gateway.

Step 3 - Upload the configuration file to the VoIP Gateway

  1. Once you have created the VoIP Gateway connection, export the configuration to the device by clicking on the “Generate Device Config” button.
  2. If using a Berofix, this will open a browser to configure the gateway remotely.
  3. If using a Patton or a Welltech, the button will download a config file that you must upload to the gateway. Configuration guides for Patton and Welltech.
  4. Your PSTN lines are now ready for use with 3CX.

Step 4: Create an Outbound rule to route calls over the PSTN Gateway

Now you need to create an outbound call rule that routes calls over the Gateway device. To do this:

  1. Go to the Outbound Rules node and press Add to create a new rule.
  2. Decide what calls should be routed via this gateway.
  3. In the “Make Outbound Calls” section select the trunk you just created.
  4. Click OKto create the outbound rule.
  5. For more detailed information about creating Outbound rules see this document

See Also

You might also be interested in:

<