Adding Label Routing to a Routing Script
From TBwiki
Applies to version(s): v2.5, v2.6.
To implement label routing to any routing script, do the following:
1- Click Routing script in the navigation panel.
2- Select the script that you wish to edit.
The Script Editing Window is displayed.
3- Add the following line at the very beginning of the script file:
require 'routesets_digit_analyzer'
4- Include the module in your routing class:
class MyRoutingClass < BaseRouting
1.
include RoutesetsDigitAnalyzer
1.
...
1.
end
5- 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
Note: Other filter scripts can be added to the standard scripts to add further flexibility to the routing. For furtehr information, consult How to Setup Filters.