Enabling Multi-Account Support for SIP Trunks
Introduction
In some cases, a configuration might require multiple trunks from the same provider. However, this might not always be supported by 3CX, due to the way Call Source Identification is performed by the system and the way the VoIP provider is formatting inbound SIP messages. There is though some flexibility in the system to allow multiple trunks from a single provider in some cases. Everything described below assumes a 3CX supported provider is used and added using the default template included in the Admin Console.
It is recommended to first read the Source Identification guide to get a better understanding of how the system matches an incoming call to a trunk.
The Call Source Identification classifications for a supported provider, depending on the authentication type and the formatting of the incoming invite message to the PBX, are:
- Automatic
- Static (Multiple Account Support)
- Static (Single Account Support)
- DID Inbound only
Automatic
This category includes authentication based providers, supporting the “rinstance” parameter. As this value is unique for each trunk you add to the PBX, you can add as many trunks as you want.
This classification of SIP Trunks supports multiple accounts by default.
Static (Multiple Account Support)
Trunks in this category may have Call Source Identification enabled depending on the provider, but the PBX can match incoming calls based on a unique value for each trunk. This is usually the trunk’s Authentication ID included in the incoming SIP messages or a specific value in the RURI (Request-URI).
This classification of SIP Trunks supports multiple accounts by default.
Static (Single Account Support)
Trunks in this category have Call Source Identification enabled in the default template of the provider, under the trunk’s Inbound Parameters with specific values selected. Note that the default values should not be altered.
These values are used by the PBX to match an inbound Invite message to the correct trunk. If two (2) trunks from the same provider are present in the system, then these settings apply for both trunks, thus creating a system conflict.
To allow the system to distinguish each trunk, the "Use both "Call Source Identification" rules and "Caller Number/Name -> CalledNum" field mappings" option must be enabled under the Call Source Identification settings.
With both options enabled, the system uses the defined values to match the incoming call to a trunk and additionally match the called number to a DID specified in the trunk settings.
For this to work, ensure that the DIDs under each trunk of the same provider must be:
- Unique, i.e. the same DID must not exist twice across all of the provider’s trunks.
- In the correct number format, as specified in your provider’s trunk guide under the “Number Format” section.
DID Inbound only
For trunks in this category, Call Source Identification settings are disabled, as the PBX will only match incoming calls to trunks based on DIDs.
Technically, no changes are required to add additional trunks from the same provider to the PBX, however, the DIDs of each trunk must be:
- Unique, i.e. the same DID must not exist twice across all of the provider’s trunks.
- In the correct number format, as specified in your provider’s trunk guide under the “Number Format” section.
Why is this not possible by default?
Based on the above info for the same SIP Trunk classifications, the "Use both "Call Source Identification" rules and "Caller Number/Name -> CalledNum" field mappings" option is required for creating multiple trunks of the same provider.
For these cases, if the DIDs are not unique or the format is incorrect, the call will be rejected by the PBX. This is why this option is not enabled by default for all trunks. By having this option disabled, we allow room for error handling, as calls to DIDs not configured correctly will not get rejected and be routed to the main trunk number destination instead.
Last Updated
This document was last updated on 12 June 2023