> For the complete documentation index, see [llms.txt](https://prosbcdocs.telcobridges.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prosbcdocs.telcobridges.com/telecom-references/telecom-concepts/adding-enum-query-for-lnp-to-routing-script.md).

# Adding ENUM Query for LNP to Routing Script

> **Applies to:** 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**

* 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)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://prosbcdocs.telcobridges.com/telecom-references/telecom-concepts/adding-enum-query-for-lnp-to-routing-script.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
