Route and price calls by CLI or CLD
An account has one service plan and one routing group, but each of its Authentication Rules can override both. This tutorial uses that to sell a customer two quality levels on the same trunk, chosen by the caller’s number or by a prefix the customer dials, and to block calls the customer should not send. Allow about 30 minutes.
The example account example-telecom sends calls from 203.0.113.10 and already has a Default service plan and routing group. Calls with a CLI starting with 123 or a CLD starting with 444 should get Premium prices and routes; 456 and 555 get Gold.
Before you start
Section titled “Before you start”- The account works with its default service plan, routing group and an authentication rule for its IP, as in Set up a wholesale customer.
- Two more tariff plans, Premium and Gold, with rates for the destinations, and two routing groups with the matching vendors. See Tariffs and Routing groups.
Step 1: Route by the caller’s number
Section titled “Step 1: Route by the caller’s number”- Open My Customers → Accounts, then Actions → Authentication Rules for
example-telecom. - Click Add and enter Remote IP Address
203.0.113.10and Incoming CLI/ANI123*. - Under Advanced Parameters select Tariff Premium and Routing Group Premium.
- Click Save & Close.
- Add a second rule with Incoming CLI/ANI
456*, Tariff Gold and Routing Group Gold.
| Rule | Remote IP Address | Incoming CLI/ANI | Tariff | Routing Group |
|---|---|---|---|---|
| Existing | 203.0.113.10 |
[From Account] | [From Account] | |
| New | 203.0.113.10 |
123* |
Premium | Premium |
| New | 203.0.113.10 |
456* |
Gold | Gold |
A rule with a matching CLI is more specific than the rule with the IP alone, so the switch picks it whenever the CLI matches and falls back to the account’s settings otherwise. Add a CLI Translation Rule such as s/^123// if the prefix must not reach the vendor. See Authentication for how rules are ranked.
Result: three rules for the account; calls are priced and routed by the caller’s number.
Step 2: Route by a dialled prefix
Section titled “Step 2: Route by a dialled prefix”- Add a rule with Remote IP Address
203.0.113.10and Incoming CLD/DNIS444*, Tariff Premium, Routing Group Premium, and CLD Tr. Rules/^444//to strip the selector before rating and routing. - Add the same with
555*, Gold ands/^555//.
Result: the customer selects the level by dialling 444 or 555 in front of the number.
Step 3: Block unwanted calls
Section titled “Step 3: Block unwanted calls”Two rules that send calls to a number that does not exist in any tariff reject them before routing:
- Add a rule with Remote IP Address
203.0.113.10and CLD Tr. Rules/^(\d{,9}|\d{11,})$/BLOCK/. Numbers with fewer or more than ten digits becomeBLOCK, which no rate matches. - Add a rule with Remote IP Address
203.0.113.10, Incoming CLI/ANIanonymousand CLD Tr. Rules/.*/BLOCK/.
Result: calls with a wrong number length or from an anonymous caller are rejected and cost nothing. For long blocklists use Rules & Lists or a DNC List instead.
Step 4: Test it
Section titled “Step 4: Test it”- Open Tools & Debugs → Test Dialplan and set Mode to Not Authenticated Call with Remote Address
203.0.113.10. - Enter CLI
1235550000and a CLD; click Proceed. Result shows the matched Authentication Rule, Tariff Premium and Routing Group Premium. - Repeat with CLI
4565550000for Gold, with a CLD starting with444and555, with an 11-digit CLD and with CLIanonymous.
Result: each case shows the expected rule, tariff and routing group, and the blocked cases return an error instead of a price.
What’s next
Section titled “What’s next”- Authentication: how the switch chooses between overlapping rules.
- Number translation and Translation rule examples.
- Post-authentication rules: rules applied after the account is known.