Routing Info - LCR Blending

Create a Report

Behind the Web Interface

How to Manage LCR Blending Reports

When & How to Use


In a multi-carrier environment where every termination partner offers different prices for the same destinations, it can be a challenging task to come up with a proper (profitable) price list for your resellers and customers. This is because you have to consider the price of every carrier while deciding how, exactly, to charge end customers. Further, you might use different routing plans for different products, requiring precise pricing in order to avoid losses on cheap calls via expensive premium vendors. So it all seems like a less than easy task. PortaBilling®, however, incorporates an LCR blending report tool, which is just what you need for dealing with these issues.

NOTE: This type of report is available for root and admin users only.

The Goal

The ultimate goal is to analyze available routes, calculate the average termination price for each destination, and then use this as a basis for computing the rate for a given customer. The most important step is to “blend” the prices of different vendors according to a realistic scenario. For example, if there are three available carriers for destination 4471, with rates of $0.12, $0.18 and $0.30 per minute, respectively, calculating an average cost (0.12 + 0.18 + 0.30) / 3 = 0.20 would be incorrect, since it assumes that each of these carriers gets an equal share of traffic. Since you are using a real-time routing engine within PortaBilling®, you are using least-cost routing and other features so that the cheaper carrier gets more calls, thus increasing your revenue. As a result, the cheaper carrier’s rate has a greater effect on the average termination price.


Therefore, routes are assigned “weight” parameters, where the weight reflects the share of calls going to this route compared to other routes. In our example above, we may assign a weight of 80 to the first route, 15 to the second, and 5 to the third (thus assuming that calls are distributed 80% / 15% / 5% among the three vendors). As a result, the average termination price is $0.138 per minute.

Create a Report

You can easily access this type of report from the main page of the web interface – just follow the Custom Reports link:


1.      On the Custom Reports management page, click add Add.

2.      Select the “Routing info – LCR blending” report type, then click  Save.


Create a report


3.      Once the report type is saved, new configuration options are available – “Input Parameters” and “Output Data”:


Specify imput parameters


Specify output data


Let’s have a closer look at the input & output parameters we can configure:

List of Input Values:



Range of values


Routing plan


Available routing plans; “All available routes” by default

Produce a routing list according to the specified routing plan.

Use only Destination Prefixes


Destination pattern

The available options are:

·  Matching the Pattern – Produces a routing list only for a specific destination, e.g. 49%. To produce a list of all available destinations, use %.

·  From a Destination Group Set – Produces a routing list only for destinations available in the specified destination group set (which can be selected from the drop-down list).

·  From an Existing Tariff – The report will only include destinations present in the specified tariff. The tariff can be chosen from the drop-down list.



Date + time; by default – empty

Calculate routing at a specified time (if empty, use the current time at report generation).

Number of routes



Numeric up to 10; default – 3

The number of routes (from all available routes) that should be displayed for each destination.

1st route weight



How often this route is used; e.g. if the first route has a weight of 80 and the second, 20 – we can assume that, on average, 80% of all calls go via the first route.

Note: weight is not a percentage; rather, it is the number of calls that go via this route during the sampling interval. So if you enter 7 for the first route, and 3 for the second, it means that, on average, for every 10 calls, 7 will go via the first route and 3 will go via the second (or 70 / 30% split). Of course, you can enter the actual percent values here; e.g. in this example, you can reach the same result by entering 70 and 30.

Nth route weight



Same as above, for 1st route weight field.



Available protocols, SIP by default

Selects the routes that operate via the specified protocol.



List of “available” currencies (base + ones with a defined exchange rate)

By default the base currency should be selected.

Selling rate markup, %



Numeric, can be negative; by default, empty (0)

Percentage to be added to the average vendor destination price as your profit. 


Compare with Tariff


List of available tariffs; by default, empty

The list produced and its price will be compared with the selected tariff (use only if you need to compare the result with some existing tariff; if not, leave this blank).

List of Output Fields:




Phone number prefix of the destination.


Country corresponding to the current destination.


A short description of the specified destination.

Route N vendor

The name of a vendor for a selected route.

Route N price

The price a vendor charges you for a particular destination.

Route N, %

The route weight, i.e. how often this route is used.

Aggregated Price

Average price to the specified destination.

Suggested Sale Price

Suggested price calculated in accordance with the selling rate markup.

Tariff Destination

The destination in the tariff that was chosen for comparison.

Tariff X price

The price for this destination in the specified tariff.

Tariff <X> difference

Difference between “Tariff_x_price” and the suggested sale price.


Behind the Web Interface

How are all the things mentioned above compiled into a human-readable report? Let’s assume we are generating an LCR blending report for all available routes where the “Destination pattern” is 44 (Great Britain), “Number of routes” is 2, and “1st route weight” is 80% (or just 80) while the “2nd route weight” is 20%.


When the Execute button is pressed, the system finds all the vendors who can terminate a call to the destination defined in the report parameters. Prices from all matched vendors’ tariffs with a destination like 44% are retrieved and processed in accordance with defined “route weights” for each available vendor.

NOTE: If you set “Number of routes” to 2, all other routes available for that routing plan will be ignored. So the best way to get a clear and correct report is to set the “Number of routes” parameter equal to the number of route categories included in that particular routing plan.

The next step is to calculate the average price for all the vendors involved. In our example, 8 out of 10 calls will go to the 1st route (we set its “weight” at 80%). Then all the gathered data is analyzed and the average price is calculated. The 1st vendor’s price will have the highest “priority” in the calculations, to reflect the fact that it will be the most used.

NOTE: When calculating the aggregated price, only vendors, not connections, are taken into account. This helps to prevent a situation where a single vendor with 5 gateways (5 different connections – same price) occupies a whole list of routes when we have only specified 2 routes. In such a case, the “aggregated price” would be equal to this vendor’s price, which is not correct.

Additionally, the percentage defined as “selling rate markup” is added to the average destination price calculated during the previous step to form the recommended selling prices for each destination that matches the 44% pattern.


The final step is to display the prices of an existing tariff next to the new ones produced by the LCR blending report (if you have specified a tariff for comparison when configuring the report).

How to Manage LCR Blending Reports

When a report has been configured and saved, two additional tabs appear. These tabs are related to effectively managing this specific report.

Schedule tab

This tab allows you to run a report in “unattended” mode, and may be configured to run this report at any time on any date. Additionally, this can be done as a periodical task with daily, weekly and monthly intervals. You can schedule this report to run weekly at 1:00 pm on Fridays, so that by the time your weekly meeting is over, the report has been compiled and is ready for review:


Manage LCR blendng reports


To create a new periodical task, click add Add.

1.      Start time.  Date and time when the report should be produced. You may use the YYY-MM-DD HH24:MI:SS link (in the column header) to easily access the calendar and assign a start date.

2.      Periodic. This specifies whether the report should be produced only once, or generated every day, week or month. Use the drop-down menu to select the desired interval. Add an interval if you want this report to be periodic. The value options are: daily, weekly, monthly.

3.      Last run. The date when the report was last executed (if applicable).

4.      Status. The current status of the report. Waiting – Report execution has not started yet, and is scheduled for the future. Completed – The report was to be executed only once, and has already been done. Running – The report is currently being produced.

5.      Suspend. This allows you to temporarily disable executing reports (without deleting the entry from the report schedule). This may be convenient if you are leaving for vacation and would like to avoid having reports pile up in your inbox during your absence.

6.      Click theSave button.

NOTE: The start time specifies only the preferred start time for the report. Report execution will not start earlier than the specified time, but it may start later if there are conflicting tasks scheduled at that same time. For instance, if two reports are scheduled to be executed at 6:00 am, only one of them can start at that time, while the other will start after the first one has finished.

_Hint_Glasses TIP: You can monitor the process of report generation. The status of report generation will be reflected in the /porta_var/<your_domain>/log/httpd-error-web.log.

Reports tab

This tab allows you to browse the results for up to ten previous reports executed and stored in CSV format. Thus you do not have to run the reports again if you did not save the original. Click on the icon to see the corresponding file.


Browse the results

When & How to Use

New routing plan created

One example of a case in which this report is applicable is when you have created a new routing plan for premium customers, and need to generate a price list to bill for the calls accordingly. For providing services to the most demanding premium customers, you will most likely be using a special routing plan like “Premium.” This will include the most expensive and most reliable vendors with the highest ASR and sound quality. When the new routing plan is ready to use, you will need to have an appropriate tariff & product to make use of it. Please refer to the Voice Services section in the PortaBilling Administrator Guidefor more details on how to configure routing parameters and routing plans.


It is then time to start using LCR blending reports. They can save you a lot of time, since recommended prices are generated automatically according to route analysis and routing cost. Open the Report template and enter the appropriate data in all the necessary fields on the Input Parameters tab and, if needed, the Output Data tab as well. See the List of Input and Output Values above for a detailed description of all the available fields. As you are not comparing tariffs, you may leave the Compare with Tariff field blank. This report will use the following input parameters:

o   Routing plan – Premium.

o   Use only Destination Prefixes – Matching the Pattern “%” (meaning every available destination).

o   Number of routes – 3 (there are 3 vendors in the routing plan).

o   Weight of route 1 – 80% (you assume 80% of calls will go to this vendor).

o   Weight of route 2 – 15% (you assume 15% of calls will go to this vendor). 

o   Weight of route 3 – 5% (you assume 5% of calls will go to this vendor). 

o   Selling Rate Markup – 8% (expected profit margin).

o   Currency – US Dollar.

o   Compare with Tariff – skipped for now.

NOTE: You need to select a newly created routing plan in the “Routing plan” field in order to obtain the correct results, since by default, the “All available routes” option is selected.

Press Execute in the upper toolbar when you are ready. This is a rather large report, so it can take a while to be produced, and will open in a new window:


Browse the report info

How to read it

When you created the “Premium” routing plan, you included 3 vendors in it. All of them are prioritized differently; the first one handles the vast majority of calls (since it is first on the list, with the highest priority), while other vendors have the opportunity to terminate a call in case the first one fails to do so for some reason. This first vendor’s info is shown as Route 1 and on the LCR blending report results page, as Route 1 Price. The Route 1 Price will be the basis for the suggested sale price, since you will send about 80% of all calls to it. In spite of possible differences in prices, the Route 2 and 3 prices will have less influence on the resulting sale price, since you will use those vendors mostly as failover solutions.


The results page provides you with a routing and price data overview for each of the 3 vendors. The most important columns are:

o   Destination – Destination phone prefix.

o   Route 1 % – You assume that on average, 80% of calls go via the first route.

o   Route N % – You assume that on average, x% of calls go via the Nth route.

o   Route 1 Price – Price vendor 1 charges you for calls to that destination.

o   Route N Price – Price vendor N charges you for calls to that destination.

o   Aggregated Price – The average price of all vendors combined, with each route’s weight taken into consideration.

o   Suggested Sale Price – The aggregated price + 8% (which you have defined as the selling rate markup).

Modifying the report format

As the only intention is to generate a profitable price list and no routing analysis is needed here, you can hide all unnecessary data.


In the Visible column, un-tick the checkboxes next to the unneeded elements to prevent them from showing up on the results page (in this example, only “Destination,” “Description,” and “Suggested sale price” are left).


There is also a post-processing rule. Here you can define a Perl regular expression that will rewrite the original values accordingly.


Modifying the report format


The report results page will look like this (no extra data, just destination and price):


See the results


After successful completion, the system will email the report to the addresses defined on the Query Info tab, and you can also download them from the results page. Click Download on the upper menu bar and choose the location where you want it saved. Now that you have the LCR blending report in a CSV file, it is just a matter of a few mouse clicks to convert it into a profitable price list.

Quick way to check and redesign existing tariffs

In addition to the information about routes and the suggested price list for the selected routing plan, an LCR blending report can compare its suggested price with a specified existing tariff. It may be helpful to compare your current prices for different end-user groups with those computed with the help of the LCR blending report, and to modify the existing tariffs, if needed.


Before starting the report compilation, simply define the tariff you wish to compare the report’s results to on the Input Parameters tab, and then execute the report:


Quick way to check and redesign existing tariffs


With a tariff defined, the results page will have several new columns:

o   Tariff Destination – The corresponding destination in the tariff that was chosen for comparison.

o   Tariff Price – The price to make calls to this destination within the defined tariff.

o   Tariff Difference – The difference between the recommended sale price and the current price in the tariff.


Fields like “Route N Price” and “Route N%” have been excluded from this report to give you a clearer view of the new columns on the results page. 

Tariff upload

Uploading vendors’ tariffs is not a problem, since vendors themselves provide you with a file containing all the destinations and prices. If this is your own tariff, you will need to create such a file yourself. If the suggested sale price suits you, you can create a new tariff and easily upload the rates for it using a .csv file with report results as a template. Refer to the “Rate Import” chapter of this guide for more information about uploading rates.

NOTE: PortaBilling® requires that you have at least the Destination and Suggested Sale Price data fields visible to be able to use a CSV file for tariff upload.


The LCR blending report tool is primarily designed to display routing options for each destination and produce suggested selling prices. It creates a list of available routes for each destination and presents them in a form that allows for easy calculation of “blended” route pricing.