> 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/redirect.md).

# Redirect

Some signaling protocols support redirecting calls from one location to another. This is usually done by a redirect server which analyzes incoming call information and then terminates the call while specifying another destination.

Redirections are usually triggered by the following call termination reason codes:

* SIP
  * 300 Multiple Choices
  * 301 Moved Permanently
  * 302 Moved Temporarily
  * 305 Use Proxy
  * 380 Alternative Service
* SS7
  * Q.850 Ported Number (14)
  * Q.850 Number Changed (22)
  * Q.850 Redirection (23)

### TelcoBridges and redirections

Tctrl 2.7 and earlier provides basic support for SIP redirection on the NAP from where the outgoing call originated.

Tctrl 2.8 and later provides support for various redirection behaviors on signaling protocols that support it. These behaviors are:

* Redirection emission: [Tctrl](/telecom-references/developer-reference/toolpack-api/tctrl.md) can forge a redirection response instead of routing an incoming call using routing scripts.
* Redirection processing: [Tctrl](/telecom-references/developer-reference/toolpack-api/tctrl.md) can process redirection requests through its routing scripts using the specified called or routing numbers. This feature can be used for [LNP](https://telcobridges.com/learning/sip-trunking/number-porting-isps-carriers/) "dipping".
* Relay: The [Tmedia](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/tmedia) or Tdev unit can be configured automatically relay redirection requests from the outgoing call to the incoming call.
* Drop: The unit can also be configured to drop the request altogether.

### Configuration

* [Redirect configuration](https://prosbcdocs.telcobridges.com/tmedia-documentation/configuration/web-portal-3-3/use-cases/redirect/redirect-configuration)


---

# 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/redirect.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.
