Actions

Adding ENUM Query for LNP to Routing Script: Difference between revisions

No edit summary
m (format and typo)
 
Line 18: Line 18:
==Install dnsruby gem==
==Install dnsruby gem==


1. Automatic Installation
'''1. Automatic Installation'''
:gem install dnsruby -v1.54
:gem install dnsruby -v1.54
:tbtoolpack stop
:tbtoolpack stop
:tbtoolpack start
:tbtoolpack start


:2. Manual Installation
'''2. Manual Installation'''
Download the gem from https://rubygems.org/downloads/dnsruby-1.54.gem  
*Download the gem from https://rubygems.org/downloads/dnsruby-1.54.gem  
Upload to SBC with sFTP
*Upload to SBC with sFTP
gem install --force --local dnsruby -v1.54
:gem install --force --local dnsruby -v1.54
tbtoolpack stop
: tbtoolpack stop
tbtoolpack start
:tbtoolpack start


==Configure Routing Script==
==Configure Routing Script==


:1. Enable routing script
'''1. Enable routing script'''
Gateway->Use script
:Gateway->Use script
:2. Load routing scripts
 
Gateway->Routes->Routing Script->Import Script File
'''2. Load routing scripts'''
File->naptr_called_replacement.rb
*Gateway->Routes->Routing Script->Import Script File
ScriptType->Filter
*File->naptr_called_replacement.rb
Load on startup->checked
**ScriptType->Filter
:3. Adding ENUM script to main script
:Load on startup->checked
Gateway->Routes->Routing Script->simple_routing_sbc.rb [Edit]
 
'''3. Adding ENUM script to main script'''
:Gateway->Routes->Routing Script->simple_routing_sbc.rb [Edit]


Three things need to be added.<br>   
Three things need to be added.<br>   
Line 54: Line 56:
==Modifying ENUM Script==
==Modifying ENUM Script==


:1. To set ENUM server IP in the script modify the following script parameter in the naptr_called_replacement.rb:
1. To set ENUM server IP in the script modify the following script parameter in the naptr_called_replacement.rb:
<pre>res = Dnsruby::Resolver.new (:nameserver => ['IPaddress'])  IP address must be ENUM Server IP address
<pre>res = Dnsruby::Resolver.new (:nameserver => ['IPaddress'])  IP address must be ENUM Server IP address
</pre>
</pre>


:2. To set the Domain Name for ENUM queries, change the following parameter in the naptr_called_replacement.rb:
2. To set the Domain Name for ENUM queries, change the following parameter in the naptr_called_replacement.rb:
<pre> $domain = "IPAddress/FQDN"  
<pre> $domain = "IPAddress/FQDN"  
</pre>
</pre>
Line 67: Line 69:
   8.6.8.0.4.7.2.0.3.5.0.9.187.202.34.12, 187.202.34.12 is the domain
   8.6.8.0.4.7.2.0.3.5.0.9.187.202.34.12, 187.202.34.12 is the domain


:3. In the answer check the Service and update the script. Service can be returned in the following  and other formats;
3. In the answer check the Service and update the script. Service can be returned in the following  and other formats;
   Service: E2U+SIP, Service: E2U+sip, Service: SIP+E2U, Service: sip+E2U and others
   Service: E2U+SIP, Service: E2U+sip, Service: SIP+E2U, Service: sip+E2U and others
<pre>if a.service == "sip+E2U" || a.service == "SIP+E2U" ==> Change it here
<pre>if a.service == "sip+E2U" || a.service == "SIP+E2U" ==> Change it here
</pre>
</pre>


:4. In the answer, ENUM server can return "." or "@" or any other character in the regex after the number;
4. In the answer, ENUM server can return "." or "@" or any other character in the regex after the number;
  if it is "."
  if it is "."
  params[:call][:called] = tb_naptr_query("#{naptr_called}.#{$domain}", params)
  params[:call][:called] = tb_naptr_query("#{naptr_called}.#{$domain}", params)

Latest revision as of 10:25, 13 June 2022


This article applies to: Product Version
SBC 3.0, 3.1

This article describes how to integrate a routing script filter that sends ENUM queries for Local Number Portability, and enables ENUM name resolution support on ProSBC.

ProSBC Configuration

This section provides ProSBC configuration for the solution.

Install dnsruby gem

1. Automatic Installation

gem install dnsruby -v1.54
tbtoolpack stop
tbtoolpack start

2. Manual Installation

gem install --force --local dnsruby -v1.54
tbtoolpack stop
tbtoolpack start

Configure Routing Script

1. Enable routing script

Gateway->Use script

2. Load routing scripts

  • Gateway->Routes->Routing Script->Import Script File
  • File->naptr_called_replacement.rb
    • ScriptType->Filter
Load on startup->checked

3. Adding ENUM script to main script

Gateway->Routes->Routing Script->simple_routing_sbc.rb [Edit]

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

require 'called_pre_remap' 

In the main class:

include EnumLNP
before_filter :method => :naptr_called_replacement

Click here to download naptr_called_replacement.rb Routing Script

Modifying ENUM Script

1. To set ENUM server IP in the script modify the following script parameter in the naptr_called_replacement.rb:

res = Dnsruby::Resolver.new (:nameserver => ['IPaddress'])  IP address must be ENUM Server IP address

2. To set the Domain Name for ENUM queries, change the following parameter in the naptr_called_replacement.rb:

 $domain = "IPAddress/FQDN" 
  Query examples;
  8.6.8.0.4.7.2.0.3.5.0.9.e164.arpa, e164.arpa is the domain
  8.6.8.0.4.7.2.0.3.5.0.9.e164.arpa.net, e164.arpa.net is the domain
  8.6.8.0.4.7.2.0.3.5.0.9.telcobridges.com, telcobridges.com is the domain
  8.6.8.0.4.7.2.0.3.5.0.9.187.202.34.12, 187.202.34.12 is the domain

3. In the answer check the Service and update the script. Service can be returned in the following and other formats;

 Service: E2U+SIP, Service: E2U+sip, Service: SIP+E2U, Service: sip+E2U and others
if a.service == "sip+E2U" || a.service == "SIP+E2U" ==> Change it here

4. In the answer, ENUM server can return "." or "@" or any other character in the regex after the number;

if it is "."
params[:call][:called] = tb_naptr_query("#{naptr_called}.#{$domain}", params)

if it is "@"
params[:call][:called] = tb_naptr_query("#{naptr_called}@#{$domain}", params)