We have recently been blessed with a new version of 3CX, version 16. With this version we are given the capability to setup redundant gateways without the need for a secondary trunk and the duplication of DIDs and inbound routes that was necessary with version 15.
Note: At the time this article was written, the newly updated version 16 does not have a working SRV template. If you are attempting to register to the SRV record located at gw.siptrunk.com, your trunk will not register. All SIP traffic must be destined directly to gw1.siptrunk.com or gw2.siptrunk.com.
1. Navigate to the SIP Trunks menu on the left menu column and click "Add SIP Trunk". Select 'US' as the country and 'SIPTRUNK.com' as the Provider. Enter your trunk number in the 'Main Trunk Number' field. Click OK.
2. On the General tab of the trunk configuration, your 'Registrar/Server/Gateway' host should already be populated with 'gw1.siptrunk.com'. Under the Authentication section, enter your Trunk Number as the the Authentication ID and your Trunk Password (found in the SIPTRUNK portal under SIP Trunking --> SIP Trunks) as the Authentication Password.
3. Select the 'Options' tab in the trunk configuration. Under 'Advanced', check 'Alternative Proxy' and enter 'gw2.siptrunk.com'. This will enable failover to our redundant gateway if the zombie apocalypse begins in Atlanta and gw1.siptrunk.com is taken down.
4. Select the 'Inbound Parameters' tab in the trunk configuration. Change the 'CalledNum' parameter from 'To: User Part' to 'Request-Line URI: User Part'. Click OK to save the trunk configuration.
5. Congratulations, your trunk should now be registered with SIPTRUNK! We now need to tell 3CX how to route outbound calls. Navigate to the 'Outbound Rules' menu and click 'Add'. We will be adding 3 separate rules as described below:
For general dialing of 11-digit North American numbers, this route will take the number and route it directly to SIPTRUNK.
For general dialing of 10-digit North American telephone numbers, this route will route dialed numbers with a length of 10 digits and add a "1" to the front of the number. Then it will route to SIPTRUNK. Pay special attention to the "Prepend" column.
For Emergency Calling, this route will take all calls that begin with a "9" and are 3-digits in length. These calls will then be routed to SIPTRUNK.
For International Calling, this route will take all calls that begin with "011" or the International Exit code, and then send that call to SIPTRUNK after stripping the first the digits (011) from the number. Specifically, notice the "3" under the "Strip Digits" column.
6. For inbound call routing, you will first need to obtain DID (Direct Inward Dial) numbers from SIPTRUNK. This can be done in your SIPTRUNK customer portal under SIP Trunking --> Order Telephone Numbers. Once you have at least one DID, navigate to 'SIP Trunks' in your 3CX. Edit your existing SIPTRUNK trunk and select the 'DIDs' tab. Click 'Add Single DID' and enter your DID in an 11-Digit format (i.e. 14045964200) and press enter. Click Ok to save changes.
7. Navigate to the 'Inbound Rules' menu. Click 'Add DID Rule'. Name the rule whatever you'd like, and verify that the correct DID is selected in the 'DID/DDI' drop down. You may then use the 'Route calls to' section to route inbound calls accordingly.