Adding Label Routing to any Routing Script
From TBwiki
(Difference between revisions)
(Added "other filter scripts" examples) |
(Added filter ruby filenames) |
||
Line 1: | Line 1: | ||
Label routing can be implemented in any routing script by following these 3 simple steps: | Label routing can be implemented in any routing script by following these 3 simple steps: | ||
<pre>Gateway -> Routing Script -> YourScript.rb (Edit) | <pre>Gateway -> Routing Script -> YourScript.rb (Edit) | ||
− | </pre> | + | </pre> |
1. Add a the following line on top of your script file: | 1. Add a the following line on top of your script file: | ||
<pre>require 'routesets_digit_analyzer'</pre> | <pre>require 'routesets_digit_analyzer'</pre> | ||
Line 39: | Line 39: | ||
</pre> | </pre> | ||
− | |||
− | |||
<br> Note: Other filter scripts can be added to the standard scripts to add flexibility in the routing. <br> | <br> Note: Other filter scripts can be added to the standard scripts to add flexibility in the routing. <br> | ||
For example:<br> | For example:<br> | ||
− | + | *'''Request-URI routing (ruri.rb):''' Will route the call on SIP RURI instead of the to: field<br> | |
− | + | *'''Modify the Nature of Address (noa_npi_remap.rb):''' We can use this to change the NOA to national or international<br> | |
− | + | *'''Remove Loop (FilterRemoveLoop.rb): '''Will prevent calls from being routed back to the sender<br> | |
− | + | *'''Remove Display IE (RemoveDisplayIE.rb): '''Removes the DISPLAY Information Element from outgoing ISDN/SS7 calls. ''Note: This is not needed with release 2.5.116+. There is option "Send display IE" in the profiles to send this or not.''<br> | |
− | + | ||
− | + | ||
− | + | ||
These filters can be merged in the same routing script. Please contact support for more details | These filters can be merged in the same routing script. Please contact support for more details |
Revision as of 15:05, 3 February 2012
Label routing can be implemented in any routing script by following these 3 simple steps:
Gateway -> Routing Script -> YourScript.rb (Edit)
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
Note: Other filter scripts can be added to the standard scripts to add flexibility in the routing.
For example:
- Request-URI routing (ruri.rb): Will route the call on SIP RURI instead of the to: field
- Modify the Nature of Address (noa_npi_remap.rb): We can use this to change the NOA to national or international
- Remove Loop (FilterRemoveLoop.rb): Will prevent calls from being routed back to the sender
- Remove Display IE (RemoveDisplayIE.rb): Removes the DISPLAY Information Element from outgoing ISDN/SS7 calls. Note: This is not needed with release 2.5.116+. There is option "Send display IE" in the profiles to send this or not.
These filters can be merged in the same routing script. Please contact support for more details