> 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/developer-reference/routing-scripts/redirection.md).

# Redirection

In release 2.8 and above, redirection contacts are obtained from the routing engine in the following format:

```
contacts = params[ :contacts ]
contacts = {
```

> index=>"3", list=>\[ {:called\_number=>"6660", :priority=>"1000", :is\_number\_ported=>"0", :sip\_uri=>"", :raw\_data=>"", :expiration=>"3600"}, {:called\_number=>"6661", :priority=>"1000", :is\_number\_ported=>"0", :sip\_uri=>"sip:6661\@192.168.215.127", :raw\_data=>"<sip:6661@192.168.215.127>", :expiration=>"3600"} {:called\_number=>"6662", :priority=>"1000", :is\_number\_ported=>"0", :sip\_uri=>"sip:6662\@192.168.215.128", :raw\_data=>"<sip:6662@192.168.215.128>", :expiration=>"3600"}, {:called\_number=>"6663", :priority=>"1000", :is\_number\_ported=>"0", :sip\_uri=>"sip:6663\@192.168.215.129", :raw\_data=>"<sip:6663@192.168.215.129>", :expiration=>"3600"}, {:called\_number=>"6664", :priority=>"1000", :is\_number\_ported=>"0", :sip\_uri=>"sip:6664\@192.168.215.150", :raw\_data=>"<sip:6664@192.168.215.150>", :expiration=>"3600"} ], source\_indexes=>"nil,0,0,0,2" }

* `params[:contacts][:list]` contains the contact log. Each contact within the list has the following fields:
  * `:called_number` - the called number
  * `:is_number_ported` - if the called number has been ported (for SIP: if the npdi parameter is present)
  * `:ported_number` - the called number that was ported (for SIP: the rn parameter value, if available)
  * `:sip_uri` - the SIP URI of the contact, without the contact-params section (without the expires and q contact parameters)
  * `:raw_data` - the raw data representing the contact in the signaling protocol. For SIP, this is the full SIP URI (including the expires and q contact parameters).
  * `:priority` - the priority of the contact \[0-1000]
  * `:expiration` - the expiration time in seconds of the contact
* `params[:contacts][:index]` contains the index of the contact that is currently being routed.
* `params[:contacts][:source_indexes]` contains a comma-separated list of indexes from `params[:contacts][:list]`. Each index represents the contact from which the contact in the list was obtained from.

To get more information, see:

* [SIP Redirection Contacts Parameters in a Call Flow](/telecom-references/developer-reference/routing-scripts/sip-redirection-script-contacts-parameters.md)

![BackToMain](https://docs.telcobridges.com/w/images/1/1e/BackToMain.png)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://prosbcdocs.telcobridges.com/telecom-references/developer-reference/routing-scripts/redirection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
