Adding NAP Grouping Script: Difference between revisions
No edit summary |
No edit summary |
||
| Line 28: | Line 28: | ||
*[[Media:multiple_naps.zip|multiple_naps.rb]] | *[[Media:multiple_naps.zip|multiple_naps.rb]] | ||
|} | |} | ||
== Adding New Custom Variable <br> == | |||
You need to add a custom column to use this script. | |||
<pre>Gateway -> Routes -> Create New Route Column</pre> | |||
'''Name''': additional_naps<br>'''Type attributes''': text<br>'''<br> | |||
Revision as of 03:26, 10 February 2020
Applies to version(s): v2.9, v2.10, v3.0, v3.1
This shows how to add Grouping NAP 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 talk about "SIP_.*" but I would 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 system
Download this file:
| Multiple NAPs Script |
|---|
Adding New Custom Variable
You need to add a custom column to use this script.
Gateway -> Routes -> Create New Route Column
Name: additional_naps
Type attributes: text