Adding Label Routing to any Routing Script: Difference between revisions
(Moved the examples of filters in "How to setup filters") |
No edit summary |
||
| Line 1: | Line 1: | ||
Label routing | === '''''Applies to version(s): v2.5, v2.6.''''' === | ||
{{DISPLAYTITLE:Adding Label Routing to a Routing Script}} | |||
'''To implement label routing to any routing script, do the following:''' | |||
1- Click '''Routing script''' in the navigation panel. | |||
[[Image:RoutingScript_0_A.png]] | |||
2- Select the script that you wish to edit. | |||
[[Image:RoutingScript_1_A.png]] | |||
The '''Script Editing''' Window is displayed. | |||
[[Image:RoutingScript_2_A.png]] | |||
3- Add the following line at the very beginning of the script file: | |||
<pre>require 'routesets_digit_analyzer'</pre> | <pre>require 'routesets_digit_analyzer'</pre> | ||
4- Include the module in your routing class: | |||
<pre>class MyRoutingClass < BaseRouting</pre> | <pre>class MyRoutingClass < BaseRouting</pre> | ||
1. | 1. | ||
<br> '''include RoutesetsDigitAnalyzer''' | <br> '''include RoutesetsDigitAnalyzer''' | ||
1. | 1. | ||
<br> ... | <br> ... | ||
1. | 1. | ||
<br> end | <br> end | ||
5- Add a before_filter with 'routesets_digit_analyzer' method: | |||
<pre>before_filter :method => :routesets_digit_analyzer, :trie_order => :called</pre> | <pre>before_filter :method => :routesets_digit_analyzer, :trie_order => :called</pre> | ||
=== <br>Complete Example === | === <br>Complete Example === | ||
| Line 39: | Line 63: | ||
</pre> | </pre> | ||
<br> Note: Other filter scripts can be added to the standard scripts to add flexibility | <br> 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|How to Setup Filters]].<br> | ||
Revision as of 13:47, 3 November 2012
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.


