Configuring a SIP Trunk/ VoIP Provider
On this topic
To make outbound calls on the PSTN you need 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).
Step 1: Requirements for Using a VoIP Provider / SIP Trunk
- A firewall / router / NAT device that supports STATIC PORT MAPPINGS and allows you to switch off SIP ALG. Often routers perform port address translation, which causes 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 are bound to fail. See the Firewall & router configuration for details on how to configure your firewall / router / NAT device.
- Adequate Bandwidth. VoIP is real-time, placing a demand on your internet connection. As a rule of thumb, each call consumes approximately 30-120 kb per second, depending on the codec you use. In Bandwidth overhead over DSL connections you can find detailed information about bandwidth consumption, including bandwidth usage for particular codecs.
Step 2: Create an Account with a Supported VoIP Provider
You need to have an account with a VoIP Service Provider, preferably one that has been tested by 3CX. 3CX supports and includes pre-configured templates for most popular SIP-based VoIP service providers. We strongly recommend choosing from the list of 3CX Supported VoIP Providers.
Step 3: Conduct the Firewall Check
3CX prompts you to conduct a Firewall Check. Frequently, the internet-facing firewall sitting between the 3CX Phone System and the VoIP Provider is not correctly configured or able to route VoIP traffic. To check the firewall configuration, it is important to run the built-in Firewall Checker with these steps:
- Go to the “Dashboard” function in the 3CX Management Console.
- In the “PBX Status” section, click on the “Firewall” entry and click “Run”.
- Ensure that the tests for the SIP port (default 5060), and the Audio port range (default 9000-9255) pass.
- If the Firewall Check fails, you need to check and troubleshoot your firewall.
Note: 3CX does not provide specific firewall configuration support. Configurations for popular firewalls can be found here.
Step 4: Add the VoIP Provider Account in 3CX Phone System
After you have created the VoIP Provider account, you need to configure the account in the 3CX Phone System using these steps:
- 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 the country drop down menu and then choose between “Generic VoIP Provider,” or “Generic SIP Trunk,” (If using a generic provider we are not be able to guarantee that 3CX works 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” to create the SIP Trunk and open a new dialog.
- 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 verify that are 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 is 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 is for calls matching the main number.
- If you have DID numbers, you need to specify these in the DIDs tab. Click on the “DIDs” tab and add the DID numbers associated with this account. The DID is created and linked to the operator extension. You can change this later from the “Inbound Rules” function 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 5: Create an Outbound Rule to Route Calls Over the SIP Trunk
Outbound rules dictate how 3CX routes outgoing calls. Calls can be routed via different trunks (gateways or SIP Trunks) based on who or which group is making the call, the number that is being dialled or the length of the number. You need to create at least one outbound rule to start making outbound calls on 3CX!
Creating Outbound Rules
Now you need to create an outbound call rule and decide what calls should be routed via this trunk:
- From the 3CX Management Console “Outbound Rules” function, select “Add,” and enter a name for the new rule.
- Specify the criteria that should be matched for this outbound rule to be triggered. In the “Apply this rule to these calls” section, specify any of the following options:
- Calls to numbers starting with prefix – Apply this rule to all calls starting with the number you specify. For example, enter 9 to specify that all calls starting with a 9 are outbound calls and should trigger this rule. Callers should dial “9123456” to reach number “123456.”
- Calls from extension(s) – Select this option to define a particular extension or extensions range for which this rule applies. Specify one or more extensions separated by commas, or specify a range using a “-,” for example 100-120.
- Calls to numbers with a length of – Select this option to apply the rule to numbers with a particular digit length, for example 8 digits. This way you can capture calls to local area numbers or national numbers without requiring a prefix.
- Calls from extension group – Rather than specifying individual extensions, you can select an extension group.
- Now specify how outbound calls should be routed. In the “Make outbound calls on” section, select up to five routes for the call. Each defined gateway or provider is listed as a possible route. If the first route is not available or busy, 3CX Phone System automatically tries the next route.
- The alternative outbound routes need to be configured in order for calls to take these routes, when the first is unavailable. By default other routes “Block Calls.”
- You can transform the number that matches the outbound rule before the call is routed to the selected gateway or provider using the “Strip Digits” and “Prepend” fields for each route:
- Strip Digits – allows you to remove one or more digits from the called number. Use this to remove the prefix before a call is dialled on the gateway or provider, if it is not required. In the example above, you would specify to remove one digit, in order to remove the prefix “9” before it is dialled.
- Prepend – allows you to add one or more digits at the beginning of the number if this is required by the provider or gateway.
- If you need to reformat the Caller ID (Caller ID Rewrite), see Caller ID reformatting.
- Click “OK” to add the outbound rule.
- See the Firewall & Router configuration to configure your firewall / router / NAT device.
- Find more about Inbound rules.
- Outbound Rules over the PSTN gateway
- 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.
- To rewrite the Caller ID see Caller ID reformatting
- See our outbound rules – A complete example of how to create outbound rules.
- See how to create extension groups to add to outbound routes.
- Watch the Configuring VoIP Providers / SIP Trunks training video
- Watch the Configuring the Firewall training video
- Watch the Configuring Inbound Routing training video
- Watch the Configuring Outbound Routing training video