Label Routing

From TBwiki
(Difference between revisions)
Jump to: navigation, search
(Implementation: spelling correction)
(Routeset Definition: clean-up)
Line 22: Line 22:
 
=== Routeset Definition  ===
 
=== Routeset Definition  ===
  
Each [[NAP]] in the system must be assigned a routesets_definition [http://en.wikipedia.org/wiki/Comma-separated_values CSV] file.  A routesets_definition file gives the association between [[NAP|NAP]] and [[RouteSet|RouteSet]] names.  The association between a [[NAP]] and a [[RouteSet|RouteSet]] name is in fact a route! ie: Rogers->"Montreal, Qc"  Thus, for each [[RouteSet]] name<->[[NAP]] association, a dynamic route entry gets created.  
+
Each [[NAP]] in the system must be assigned a routesets_definition [http://en.wikipedia.org/wiki/Comma-separated_values CSV] file. A routesets_definition file gives the association between [[NAP|NAP]] and [[RouteSet|RouteSet]] names. The association between a [[NAP]] and a [[RouteSet|RouteSet]] name is in fact a route! ie: Rogers->"Montreal, Qc" Thus, for each [[RouteSet]] name<->[[NAP]] association, a dynamic route entry gets created.  
  
 
<br>  
 
<br>  
Line 35: Line 35:
 
   
 
   
  
In the above example, the routes are getting created with custom attributes found in the second and third column. Each custom attributes must be defined by adding a custom column in the gateway Route table.  
+
In the above example, routes are created with custom attributes found in the second and third columns. Each custom attribute must be defined by adding a custom column in the gateway Route table.  
  
 
<br>The [[NAP]] &lt;-&gt;&nbsp;Routeset Definition association is done&nbsp;by setting the [[NAP]] dynamic columns named 'routesets_definition'. &nbsp;More than one [[NAP]] can point to the same 'routesets_definition' file. This file must be imported in the database using the File Db view in the Toolpack Web Portal.<br>  
 
<br>The [[NAP]] &lt;-&gt;&nbsp;Routeset Definition association is done&nbsp;by setting the [[NAP]] dynamic columns named 'routesets_definition'. &nbsp;More than one [[NAP]] can point to the same 'routesets_definition' file. This file must be imported in the database using the File Db view in the Toolpack Web Portal.<br>  
Line 49: Line 49:
 
*Click create to save
 
*Click create to save
  
<br>  
+
<br>
  
 
=== Routeset Digitmap  ===
 
=== Routeset Digitmap  ===

Revision as of 12:35, 17 August 2010

Routeset Routing is an algorithm that combines Digit Analyzer and the concept of RouteSet. It is implemented as a RoutingScript in Toolpack Gateway.  This algorithm allows complex routing rules, as normally available with RoutingScript, but on a very large number of destination numbers.

Contents

Concept

The concept is very simple.  

  1. A list of numbers for a specific destination is given a RouteSet name.  This list can be very large.
    ie: 514201,514202,514203, ... -> "Montreal, Qc"
  2. The list of routes for the destination is given the same RouteSet name.  This list usually limits to the number of NAP in the system.
    ie: Bell, Rogers, Videotron -> "Montreal, Qc"


No matter how many destination number leading to a specific destination, only a limited list of routes gets selected.  Then complex routing rules can take place, efficiently.

Implementation

As previously mentioned, Routeset Routing is implemented as a RoutingScript. It was written as an optional filter, and can be used in any existing scripts. This filter is a before_filter, and reduces the amount of routes the routing script will work with.

Provisioning

Provisioning of large amounts of Routeset Definition and Routeset Digitmap is accomplished by importing CSV files using the WebPortal.  Those files are being saved in the HA Database.

Routeset Definition

Each NAP in the system must be assigned a routesets_definition CSV file. A routesets_definition file gives the association between NAP and RouteSet names. The association between a NAP and a RouteSet name is in fact a route! ie: Rogers->"Montreal, Qc" Thus, for each RouteSet name<->NAP association, a dynamic route entry gets created.


The Routeset Definition file defines a list of RouteSet names, with optional attributes.

  • One mandatory column: routeset_name
  • Supplementary columns are used to provide optional and custom attributes to dynamically created routes
 routeset_name,  cost,    custom_1
"Montreal, Qc", "0.24",  "custom_val"

In the above example, routes are created with custom attributes found in the second and third columns. Each custom attribute must be defined by adding a custom column in the gateway Route table.


The NAP <-> Routeset Definition association is done by setting the NAP dynamic columns named 'routesets_definition'.  More than one NAP can point to the same 'routesets_definition' file. This file must be imported in the database using the File Db view in the Toolpack Web Portal.

Add the routeset definition NAP dynamic column

  • Click the Gateway->Configurations->Naps menu
  • Click the 'Create New Nap Column' link
  • Fill the form as follow:
  • Name = routesets_definition
  • Type attributes = dbfile
  • Default =
  • Click create to save


Routeset Digitmap

Each NAP in the system can be assigned a routesets_digitmap CSV file. It is usual that all NAP uses the same routesets_digitmap file. A routesets_digitmap file gives the association between numbers and RouteSet names.

  • Three mandatory columns: route_set_name, called and calling
 called,calling,routeset_name
403200,       ,"Calgary, AB"
514201,       ,"Montreal, Qc"
514202,       ,"Montreal, Qc"
514203,       ,"Montreal, Qc"

The NAP <-> Routeset Digitmap association is done by setting the NAP dynamic columns named 'routesets_digitmap'.   This file must be imported in the database using the File Db view in the Toolpack Web Portal.

Add the routesets digitmap NAP dynamic column

  • Click the Gateway->Configurations->Naps menu
  • Click the 'Create New Nap Column' link
  • Fill the form as follow:
  • Name = routesets_digitmap
  • Type attributes = dbfile
  • Default =
  • Click create to save


Dynamic Routes

When provisioning is complete, dynamic routes can be generated by going in the Routetsets menu item, under Gateway menu Item.

Routesets.png
Generate routes.png


Using

Using RouteSet Routing is done by following the 3 simple steps:

  1. Add a the following line on top of your script file:
    require 'routesets_digit_analyzer'
  2. Include the module in your routing class:
      class MyRoutingClass < BaseRouting
    
  1. include RoutesetsDigitAnalyzer
  1. ...
  1. end
  2. Add a before_filter with 'routesets_digit_analyzer' method:
    before_filter :method => :routesets_digit_analyzer, :trie_order => :called

Complete Example

  require 'base_routing'
  require 'routesets_digit_analyzer'

  class MyRoutingClass < BaseRouting
    include RoutesetsDigitAnalyzer
  
    before_filter :method => :routesets_digit_analyzer, :trie_order => :called

    route_match :call_field_name => :called
    route_match :call_field_name => :calling
    route_match :call_field_name => :nap
    route_match :method => :match_nap_availability
    route_remap :call_field_name => :called, :route_field_name => :remapped_called
    route_remap :call_field_name => :calling, :route_field_name => :remapped_calling
    route_remap :call_field_name => :nap, :route_field_name => :remapped_nap
  end


Personal tools