# Maintenance mode - ProSBC and TMG

## Graceful Shutdown for new incoming calls

This guide outlines the procedure for isolating a Telcobridges TMG or ProSBC systems to perform bleed off active calls for maintenance period.&#x20;

This method allows existing calls to finish naturally while elegantly rejecting all new incoming calls with specific cause codes.

***

### 🛠 Prerequisites

* Access to the Web User Interface.
* Permissions to edit and activate Routing Scripts.
* A defined configuration for testing.  Our example: (e.g., `MSGC_TG_V11_DaveTest`).

***

### 📝 Step 1: Modify the Routing Script

To stop new calls from being processed, you must add a before filter to your main simple\_routing script.rb file. &#x20;

1. Navigate and click >> **Routing Scripts** left-hand side of the menu.&#x20;
2. Click on `simple_routing.rb`.&#x20;

<figure><img src="/files/arlfJWZiNFsfM6PUwlnB" alt=""><figcaption></figcaption></figure>

3. Locate the `class SimpleRouting < BaseRouting` definition line within the script.
4. Add the following line as a `before_filter`: right below last Include line. &#x20;

<figure><img src="/files/dr97oxIkDJL4KyaxkXLR" alt=""><figcaption></figcaption></figure>

```ruby
before_filter :proc => proc { |p| raise RoutingException, :no_circuit_available }
```

5. Scroll down to the bottom of the simple\_routing.rb script page and save.

<figure><img src="/files/iX96KY1UMsDyGbqDN9eZ" alt=""><figcaption></figcaption></figure>

6. Validate the configuration change.  Activate the configuration change.&#x20;

<figure><img src="/files/bS5QOJvzNoesz4uKOqQk" alt=""><figcaption></figcaption></figure>

Note: Activation of new configuration will NOT terminate active calls.&#x20;

7. Monitor Call Trace Page

<figure><img src="/files/KooDT3r0zBXcCu8VHr4V" alt=""><figcaption></figcaption></figure>

&#x20;8\. Monitor Call Status Page

<figure><img src="/files/iTMSWmudQO3gdaLVM10R" alt=""><figcaption></figcaption></figure>

Quick Notes: &#x20;

Insert a # character in front the before\_filter to deactivate the call rejection progress.&#x20;

```
## before_filter :proc => proc { |p| raise RoutingException, :no_circuit_available }
```

You can also modify your cause code to your preference.  <mark style="color:yellow;">no\_circuit\_available</mark>

```
before_filter :proc => proc { |p| raise RoutingException, :no_circuit_available }
```

Reaon Cause Mapping definitions can be found in Web UI >> Profiles >> "Selected Profile" >> Edit Reason Cause Mapping

<figure><img src="/files/eV1o1VsvOFCceEXeZRUs" alt=""><figcaption></figcaption></figure>

Activate Call rejection.  before\_script is working...&#x20;

<figure><img src="/files/Iif6khUn18GNezJOoEmj" alt=""><figcaption></figcaption></figure>

Deactivate Call rejection. before\_script is not-working...

<figure><img src="/files/rYSI1oFwkuF8Qg38vAJj" alt=""><figcaption></figcaption></figure>

Repeat Step 5 and 6.  Save Script.  Validate and Activate new configuration.&#x20;


---

# 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/tools-tips-and-tricks/maintenance-mode-prosbc-and-tmg.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.
