> 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/parameter-reference/gateway.md).

# gateway

### Started By

Gateway is spawned by [tboamapp](/telecom-references/developer-reference/toolpack-api/tboamapp.md).

### Role

Gateway Application is used to bridge 2 call legs, according to a set of routes. The Gateway Application receives incoming calls from [toolpack\_engine](/telecom-references/developer-reference/toolpack-api/toolpack-engine.md), tries to find a matching route, remaps call parameters if required, and then tells toolpack\_engine to generate an outgoing call.

It is responsible for:

* Handling call flow
* Accepting / rejecting call legs.
* Routing call legs to the destination naps, according to routing script, and call profile parameters
* Sending / writing [CDR](/telecom-references/cdr-and-statistics/text-call-detail-records.md) information.
* Starting play / relay stream for [early media](https://telcobridges.com/learning/sip-trunking/sip-response-codes-complete-guide/).
* Remapping call parameters when required

### High Availability

Gateway is a [Active/Standby](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/features-and-solutions/features/redundancy-and-high-availability/active-standby) type of application. The first instance of the Gateway application to be detected by the [toolpack\_engine](/telecom-references/developer-reference/toolpack-api/toolpack-engine.md) will become [active](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/features-and-solutions/features/redundancy-and-high-availability/active-standby) and will be the only instance to take action in the system. In the eventuality where the [active](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/features-and-solutions/features/redundancy-and-high-availability/active-standby) instance is unavailable the [Standby](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/features-and-solutions/features/redundancy-and-high-availability/active-standby) instance will become [active](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/features-and-solutions/features/redundancy-and-high-availability/active-standby). Since there is no preferred instances, the Gateway application don't fall back to the [primary](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/features-and-solutions/features/redundancy-and-high-availability/primary-secondary) host.

### Resynchronization

When becoming [active](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/features-and-solutions/features/redundancy-and-high-availability/active-standby), the Gateway instance retrieves all the [active calls](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/features-and-solutions/features/redundancy-and-high-availability/active-calls) from [Toolpack\_engine](/telecom-references/developer-reference/toolpack-api/toolpack-engine.md). The [transient calls](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/features-and-solutions/features/redundancy-and-high-availability/transient-calls) will be released by the [Toolpack\_engine](/telecom-references/developer-reference/toolpack-api/toolpack-engine.md).

### Logs

The logs for the Toolpack Gateway Application as follows:

> \[InstallDir]/toolpack/setup/[*SystemId*](https://prosbcdocs.telcobridges.com/tmedia-documentation/products/tmedia/features-and-solutions/features/redundancy-and-high-availability/system-id)/*MajorVersion*/apps/gateway/ /lib/tb/toolpack/setup/12358/2.3/apps/gateway/ C:\TelcoBridges\toolpack\setup\12358\2.3\apps\gateway\\


---

# 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/parameter-reference/gateway.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.
