Adding ENUM Query for LNP to Routing Script
From TBwiki
This shows how to integrate a routing script filter that send ENUM queries for Local Number Portability and enables ENUM name resolution support on ProSBC.
Contents |
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
Download the gem from https://rubygems.org/downloads/dnsruby-1.54.gem Upload to SBC with sFTP 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)