# Enabling Lawful Interception in a Routing Script

1- Click Routing script in the navigation panel.

<figure><img src="https://docs.telcobridges.com/w/images/f/f4/CreateRoutingScript_0.png" alt=""><figcaption></figcaption></figure>

\
2- Edit your main script

<figure><img src="https://docs.telcobridges.com/w/images/a/ac/ImportRoutingScript_0.png" alt=""><figcaption></figcaption></figure>

3- The Lawful Intercept filter is activated as follows:

* Include the 'Lawful intercept' module in your routing script: *require 'base\_routing'*
* Include the LawfulIntercept class: *include LawfulIntercept*
* Add the Lawful Intercept "after\_filter" to your script: *after\_filter :method => :enable\_lawful\_intercept*

**Script example**

```
require 'base_routing'

require 'lawful_intercept'                                # <- Add this line here

class SimpleRouting < BaseRouting
  include LawfulIntercept                                 # <- Add this line here
 
  route_match :call_field_name => :called
  route_match :call_field_name => :calling
  route_match :call_field_name => :nap
  route_remap :call_field_name => :called, :route_field_name => :remapped_called
  route_remap :call_field_name => :calling, :route_field_name => :remapped_calling
  route_remap :call_field_name => :nap, :route_field_name => :remapped_nap
  
  after_filter :method => :enable_lawful_intercept        # <- Add this line here
end

@@routing = SimpleRouting.new

def init_routes( routes )
  @@routing.init routes
end

def route( call, nap_list )
  @@routing.route call, nap_list
end
```


---

# Agent Instructions: 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:

```
GET https://prosbcdocs.telcobridges.com/configuration-details/configuration-by-web-portal-category/lawful-intercept/enabling-lawful-interception-in-a-routing-script.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
