Sometimes we need to configure more NAPs for the same destination. And each NAP must be added on the routing table. For Example;
SIP Trunk provider uses 10 IP addresses. For this case, we need to create all IP addresses with different NAPs and if we want to send a call to those NAPs we need to create a routing table for each of them.
This filter is used to dynamically generate routes from a Regex.
Procedure:
- Upload the script to your SBC
- Edit your main script (ex. simple_routing.rb) and add what is below (it’s like adding nap_group_weight_load_balancer to a script)
a. require ‘multiple_naps’
b. include MultipleNaps
c. before_filter :method => :multiple_naps - Create a new custom column
- “additional_naps”, type “text”
- In your routes, add a regex in the new column which will match the additional NAPs you want
- /GROUPA_.*/
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_.*/
Please check the following link for configuration of Nap Grouping on FreeSBC;https://docs.telcobridges.com/tbwiki/Adding_NAP_Grouping_Script