Adding Label Routing to any Routing Script
From TBwiki
(Difference between revisions)
(Created page with '== <br> == Label routing can be implemented in any routing script by following these 3 simple steps: 1. Add a the following line on top of your script file: <pre>require 'route…') |
|||
Line 1: | Line 1: | ||
− | + | Label routing can be implemented in any routing script by following these 3 simple steps: | |
− | + | 1. Add a the following line on top of your script file: | |
+ | <pre>require 'routesets_digit_analyzer'</pre> | ||
+ | 2. Include the module in your routing class: | ||
+ | <pre>class MyRoutingClass < BaseRouting</pre> | ||
+ | 1. | ||
− | + | <br> '''include RoutesetsDigitAnalyzer''' | |
− | < | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | 1. | |
− | + | <br> ... | |
− | + | 1. | |
− | + | <br> end | |
− | + | 2. Add a before_filter with 'routesets_digit_analyzer' method: | |
− | + | <pre>before_filter :method => :routesets_digit_analyzer, :trie_order => :called</pre> | |
− | 2. Add a before_filter with 'routesets_digit_analyzer' method: | + | === <br>Complete Example === |
− | <pre>before_filter :method => :routesets_digit_analyzer, :trie_order => :called</pre> | + | |
− | === <br>Complete Example === | + | |
<pre>require 'base_routing' | <pre>require 'base_routing' | ||
require 'routesets_digit_analyzer' | require 'routesets_digit_analyzer' | ||
Line 28: | Line 26: | ||
include RoutesetsDigitAnalyzer | include RoutesetsDigitAnalyzer | ||
− | before_filter :method => :routesets_digit_analyzer, :trie_order => :called | + | before_filter :method => :routesets_digit_analyzer, :trie_order => :called |
− | route_match :call_field_name => :called | + | route_match :call_field_name => :called |
− | route_match :call_field_name => :calling | + | route_match :call_field_name => :calling |
− | route_match :call_field_name => :nap | + | route_match :call_field_name => :nap |
− | route_match :method => :match_nap_availability | + | route_match :method => :match_nap_availability |
− | route_remap :call_field_name => :called, :route_field_name => :remapped_called | + | 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 => :calling, :route_field_name => :remapped_calling |
− | route_remap :call_field_name => :nap, :route_field_name => :remapped_nap | + | route_remap :call_field_name => :nap, :route_field_name => :remapped_nap |
end | end | ||
− | </pre> | + | </pre> |
<br> | <br> |
Revision as of 12:35, 31 March 2011
Label routing can be implemented in any routing script by following these 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