SIP Trunks / VoIP Providers / VoIP Gateways
On this topic
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 https://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:
- In the 3CX Management Console, go to the System Status page.
- In the section “PBX Status” select the “Firewall Check” entry.
- Click “Run.”
- Ensure that the tests for the SIP Port (default port 5060), and the Audio Port range (default ports 9000-9255) pass.
- 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:
- In the 3CX Management Console menu, select “SIP Trunks” > “Add SIP Trunk.”
- Select the Country that the VoIP provider operates in.
- 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).
- 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.
- 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.
- Specify the “number of simultaneous calls” your provider allows.
- 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.
- Specify how calls to the main number should be routed. The routing configured here will be for calls matching the main number.
- 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.
- In the Caller ID tab, add the caller ID you wish to have appear on outbound calls.
- 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:
- Go to the “Outbound Rules” node and press “Add” to create a new rule.
- Decide what calls should be routed over this trunk.
- In the “Make Outbound Calls” section select the trunk you just created.
- Click “OK” to create the outbound rule.
- 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:
- 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.
- Login to the device’s web interface and update the firmware to the latest version.
- 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.
- First of all Update 3CX to download and use the latest Gateway Template.
- In the 3CX Management Console, click the “SIP Trunks” node and then click “Add Gateway.”
- Select the “Brand” and the “model/device.”
- Enter the “Number of Physical PSTN ports on the device.”
- Enter a “Main Trunk number” associated with the gateway. Click “OK.” The Gateway will be added and a new dialog will open.
- Now enter a name for the “Trunk” (VoIP gateway).
- 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.
- Specify how calls to the main number should be routed. The routing configured here will for calls matching the main number.
- 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.
- 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
- Once you have created the VoIP Gateway connection, export the configuration to the device by clicking on the “Generate Device Config” button.
- If using a Berofix, this will open a browser to configure the gateway remotely.
- 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.
- 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:
- Go to the Outbound Rules node and press “Add” to create a new rule.
- Decide what calls should be routed via this gateway.
- In the “Make Outbound Calls” section select the trunk you just created.
- Click “OK”to create the outbound rule.
- For more detailed information about creating Outbound rules see this document
- See the Firewall & Router Configuration to configure your firewall/router/NAT device.
- Find more about Outbound and Inbound Rules.
- How much dedicated bandwidth do I need for VoIP? See the Bandwidth Overhead over DSL connections guide to find out.
- See the list of 3CX Supported SIP Trunk Providers.
- Configure BeroNet BeroFix /Small Business/ 400/1600/6400 – 1 or 4 BRI/E1 | GSM | FXO | FXS
- Patton Smartnode 4112, 4114 – FXO (Analog lines) & FXS (fax)
- Patton Smartnode 4970 – T1 & E1 (1 or 4 port)
- Patton SmartNode 4120 – ISDN BRI (1 & 2 port)
- Welltech WellGate 2540 – 4 port FXO
- Welltech WellGate 2424s – 24 Port FXS
- Welltech WellGate ATA 172plus-POE – 2 Port FXS (fax)
- Connecting A SmartNode to the Network