We are often asked to clarify the principle of processing incoming and outgoing Caller ID in 3CX Phone System. In this article we will try to answer this question. In addition, we describe the principle of operation of the function, called the
Dictinctive Ring (distinctive ring). It is infrequently used in modern organizations, because it was replaced by the possibilities of CRM integration. However, for a quick understanding of where the call came from, a distinctive bell can be useful.
Attention! In 3CX Phone System v14 SP3, you can disable the processing of Caller ID in
E164 format (see screenshot below).
Caller ID Incoming Call Processing
To process the incoming Caller ID 3CX, it uses the parameters specified in the Parameters - PBX - e164 interface section.
')

3CX tries to determine the type of call (number) using the parameters specified in the Parameters section - PBX - e164 (see fig.). The system checks the incoming Caller ID from left to right.
How the system determines that the number that came in the international format can be considered local, i.e. Caller ID belongs to the same country in which the system is located?
- Ahead is the + sign, followed by the country code specified in the Parameters section - PBX - e164, or
- Ahead is the international dialing code, followed by the country code specified in the Parameters section - PBX - e164, or
- Ahead is the country code specified in the Parameters section - PBX - e164.
If the system sees that Caller ID
does not belong to the country in which the system is installed, i.e. the number is of type International (international), - no Caller ID processing is performed and it goes to the extension number 3CX. The Distinctive Ringing function (distinctive ring), implemented in 3CX, adds an additional
Alert-info: international header to the call. The user's IP phone will signal according to the settings for
international calls.
If the system sees that Caller ID
belongs to the country in which the system is installed, then the call type is checked again: national (National) or urban (Local). At the same time, if the
Delete option is set
, if in the same country , only the part of the number that does not contain the country code is checked.
If Caller ID comes in a national format, i.e. the region code does not correspond to the region in which the system is operating (specified in the Parameters section - PBX - e164), no number processing is performed and it goes to the internal number. The Distinctive Ringing function adds an additional
Alert-info header to the call
: national . The number comes in with the international part cut off, because the
Delete option has been set
if in the same country. The user's IP phone will signal according to the settings for
national calls.
If the Caller ID starts with
the region code specified in Parameters - PBX - e164, then it is recognized as urban. If the
Delete option is set
, if in the same region, the Caller ID (with the international and national parts cut off) is sent to the extension number 3CX. The Distinctive Ringing function adds an additional
Alert-info header to the call
: local . The user's IP phone will signal according to the settings for
city calls.
Handling Caller ID Outgoing Call
3CX Phone System processes the outgoing number according to
Outgoing Rules , using the digits of the dialed number. In accordance with the matching Outgoing Rule, the desired route is selected (SIP line or gateway).
The 3CX Phone System must explicitly identify which SIP header is the Caller ID. For this:
- Select the required SIP trunk or PSTN gateway
- Go to Outgoing Settings
- Define a SIP field that transmits Caller ID. Caller ID is assigned to the variable OriginatorCallerID.

How is the value of the variable OriginatorCallerID determined?
Initially, the OriginatorCallerID value is undefined. Then the OriginatorCallerID value is set by the
Outgoing Caller ID parameter in the trunk settings.

Then, if the 3CX extension number is assigned an
External Caller ID , it is assigned to the variable OriginatorCallerID.

The following rules apply:
- If the call arrived at the extension as an external incoming number and went out again. In this case, the caller's number outside (which was reformatted in accordance with the parameters specified in the Parameters - PBX - e164) will be set to the OriginatorCallerID variable.
- If the call goes to an external number when the forwarding rule on the extension is triggered, or the call is not made directly from this extension number, the outgoing Caller ID will be overwritten with the value already contained in the OriginatorCallerID field of the incoming call (original call) .
- If the call goes to direct dialing from the extension (i.e., no call forwarding rules are used), the Caller ID is not overwritten and sent as is.
After that, the outgoing Caller ID is reformatted according to the trunk settings.
Formatting incoming and outgoing Caller ID
Starting from 3CX Phone System v.12 SP1, the number of the caller (Caller ID) from the port, trunk, VoIP gateway or VoIP provider can be obtained in the form required by the system administrator. You can also modify the outgoing number, i.e. transmit it to the port / trunk / gateway / provider in the required form.
The formatting of incoming and outgoing caller ID is done uniformly. To make it correct, we explain the principles of formatting the number / replacement string.
- () Brackets - they contain (separated from each other) groups of numbers. Each group is assigned to variable 1, 2, 3 ... 9.
- (. *) - means any sequence of numbers. This line should be specified last, since all numbers and other characters after it will be ignored.
- 0-9, + - Zfra 0-9 and + are used to indicate the matching of the corresponding character in the Caller ID
- (xxx) -, where x is any digit in the range 0-9. For example, if the number is transmitted 0203123456 and you specify (0203), 3CX will search for a string that exactly matches 0203.
- (.) - dot - replaces any character. For example, specifying (...), you force 3CX to look for any 3 digits in the number. So, if the area code starts with 3 and contains 3 digits, you can specify (3 ..)
- 1, 2, ... 9 - these lines are replaced by the contents of variables 1, 2, ... 9

To configure Caller ID, follow these steps.
- Go to the SIP trunks or PSTN gateways section and select the port or trunk you want to configure
- Click the port you need, select the Other options section on the right.
- In the Change Caller ID section, you can configure the necessary rules for incoming and outgoing Caller ID
- You can configure multiple rules at the same time, and a higher priority rule will take precedence.
Examples
1. The company requires that all international American numbers be reformatted to a local format. In this case, a simple rule is enough.
Source CID Pattern + (1) (...) (. *)
New Source CID Pattern 3
In this example
+ deleted (ignored)
(1) corresponds to the country code of the USA and is passed in the first variable 1
(...) corresponds to the three-digit city code and is transmitted in the second variable 2
(. *) corresponds to the remaining digits of the number and is transmitted in the third variable 3
In our example, in the new reformatted number we leave only the third variable 3, which corresponds to the local number.
It was +12021234567,
it became 1234567.

2. The company needs to bring the number to the national format and add 0 at the beginning of the number for a quick call back to the client. Incoming Caller ID has the following form: +17864722245.
Source CID Pattern + (1) (...) (. *)
New Source CID Pattern 023
In this example
The number 0 is added to the beginning of the number.
Variables 2 (786) and 3 (4722245) are saved, leading the number to the national format.
It was
+17864722245 , became
07864722245 .
