Caller Line Identification (CLI)¶
Document Metadata
Category: Customer Account Management / CLI (Caller Line Identification) Configuration
Audience: Administrators, Engineers, Support Team
Difficulty: Intermediate to Advanced
Time Required: Approximately 45–90 minutes
Prerequisites: Active ConnexCS account with access to the
Customer → Routing → CLI section (or equivalent) and basic understanding of SIP headers (From, P-Asserted-Identity) and regular expressionsRelated Topics: Customer – Routing, CLI & ANI Concepts for VoIP
Next Steps: Allow Customers to Add Their Own CLI, Advanced CLI Match & Manipulation
Management Customer [Customer Name] Routing
Overview¶
CLI (Caller Line Identification), aka ANI (Automatic Number Identification), is the From header in SIP. It represents the sender's number in a telephone call. It's the technical term for the mechanism we know as Caller ID.
In VoIP systems, CLI is more than just a way to display the number of incoming calls. It's used as a defense against unidentified call attempts.
CLI provides information to sort incoming calls. It's an important component of billing.
In ConnexCS, CLI lets you restrict and manipulate CLIs and P-Asserted Identity on customer calls so that any caller without a valid match gets rejected instantly.
It's also referred to as the A-number or A-leg, representing the incoming call to the switch. The B-number, or B-leg, is the dialed number, representing the outgoing call from the switch.
How's CLI derived?
CLI refers to the CLI/ANI field in the From part of the SIP INVITE message. This contains specific information about the caller.
The information contains the name and number of the person starting the call. Also known as "Caller ID" in standard phone systems, CLI is also referred to as "A-Leg" or "A-Number."
It's where the call originates. The call is then terminated at the Dialed Number, the "B-Leg" or "B-Number."

Key Features & Benefits¶
-
Granular Control: Define which CLIs can pass through the system.
-
Security & Compliance: Restrict unauthorized calls based on CLI rules.
-
Pattern Matching: Utilize regular expressions to allow or block specific CLIs.
-
Forced CLI Assignments: Ensure calls use predefined numbers when necessary.
-
Directional Routing: Apply rules to both inbound (origination) and outbound calls.
CLI Routing Rules¶
- Default Behaviour
By default, a customer account will pass all calls, even with no configured CLI records. To change this behavior, navigate to Management Customer [Customer Name] Edit Verification and enable Approved CLI's Only.
Approve CLI override
Once you enter the first CLI rule, the behaviour changes to block all, regardless of the "Approved CLI's Only" setting.
CLI verification tool
Besides changing the default behaviour to block, adding a CLI rule gives customers the ability to verify their own CLIs from their Control Panel through a callback system.
A customer can login to their portal and enter a phone number that should belong to them. The ConnexCS system will place a call and give a code that must be entered into the portal. If the codes match, the CLI is then added.
Summary
- By default, if CLI restrictions aren't enabled, all incoming CLIs are allowed and passed through the system without filtering.
2.CLI Allow List
- If a single CLI is added to the list, only that specific number is permitted.
- If multiple numbers exist in the list, only those numbers can pass.
- Calls using a CLI not in the list will be blocked with a "CLI restriction in effect" message.
3.Forced CLI
- When a "Forced" CLI is set, any call that doesn't match an allowed CLI will be assigned the forced CLI.
- If a caller uses the forced CLI as their A-number, the call will pass through normally.
- If multiple forced CLIs are set, the system typically applies the first listed option.
Creating a Record¶
Click under CLI.
Field details:
-
CLI: To allow the required CLIs, enter the required number or a regular expression (to match and replace).
-
Rewrite CLI: A CLI can be rewritten. For example, you can add
123456789in the CLI box and then rewrite by adding987654321in the rewrite CLI box. (For more advanced CLI manipulation, see Advanced CLI Match & Manipulation below.) -
Rewrite P-Asserted-ID: This is a SIP Header almost same as the FROM header but classified as a private, or network-level identifier. Telephone companies use it to identify call originators. As it's stripped at the call server, the client end-points only see the FROM field. This is helpful when callers obscure their CLI / FROM information, as the network level still requires origination details. The P-Asserted-ID manipulation uses the same syntax as the Replace CLI.
P-Asserted-ID Use Case
If you wanted to allow all calls but assign a specific number (such as the Main Billable number for the business), you would set CLI as ".*" and then enter the desired P-Asserted ID. All calls will then have this number as the P-Asserted-ID.
-
Forced: Enabling this will allow a call if there are no other matching CLIs in the system. This will also replace the CLI that's presented with the CLI entered here.
Example
Create a permitted list of CLIs, then select Forced on the CLI to use if none of the others in the permitted list match. (Best practice is to have one unique Forced CLI.)
-
Direction Applied:
- Outbound Calls (Termination): Customer dials a number; CLI rules control which caller IDs are allowed to pass.
- Inbound Calls (Origination): Calls coming into the system (DID/DDI) can be filtered based on CLI rules.
Example
- Create a permitted list that exclusively allows calls to or from the same country.
- Only allow incoming calls with a CLI starting with 44 (UK numbers).
-
Allow Type: You can select from various options like Mobile, Paging, VoIP, Satellite etc to allow the CLIs. Click here to know about Destination Type Lookup & Fallback Logic — USA and International
-
Use DID: Pull in DIDs from the customer's account to use either as a Filter or as a Replacement.
Example
If Dialled matched number is starting with 1, the CLI routes to 11111.
The CLI can be a Regular Expression also.
-
Database (To add CLI and PAID from a database):
- Create a Prefix Set with the Database flag turned on under Setup > Advanced > Prefix Set, and add the numbers you want to use as CLI or PAID.
- Go to Customer > Routing > CLI add the same database under database field. Under rewrite PAID field add this database.
Note
Make sure you select the Forced option as Yes.
-
Dialed Number Match: To route to a specific CLI, you dialled match number.
CLI per Route
If a
Tech Prefixis specified in Routing (Ingress Routing Basic Tech Prefix) and the sameTech Prefixis added to theDialed Number Match(using ^), the corresponding CLI rule will be applied to that specific route. -
Notes: Notes give you information about the CLI.
-
STIR / SHAKEN Certificate: If you apply any STIR / SHAKEN Certificate to a customer's account for calls verification, for example, whether the calls are spam.
- STIR / SHAKEN Attestation: This is the level of a certification you can select from 3 levels
A,B, orC.
- STIR / SHAKEN Attestation: This is the level of a certification you can select from 3 levels
-
Flags:
- Performance CLI Selection: When you select Forced as Yes and select a Database, you get an option to select a flag which is Performance CLI Selection. The Performance CLI Selection chooses the CLI with the best ASR
- Stir Shaken Required: Choose this option when no certificate is selected.
- Stir Shaken Replace: Choose this option when you wish to apply your Stir-shaken certificate instead of which is already applied (for a call).

- Click
Saveto complete the CLI configuration.
Allow Customers to add their own CLI¶
Navigate to Management Customer [Customer Name] Edit Verification and select the "Approved CLIs Only" checkbox.
The customer can then go to the Customer Portal CLI section and add numbers there.

Advanced CLI Match and Manipulation¶
Filter Examples¶
The customer can choose which numbers to permit for origination of the calls by configuring a number as a CLI in ConnexCS.
Any number configured as a CLI is a part of the permitted list (unless you use extra settings to block it).
Filter CLI by Number¶
Block all calls that don't have the CLI "123456789":
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
123456789 |
No | Disabled | None |
Allow various CLIs to pass (by entering 2 or more records):
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
123456789 |
No | Disabled | None | |||
987654321 |
No | Disabled | None |
Filter CLI by Pattern¶
Allow a range of numbers for a customer (this example allows all calls that start with 123456 to pass regardless of the last digits):
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
^123456 |
No | Disabled | None |
You could also use a more complicated expression to match various ranges.
In this example, the number must start with 123456, followed by 1, 3, or 5, then followed by 1 or 2 numbers.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
^123456[135][0-9]{1,2}$ |
No | Disabled | None |
This can work in combination with number lists as well.
Filter CLI by DID¶
If your customers do origination as well as termination, they already have a list of DIDs. Select Filter from "Use DID" to automatically read from the list of DIDs.
Note that you can still add more CLIs along with the DID list.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
| No | Filter | None |
Filter P-Asserted-Identity by Number or Pattern¶
The same is true for P-Asserted-Identity (PAID) as it's with CLI; you can filter by PAID, as in this example.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
123456789 |
No | Disabled | None | |||
^123456[135][0-9]{1,2}$ |
No | Disabled | None |
Combined CLI and P-Asserted-Identity Filter¶
Filters are AND together, meaning that for a call to pass in this example, the CLI would need to be 1122334455 AND the P-Asserted-ID would need to be 123456789.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
1122334455 |
123456789 |
No | Disabled | None |
Filter CLI from a Large List¶
To manage large lists of numbers, create a Prefix Set with the Database flag turned on and add the numbers to it. See Prefix Set – Number database.
You can use the following options to filter by the uploaded list. Note that the filter is a partial match.
| P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|
| No | Disabled | [My Database] |
Filter CLI by Number Type¶
Filtering by Number Type will block calls that originate from a "type" that you specify; this can be something such as FIXED, MOBILE, etc.
| P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Block Type |
|---|---|---|---|---|---|
| No | Disabled | FIXED |
Replace Examples¶
We can also entirely replace the transmitted CLI.
Note that if a replacement occurs, it means that the match was successful and its allowed to pass through.
Direct Replacement¶
Replacing a 111111111111 with 222222222222.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
111111111111 |
222222222222 |
No | Disabled | None |
Pattern Replacement¶
Replace all calls that begins with a 1 with 222222222222
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
^1 |
222222222222 |
No | Disabled | None |
Force CLI¶
When choosing Force CLI, if there is no match present, the CLI marked Force can replace the CLI transmitted on a call.
In the example below, the CLI 111111111111 is sent regardless of what CLI the customer sends.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
111111111111 |
Yes | Disabled | None |
In the following example, if the customer sends a call with 222222222222, the call gets allowed to pass through, but if the customer were to send 333333333333, the call gets replaced by 111111111111.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
111111111111 |
Yes | Disabled | None | |||
222222222222 |
No | Disabled | None |
Pick CLI at Random¶
You can add various CLIs that forcefully select a random CLI.
In this example, approximately 50% of the calls are sent with 111111111111 and 50% with 222222222222 (provided the customer doesn't send either of those two, otherwise the results would be same).
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
111111111111 |
Yes | Disabled | None | |||
222222222222 |
Yes | Disabled | None |
Large Numbers of Random CLIs
To pick from a large list of CLIs while spreading usage evenly across every number, use CLI Pool (Pooled Usage).
Pick CLI from DID¶
This example shows how to pick a DID already associated with the customer at random for use as the CLI.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
| Yes | Random | None |
Pick CallerCLI from DID with Longest Match¶
You may wish to perform CLI Localization.
For example, if you have various DIDs (in this case, 123456, 123567, and 123789) and are placing a call to 1234987654, the system will find the longest match (in this case, 123456)) to use as the CLI.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
| Yes | Prefix Match | None |
Pick a CLI from a Large List¶
Our Prefix Set DB allows you to manage large lists of numbers. Once you upload the numbers, you can use the following options to choose a number at random.
| P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|
| Yes | Disabled | [My Database] |
Performance based CLI Selection¶
The Performance based CLI Selection chooses the CLI with the best ASR from a large list or a database.
This feature's objective is to allow customers to utilise the best performing CLIs.
How does this algorithm work?
- If the CLI database contains more than 1000 records, the system randomly selects 1000 Direct Inward Dialing (DID) numbers. From these 1000 DIDs, the system identifies the best-performing ones based on ASR.
- ASR lookup is initiated, and the ASR requires at least 50 calls per CLI ( in last 7 days) to be considered valid. If there are fewer than 50 calls for a CLI, the system assigns it an ASR of 50%.
- The number of top-performing CLIs selected is determined by the Performance Top Batch Size setting. These top CLIs are selected for use based on the Performance Interval setting, which dictates how long this batch remains active.
Steps to use Performance CLI Selection
- Navigate to Management Customer [Customer Name] Routing CLI (blue
+button). - Select Yes for the Forced field.
- Select a Database.
- From the drop-down next to Flags select Performance CLI Selection.
- Performance Top Batch Size choose how many of the top CLIs we use together.
- Performance Interval: Choose from the dropdown how long this batch stays active(in seconds). You can choose from the minimum value of 5 minutes and maximum value of 1 day with intervals of 300 seconds.
- Performance Ban Time: How long a used DID is paused for. You can choose the value from the dropdown with minimum value being 5 minutes and maximum value being 90 days. The value is stored in seconds.
- Click
Save.
Deterministic Sequential CLI Persistence¶
This feature allows a CLI to be chosen from a database and used for a specific period of time before it's rotated to the next CLI in the list.
The CLI selection is TIME DETERMINISTIC. It means that the system chooses a CLI and that CLI will be used for the specified time by the customer and later each CLI is executed sequentially and for the same specified duration.
How to use Deterministic Sequential CLI Persistence feature¶
- Navigate to Management Customer Customer [Name] Routing CLI blue
+button. - Select Yes from drop-down menu for the Forced field.
- Select the Database you wish to choose the CLI from. It will then automatically pull in numbers from the database and forces it to set as CLIs. (This feature already exists).

4.Follow steps 1 and 2.
5.Navigate to Management Customer Customer [Name] Edit Config VarsTOML and write the below code:
1 2 | |
Note
You can keep the value of CLI persist according to your requirements. For example, if you require CLI to be used of 10 minutes then keep the persist value as 600.

Example
Envision a scenario with a database containing 10 CLIs, where the customer specifies that each CLI should remain active for precisely 10 minutes. By setting the persist value to 600 seconds (10 minutes), the system will follow this sequential pattern:
- Activate CLI 1 for the initial 10 minutes
- Transition to CLI 2 for the subsequent 10 minutes
- Continue sequentially with CLI 3 through CLI 10, each active for the next 10 minutes
After all 10 CLIs complete their respective 10-minute cycles, the system seamlessly returns to CLI 1, initiating another 10-minute period. This cyclic pattern repeats consistently.
CLI Pool (Pooled Usage)¶
CLI Pool (Pooled Usage) makes sure every number in a CLI or DID list is used once before any number is used a second time, while still picking numbers at random.
You can upload a list of CLIs or DIDs, and a forced CLI rule picks one number from that list for every outbound call.
The existing strategy is stateless uniform random selection: each pick is independent, with no per-number usage tracked across calls.
Pooled Usage adds a stateful, usage-aware selection strategy alongside it. It's enabled per forced CLI rule with the Least Used Pool flag and is evaluated together with the existing hit_limit and hit_interval constraints.
It targets high-cardinality number lists where the expected calls per number per period is low.
Example
A 150,000-number list constrained to at most 5 uses per number per 24-hour interval has a ceiling of 750,000 calls per day.
Why Pooled Usage scales to large number lists¶
Random selection works well when each number gets many calls, and breaks down when each number should get only a few.
Small list, many calls: With 5 numbers and 1,000 calls, each number gets about 200 calls: one might get 198, another 203. The spread is small compared with the average, so the list is used evenly.
Large list, few calls per number: With 150,000 numbers and a target of 5 uses each per 24 hours, the system makes about 750,000 calls a day. Each call has a 1 in 150,000 chance of picking any given number. Random picking reuses some numbers many times while others are never picked at all, so the per-number target cannot be met.
The existing CLI hit limit stops a number being used beyond its limit, but it still relies on random selection to choose which number comes next. Pooled Usage fixes the selection itself.
How Pooled Usage works¶
Pooled Usage keeps the pick random, but only among the numbers that have been used the least so far.
Think of the list as a set of pools, one per usage level. Every number starts in the "used 0 times" pool. Each call picks a random number from the lowest pool and moves it up one level. Only when that pool is empty does the next call draw from the "used once" pool, and so on.
flowchart TD
A([New outbound call]) --> B["Start at the lowest pool<br/>(used 0 times)"]
B --> C{"Does this pool<br/>have numbers?"}
C -- No --> D["Move to the next pool<br/>(used once, used twice, ...)"]
D --> C
C -- Yes --> E[Pick a random number from the pool]
E --> F{"Under the hit limit<br/>for this period?"}
F -- Yes --> G[Move the number up one pool]
G --> H([Place the call with this CLI])
F -- No --> I{"Any other number<br/>under the limit?"}
I -- Yes --> E
I -- No --> J(["Reject the call<br/>405 CLI Hit Limit Reached"])
The result: every number is used once before any is used twice, every number twice before any is used three times, and so on.
For each call:
- Find the pool of least-used numbers.
- Pick one number at random from that pool.
- If that number has already reached its hit limit for the current period, try a few more at random, then check the rest of the pool (and the pools above it) in order.
- Count the use, confirm the number is still in the list, and place the call with it.
New numbers added to the list start at the same level as the least-used numbers, so they join the rotation without taking every call until they catch up. Removed numbers are never returned: the system checks a number still exists before using it.
When a new period starts (for example every 24 hours), the per-period counts reset and all numbers become available again. The overall usage order is kept across periods, so the rotation stays even over time.
How to use this feature¶
You turn on Pooled Usage by adding a forced CLI rule to the customer's routing and selecting the Least Used Pool flag.
- Go to Management Customer Customer [Name] and open the customer.
- Open the Routing tab.
- In the CLI section on the right, click
+to add a CLI rule. - Set Forced to Yes and choose the Direction Applied (for example, Termination).
- In Database, pick your number list from under Prefix Set Database (for example,
Test). To create the list, see Prefix Set – Number database.
- In Flags, select Least Used Pool.

- Optionally set Hit Limit (the most times one number may be used per period) and Hit Interval (the length of the period).
- Click Save.
Configuration¶
Pooled Usage is switched on per rule and works with the existing CLI hit limit and interval settings.
| Setting | What it does | If left empty |
|---|---|---|
Selection strategy (Pooled Usage / LEAST_USED flag) |
Turns on pooled selection for the rule. Applies to forced number lists, and to DIDs set to Random (or Performance when it falls back to random). | The rule keeps the existing random pick. |
CLI hit limit (hit_limit) |
The most times one number may be used in a period. | Numbers are still chosen evenly, but nothing stops a number being reused. Set a very high value for effectively no limit. |
Interval (hit_interval) |
Length of a period, in seconds (e.g. 86400 = 24 hours, 172800 = 48 hours). Periods start on fixed boundaries, e.g. on the hour for 3600. | 24 hours. |
| Number list | A CLI number list, or the customer's DIDs. Rules that use the same list share its usage counts. | Not applicable. |
Capacity per period = hit limit × number of numbers in the list. A 150,000-number list with a limit of 5 per 24 hours can serve up to 750,000 calls a day.
When the pool is exhausted¶
Once every number has reached its hit limit for the current period, further calls are rejected with 405 CLI Hit Limit Reached. The system does not fall back to reusing numbers over the limit.
Before rejecting, it checks for any part of the list it has not read yet and tries once more. Numbers become available again when the next period starts.
To avoid rejections, do one of the following:
- Raise the hit limit.
- Add more numbers to the list.
- Shorten the interval.
Choosing a strategy: Random or Pooled Usage¶
Use Pooled Usage when each number should get only a few calls per period; keep Random when each number gets many.
The deciding figure is calls per number per period = calls in the period ÷ numbers in the list.
| Situation | Use | Why |
|---|---|---|
| A hit limit is set | Pooled Usage | Only a counted pick can enforce the limit exactly. Random can overshoot when calls arrive close together. |
| No limit, fewer than ~2 calls per number | Pooled Usage | Random leaves a large share of the list unused (at 0.5 calls per number, about 61% is never used) while reusing others. |
| No limit, ~2 to ~20 calls per number | Either | Random still leaves some numbers unused and usage varies noticeably between numbers. |
| No limit, more than ~20 calls per number | Random | Usage evens out on its own (within about ±22% of average), with nothing extra to store. |
Pooled Usage is slightly less random than Random: a number cannot come up again until every other number has been used. It is also somewhat slower per call.
FAQ and known limitations¶
Once all numbers are used up, does it start reusing them?
No. Calls are rejected with 405 CLI Hit Limit Reached until the next period starts.
I added numbers but they are not being used yet.
The list is re-read in the background about every 15 minutes. New numbers then start at the lowest level and are used soon after.
I removed a number but it came up once more.
It cannot be used: the system confirms the number still exists before placing the call, and picks another if it does not.
Does the limit reset at an exact moment?
Periods start on fixed boundaries. A number used just before a boundary and again just after can be used up to twice the limit within a short span. Within one period the limit is exact.
Is it slower than Random?
Somewhat, since each call runs a counted pick.
Manipulate CLI¶
Sometimes it can be useful to keep all or part of the transmitted CLI and manipulate it when it gets sent out.
Are you Normalizing?
Normalizing is the process of using a common number format. For ConnexCS, this is the international format.
You shouldn't be using CLI Manipulation to correct the format of a number.
Parameter Rewrite (see Number Manipulation for details) will help achieve this.
Regex Pattern Examples¶
CLI Pattern Matching with Regular Expressions
Regular expressions (regex) can be used to define complex CLI rules:
Example
- If a customer sends a call where the CLI starts with a
9we can strip it out and replace it with a44. So,9123456789will become4423456789.
Use regex anchors (e.g., ^ for start, $ for end) to precisely control matching logic.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
^9(.*)$ |
44$1 |
No | Disabled | None |
This may be a little complicated, so we can break this down:
^is a start anchor, which means that we start the match at the extreme left.9is the literal digit 9.(and)represent a match group, everything matched within it's placed in the variable$1.$is an end anchor and it means that we finish the match at the extreme right.
In the Rewrite CLI section, 44 is the literal 44 digits, and $1 will contain what it has matched in the previous stage.
Use PAID as CLI¶
You can use all or part of a sent P-Asserted-Identity as the CLI. The following example shows how to capture them all.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
.* |
^(?<paid>.*)$ |
$<paid> |
No | Disabled | None |
Besides the matched group as above, we've the expression (?<paid>.*). Here, paid represents a variable which stores this information, and it's then available in the CLI rewrite scope as $<paid>.
Variable Scope
Numbered groups (For example, $1, $2) will only be read from the CLI and will be available in the CLI rewrite or in the P-Asserted-Identity Rewrite. You can read and use Named groups anywhere.
Manipulate P-Asserted-Identity¶
Manipulate the P-Asserted ID similarly to how we manipulated the CLI. In this case, we must use named groups and still have to match the CLI to allow the call to pass. As before, 9123456789 in the P-Asserted-Identity will become 4423456789.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
.* |
^9(?<paid>.*)$ |
44$<paid> |
No | Disabled | None |
Use CLI as PAID¶
If we want to use the CLI in the P-Asserted-Identity it's a little easier as we can just use the numbered group.
| CLI | P-Asserted-ID | Rewrite CLI | Rewrite P-Asserted-ID | Forced | Use DID | Prefix Set DB |
|---|---|---|---|---|---|---|
^(.*)$ |
$1 |
No | Disabled | None | ||
$0 |
No | Disabled/Filter | Select a database | |||
\0 |
No | Disabled/Filter | Select a database | |||
<db> |
Yes | Select a database |
How to Invert a Regular Expression¶
This will BLOCK all USA Freephone numbers
^((?!^1(800|833|844|855|866|877|888)).)*$
Additional Examples¶
The CLI system uses Regular Expressions to match and replace numbers. Here are some examples:
| Number | CLI | Replace CLI | Description |
|---|---|---|---|
| 123456789 | ^1234 | Allows only numbers starting with 1234 to pass | |
| 123456789 | 789$ | Allows only numbers ending with 789 to pass | |
| 12345678912 | ^[0-9]{11,12}$ | Allows only numbers with 11 or 12 digits to pass | |
| +123456789 | ^\ +([0-9]+)$ | \1 | Remove the leading + |
| 01782123456 | ^0([1-9]+)$ | 44\1 | Remove the leading 0 and replace it with 44 |
To learn more about writing regular expressions, visit RegExr. It includes tutorials and exercises available for all levels of expertise.
Allow list numbers per provider¶
Use CLI Restrict to allow CLIs to pass through a specific provider. To allow a configured CLI:
- Click Management Rate Card.
- Select the Provider Rate Card (under the Name column).
- Select Properties Advanced.
- Enter the CLIs / ANIs you want to allow in the CLI Restrict box.
- Click
Save.
Note
You can now use DID options (Performance, Prefix Match, or Random) on a single CLI.
General Condition 6 (GC6) Compliance¶
ConnexCS is GC6 compliant for end users, which:
requires Communications Providers (CPs) to provide CLI facilities and ensure that the CLI Data provided with a call includes a valid, dialable telephone number that uniquely identifies the caller." For details on this General Condition, including guidelines for "valid" and "dialable" numbers, see OFCOM's Guidance on CLI Facilities.
To set the "P-Asserted-ID" per customer, see Configure CLI above.
CLI and PAID Responsibilities¶
- If the customers don't offer any CLI, you can add a CLI list but make sure its validated.
- The customers can partly modify the format of CLIs, to make it more compliant.
- If a customer isn't complaining, you can allocate a PAID from YOUR OWN list of CLI's, which can help you trace the calls.
- You shouldn't delete any information but you can fix the syntax or format.
- You shouldn't present any invalid / false information.