# Call Diversion Options

It's possible to control the call flow when a call diversion information is received in the alerting state.

Two fields are available: bridge\[ :diversion ] and bridge\[ :diversion\_reason ]

The internal release cause TOOLPACK\_DIVERT\_NOT\_ALLOWED is used by gateway application to terminate both legs.

```
 bridge[ :diversion ] = :allowed
```

The alert message will not be analyzed and the call will be progressed. Default behavior.

```
 bridge[ :diversion ] = :not_allowed
```

If the alert message indicates that the call is diverted, the call will be released no matter the In-band information to allow early media.

```
 bridge[ :diversion ] = :not_allowed_w_early_media
```

The call will be released If the alert message indicates that the call is diverted with in-band information to allow early media.

```
 bridge[ :diversion_reason ] = "*"
```

If the diversion is not allowed, the gateway will drop the call for any redirecting reason.

```
 bridge[ :diversion_reason ] = "0,1,2"
```

or

```
 bridge[ :diversion_reason ] = "unknown,busy,no_reply"
```

If the diversion is not allowed, the redirecting reason will be analyzed and the call will only be dropped for the configured cases.

See [Redirecting number reason values](https://docs.telcobridges.com/wiki/Routing_script_tutorial:Mini_Development_Guide#Redirecting_number,_Original_Called_Number_and_Diversion_Reason).


---

# 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/routing-scripts/development-guides-and-tutorials/call-diversion-options.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.
