LCR - Least Cost Routing
Â
Â
OverviewÂ
Least Cost Routing (LCR) allows users to intelligently select the ITSP provider to route the traffic based on the cost for a certain destination number.
This feature works in tandem with the SIP Trunking functionality provided by NSC. To deploy this feature, the following elements are required:
Multiple rate lists provided by your ITSP
Each rate list provided should be formatted as a CSV file which can be uploaded into NSC (you can convert spread sheet documents to CSV easily using the 'Save As' menu from your spread sheet software)
SIP Trunk(s) to the ITSP should be created already
If an ITSP provides a rate list and more than one SIP Trunks using this rate list, a distribution list needs to be created for those SIP trunks (See "Configuration -> Load Balancing" in the web interface menu)
When all the elements above are ready, you need to create an LCR carrier for each rate list and then add few lines in your routing plan to look up the LCR table (using the "lcr" application) and perform the LCR routing.
Â
Prepare the rate list CSV filesÂ
The contents of the CSV file are expected to be divided in 8 columns:
digits (mandatory): Â Matching digits that are used to compare the destination number in routing plans using the "lcr" application
rate (mandatory): Â Decimal value to indicate a relative cost of using this entry
lead_strip (optional): Â How many digits to strip off the start of the matching number, the stripping is done after matching the digits
trail_strip (optional): Â How many digits to strip off the end of the input number, the stripping is done after matching the digits
prefix (optional): Â Digits to add in front of the the destination number after stripping has been performed
suffix (optional): Â Digits to add at the end of the destination number after stripping has been performed
date_start (optional): Â Begin date when the rate is valid
date_end (optional): Â Date when the rate stops being valid
See below 2 CSV example files for "Carrier A" and "Carrier B"
carriera.csv
Â
Â
Â
Â
carrierb.csv
Â
Â
Â
SAMPLE CSV →
Â
Create LCR CarrierÂ
Â
Go to "Configuration" -> "Routing" -> "LCR Carriers", add a new LCR carrier and then choose from "SIP Trunk/Load Balancing List" the created SIP Trunk "Trunk_To_Carrier_A":
Â
Â
Â
Â
Click the "Save" button:
Â
Â
Â
Â
Click the "Upload" button in "Carrier Rates File" to upload rate list:
Â
Â
Â
Â
Repeat above steps for all the rate lists.
Â
Â
Â
Using the LCR DatabaseÂ
Once the LCR internal database is created, you can start using LCR routing now from both the advanced and basic routing plan engines:
Â
Basic Dial Plan
Â
Advanced Dial Plan
<condition field="destination_number" expression="^(.*)$">  |
e.g. when number "17771234567" is dialed and hit above routing plan, "17771234567" is passed to the lcr look up function. The lookup result is saved to channel variable "lcr_auto_route". Since the rate of "1777" from CarrierA is 0.0069 and 0.0079 for CarrierB, CarrierA will be tried first; if the carrier is not available (e.g the SIP trunk is down), then CarrierB will be tried.
Â
When you change the dialed number to "17781234567", since CarrierB for "1778" is cheaper than CarrierA, then CarrierB will be tried first.
Â
Â
Using Load Balancing ListÂ
If you get 2 or more SIP Trunks from the same ITSP provider, you can setup a load balancing list using the same rate list.
Â
Â
In the Load Balancing SIP Trunk List "SIP_Trunk_List_C", there are 2 resources: SIP Trunk C1 and C2 and you can set their "weight" to decide which one will be used more often.
Â
Â
Â
Â
Create an LCR Carrier using the load balancing list as the destination:
Â
Â
Â
Â
Whenever this carrier is chosen the calls will be load balanced across all SIP trunks members of the load balancing list and according to the specified weight and availability of each one.
Â
Update of rate list for a specific LCR carrierÂ
Rates are always changing, when an update comes for one ITSP provider, please:
Â
Prepare the updated rate list CSV file
Remove the out-of-date "Carrier Rates File", then all the rates related to this LCR carrier will be removed from internal database
Upload the new CSV file