Actions

Adding NAP Grouping Script: Difference between revisions

(Created page with "=== '''''Applies to version(s): v2.9, v2.10, v3.0, v3.1''''' === {{DISPLAYTITLE:Adding Grouping NAP Script}} This shows how to add '''Grouping NAP''' script to any Routing scr...")
 
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=== '''''Applies to version(s): v2.9, v2.10, v3.0, v3.1''''' ===
{{DISPLAYTITLE:Adding NAP Grouping Script}}
{{DISPLAYTITLE:Adding Grouping NAP Script}}
This shows how to add '''Grouping NAP''' script to any Routing scripts.


== Script description <br>  ==
{| class="wikitable"
|-
|rowspan="3"|This article applies to:
|'''Product'''
|'''Version'''
|-
|Tmedia
|2.9, 2.10, 3.0, 3.1
|}
 
This article describe how to add '''NAP Grouping''' script to any Routing scripts.


This filter is used to dynamically generate routes from a Regex.   
'''Script description''' <br>
For example, you can have 1 route from SS7 to SIP. In this route, you specify additional SIP routes for load balancing.
 
NAPs: SS7_A, SS7_B, SIP_Z, SIP_Y, SIP_X
This filter is used to dynamically generate routes from a Regex.  The trick is to use the NAP names to identify which NAPs are in the same group.  The example in the file provides  information about "SIP_. *"Use instead "/GROUPA_.*/".<br>
Route:
 
    Incoming NAP: SS7_A
For example:<br>
    Outgoing NAP: SIP_Z
* GROUPA_SIP_NAP_10_10_10_10
    Additional NAPs: /SIP_.*/
* GROUPA_SIP_NAP_10_10_10_11
    Result: 3 routes (SS7_A => SIP_Z, SS7_A => SIP_Y, SS7_A => SIP_X)
* GROUPA_SIP_NAP_10_10_10_12
* GROUPB_SIP_NAP_10_10_20_20
* GROUPB_SIP_NAP_10_10_20_21
* GROUPC_SIP_NAP_10_10_30_30
 
Then, in your routes, you can use the Route Column "additional_naps" to put /GROUPA_.*/
 
'''Add ''NAP Grouping'' Scripts in the system'''<br>  


== Add '''NAP Grouping''' Scripts in system<br>  ==


Download this file:
{| cellpadding="5" border="1" class="wikitable"
{| cellpadding="5" border="1" class="wikitable"
|-
|-
! width="200" style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;" |Multiple NAPs Script
! width="200" style="background: rgb(239, 239, 239) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;" |Download this file
|-
|-
| valign="top" |
| valign="top" |
*[[Media:multiple_naps.zip|capture_dtmf.rb]]
*[[Media:multiple_naps.zip|multiple_naps.rb]]
|}
|}
'''Setting up ''NAP Grouping'' Scripts''' <br>
To set up a Filter, the main script needs to be modified. The main script can be either simple_routing.rb, simple_routing_sbc.rb, or any other script.<br>
Go to the routing script section of the Web portal
<pre>Gateway -&gt; Routing scripts -&gt; Example Scripts -&gt; simple_routing.rb [Edit]
</pre>
Three things need to be added. At the start of the script:<br>
<pre>require 'multiple_naps'
</pre>
In the main class:<br>
<pre>include MultipleNaps
</pre>
<pre>before_filter :method => :multiple_naps
</pre>
<br>
The final script will look like this:
<pre>
require 'base_routing'
require 'multiple_naps'
class SimpleRouting < BaseRouting
  include MultipleNaps
  before_filter :method => :multiple_naps
  route_match :call_field_name => :called
  route_match :call_field_name => :calling
  route_match :call_field_name => :nap
  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
</pre>
'''Adding New Custom Variable''' <br>
You must add a custom column to use this script.
<pre>Gateway -&gt; Routes -&gt; Create New Route Column</pre>
'''Name''': additional_naps<br>'''Type attributes''': text<br>'''<br>

Latest revision as of 11:09, 13 June 2022


This article applies to: Product Version
Tmedia 2.9, 2.10, 3.0, 3.1

This article describe how to add NAP Grouping script to any Routing scripts.

Script description

This filter is used to dynamically generate routes from a Regex. The trick is to use the NAP names to identify which NAPs are in the same group. The example in the file provides information about "SIP_. *"Use instead "/GROUPA_.*/".

For example:

  • GROUPA_SIP_NAP_10_10_10_10
  • GROUPA_SIP_NAP_10_10_10_11
  • GROUPA_SIP_NAP_10_10_10_12
  • GROUPB_SIP_NAP_10_10_20_20
  • GROUPB_SIP_NAP_10_10_20_21
  • GROUPC_SIP_NAP_10_10_30_30

Then, in your routes, you can use the Route Column "additional_naps" to put /GROUPA_.*/

Add NAP Grouping Scripts in the system


Download this file

Setting up NAP Grouping Scripts

To set up a Filter, the main script needs to be modified. The main script can be either simple_routing.rb, simple_routing_sbc.rb, or any other script.

Go to the routing script section of the Web portal

Gateway -> Routing scripts -> Example Scripts -> simple_routing.rb [Edit]


Three things need to be added. At the start of the script:

require 'multiple_naps'


In the main class:

include MultipleNaps
before_filter :method => :multiple_naps


The final script will look like this:

require 'base_routing'
require 'multiple_naps'

class SimpleRouting < BaseRouting
  include MultipleNaps
  before_filter :method => :multiple_naps

  route_match :call_field_name => :called
  route_match :call_field_name => :calling
  route_match :call_field_name => :nap
  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


Adding New Custom Variable
You must add a custom column to use this script.

Gateway -> Routes -> Create New Route Column

Name: additional_naps
Type attributes: text