Page tree
Skip to end of metadata
Go to start of metadata



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:

  1. Multiple rate lists provided by your ITSP
  2. 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)
  3. SIP Trunk(s) to the ITSP should be created already
  4. 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" 


SAMPLE CSV → LCR-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="^(.*)$">
    <action application="lcr" data="$1"/>
    <action application="bridge" data="${lcr_auto_route}"/>

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:
  1. Prepare the updated rate list CSV file
  2. Remove the out-of-date "Carrier Rates File", then all the rates related to this LCR carrier will be removed from internal database
  3. Upload the new CSV file
  • No labels