In order to adjust to market conditions, telecom vendors in many countries have started charging different prices for calls to the same destination based on where the call originates. For example, a vendor might charge $0.10 per minute for calls to a mobile number in Turkey originating from Canada, $0.30 from Morocco, and $0.50 from Algeria. Typically, there is a standard base price for a specific destination, with additional surcharges applied for calls originating from specific countries or networks.
PortaSwitch supports tariffs that can include multiple pricing options for each destination based on the country or network from which a call originates. Such tariffs offer standard prices per destination, with the possibility to either add a surcharge to the standard price or replace it with a new origin-based price if the caller’s number matches a specific rate code group. This feature enables accurate cost calculation for calls routed through vendors that use origin-based rating. You can also pass these costs on to your customers and resellers by configuring the corresponding tariffs for them.
Say a vendor, GlobalNet, charges a standard price of $0.10 per minute for terminating calls to +90530 (Turkey-Mobile Turkcell). However, GlobalNet adds a surcharge for calls originating from:
- +212 (Morocco): $0.20 surcharge
- +213 (Algeria): $0.40 surcharge
Owl Telecom, a service provider working with GlobalNet, receives a file with these rates and surcharges and adds them to its system. To ensure profitability when routing calls to Turkey via GlobalNet, Owl Telecom also adds its own surcharges on top of the standard customer price ($0.15):
- +212 (Morocco): $0.25 surcharge
- +213 (Algeria): $0.45 surcharge
If a call is made to +905303334567 (Turkey-Mobile Turkcell) from +2132221234 (Algeria), the per-minute price is $0.60 ($0.15 standard rate + $0.45 surcharge). If the call originates from any other region without defined surcharges in the customer tariff, such as +12045557890 (Canada), the price remains at $0.15 per minute.
Service providers can ensure profitability while working with vendors that apply additional charges based on the call’s origin.
Specifics
- If origin-based charges are set up in a reseller/customer tariff and the call origination number is defined, the reseller/customer will be charged according to their tariff, even if the call is terminated by a vendor for which the additional origin-based pricing is not configured.
- When origin-based charging is used, marking only the basic rate as Forbidden is not sufficient to block calls. If the caller’s number matches a rate code within an origination code group defined for an extra rate that is not marked as Forbidden, the call is still allowed. To ensure calls are rejected, mark both the basic rate and the origin-based extra rates as Forbidden. To reject calls when no CLI is received, follow these steps.
How it works
To enable origin-based rating, destination and origination rate codes should be organized into two separate Code group sets. In each Code group set, the codes are grouped according to specific geographic regions or networks. For example, a rate code group may include all prefixes for Turkey-Mobile Turkcell (from 90530 to 90539 and 90561), for which the same standard price will apply.
For each Code group set, you also need to select the corresponding Rate match mode – this tells PortaBilling how to interpret the prefixes in the set:
- To match called numbers (CLD) against code groups – use Destination mode
- To match caller’s numbers (CLI) against code groups – use Origination mode
Then, when creating an origin-based tariff, you need to:
- Assign a destination Code group set as default – this allows you to define a base price per destination code group.
- Define a Price selection rule
This rule:
- Links the tariff to the origination Code group set
- Specifies how to apply origin-based pricing:
- Add a surcharge to the base price, or
- Replace the base price with the origin-based price
You can either create a Price selection rule directly in the tariff or create a centralized rule under Service catalog > Price selection rules to reuse across multiple tariffs.
A rate in the tariff will then include:
- A “destination” code group and the corresponding base price.
- A list of “origination” code groups, each with either:
- a surcharge to be added to the base price, or
- a replacement origin-based price.
When a call is processed, PortaBilling determines the applicable rate in the following way:
- Destination matching
The system first matches the called number (CLD) against the rate codes defined in the default Code group set (with Rate match mode = Destination). The result of this match determines the basic price for the call.
- Origination matching
Next, the system checks the caller’s number (CLI) against the rate codes in the Code group set (with Rate match mode = Origination) defined within the Price selection rule.
- Applying the final charge
Based on the configuration in the Price selection rule, the system either:
- Adds the origin-based surcharge to the base price, or
- Replaces the basic price with the origin-based price.
If no matching origination rate code is found, the system applies the base price.
Configuration
You can manage origin-based rates by uploading and downloading rate decks from/to a file (.xlsx or .xls), just like with standard rates.
To configure the tariffs as described in the example, perform the following steps:
- Configure a Code group set for matching destination numbers (CLD):
- Navigate to Service catalog > Code group sets > click Add and fill in the details:
- Add Rate code groups, such as “Turkey-Mobile Turkcell,” with the corresponding phone prefixes (rate codes).
If you plan to upload the rate deck from a file, you don’t need to manually add all code groups with their corresponding prefixes – the system will automatically import them from the file. Just create one code group to make the set available for assignment (otherwise, the system will treat it as “draft”).
- Configure a Code group set for matching origination numbers (CLI):
- Navigate to Service catalog > Code group sets > click Add and fill in the details:
- Add Rate code groups, such as “Algeria” and “Morocco” with the corresponding phone prefixes (rate codes).
If you plan to upload the rate deck from a file, you don’t need to manually add all code groups with their corresponding prefixes – the system will automatically import them from the file. Just create one code group to make the set available for assignment (otherwise, the system will treat it as “draft”).
- Create a vendor tariff:
- Navigate to Service catalog > Tariffs > click Add and fill in the details:
- Name – specify the tariff name
- Currency – the currency in which the vendor charges you, e.g., USD
- Service – select Voice calls
- Applied to – select Vendor (enable the Routing option for the vendor tariff)
- Define prices – select Per code group (supports CLI+CLD rating)
- Group set – select the “Destination” code group set created in step 1.
- Within the created tariff, navigate to Price selection rules, click Add, and fill in the details:
- Name – specify the price selection rule name, e.g., “Add surcharges based on CLI”
- Service – this displays the service selected for the tariff (Voice calls)
- Type – select Peak/Off Peak
- Code group set – select the “Origination” code group set created in step 2.
- Handling extra rates (if any) – select Add extra rates to basic rates as a surcharge
- Navigate to Service catalog > Tariffs > click Add and fill in the details:
- To manually add a rate to the vendor tariff, navigate to Rates, click Add, and fill in the details:
- General configuration:
- Code group – select a “destination” code group, e.g., “Turkey-Mobile Turkcell”
- Price selection rule – select the price selection rule created in step 3.b.
- Basic rate:
- Switch to the Extra rates tab and specify the surcharges:
- General configuration:
- Assign the vendor tariff to a vendor connection.
- Create the customer tariff, as described in steps 3-4, and assign it to the customer product.
How to configure a tariff to reject calls if no CLI is received
In some cases, PortaBilling receives calls without a valid CLI, e.g., when the caller intentionally hides their number or the CLI is stripped along the call path. When CLI information is missing, PortaBilling cannot determine the call’s origin and apply the correct origin-based rate, so PortaBilling falls back to destination-based rating.
Typically, such calls are rejected to prevent potential fraud or revenue leakage.
To reject calls if no CLI is received, perform the following steps:
- Add a special “!” rate code to the system. Navigate to Service catalog > Rate codes, click +Add, and fill in the details:
- Open the “origination” code group set and add a “No CLI received” code group.
- Add the “!” rate code to the “No CLI received” code group.
- When setting the extra prices in the origin-based tariff, add an entry with the “No CLI received” code group and select the Forbidden checkbox.
When preparing a CSV rate deck to upload into PortaBilling, you can include extra rates for the “No CLI received” code group and set Y in the Forbidden column to mark them as forbidden.











