> 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/telecom-concepts/terminating-calls.md).

# Terminating Calls

[Hide TOC](/telecom-references/telecom-concepts/terminating-calls.md)

### Introduction

In release 2.8, it is now possible to terminate a call through the routing scripts. The \[\[#Reason values|reason code]] must be specified in

`params[:bridge][:reason]`. The `:terminate` hash must be created and copied into `params`: terminate = {} params\[:terminate] = terminate

The following fields can then be set in `:terminate`:

* `:sip_header`
* `:contacts` # list of contacts as described in the \[\[#Redirection|redirection]] section
* `:isup_raw`
* `:isup_raw_variant`
* `:redirecting_number`
* `:redirecting_number_noa`
* `:redirecting_number_npi`
* `:redirecting_number_presentation`
* `:redirecting_number_reason`
* `:redirecting_number_counter`
* `:redirecting_number_indicator`
* `:original_called_number`
* `:original_called_number_noa`
* `:original_called_number_npi`
* `:original_called_number_presentation`
* `:original_called_number_reason`
* `:original_called_number_counter`

### Reason values

Check here for Termination Reason Cause codes:

[Termination Reason Cause codes](https://github.com/telcobridges-main/tmedia-wiki/tree/main/reference/concepts/termination-cause-codes/README.md)

Example to refuse an incoming call leg. raise RoutingException, :no\_route

Reason cause strings available inside routing scripts:

#### List of Q.850 reason causes

> unallocated\_number no\_route\_to\_network no\_route\_to\_destination send\_special\_tone misdialled\_trunk\_prefix channel\_unacceptable call\_awarded\_in\_established\_channel preemption reattempt qor\_ported\_number normal\_call\_clearing user\_busy no\_user\_responding no\_answer\_from\_user subscriber\_absent call\_rejected number\_changed redirection exchange\_routing\_error non\_selected\_user\_clearing destination\_out\_of\_order address\_incomplete facility\_rejected response\_to\_status\_enquiry normal\_unspecified no\_circuit\_available network\_out\_of\_order frame\_mode\_out\_of\_service frame\_mode\_connection\_operational temporary\_failure switching\_equipment\_congestion access\_information\_discarded requested\_circuit\_not\_available precedence\_call\_blocked resource\_unavailable quality\_of\_service\_not\_available requested\_facility\_not\_subscribed outgoing\_calls\_barred outgoing\_calls\_barred\_within\_cug incoming\_calls\_barred incoming\_calls\_barred\_within\_cug bearer\_cap\_not\_authorized bearer\_cap\_not\_available inconsistency\_access\_info service\_not\_available bearer\_cap\_not\_implemented channel\_type\_not\_implemented requested\_facility\_not\_implemented only\_restricted\_digital\_info service\_not\_implemented invalid\_call\_reference channel\_does\_not\_exist call\_identity\_does\_not\_exist call\_identity\_in\_use no\_call\_suspended call\_has\_been\_cleared user\_not\_member\_of\_cug incompatible\_destination non\_existant\_cug invalid\_transit\_network invalid\_message\_unspecified mandatory\_ie\_missing message\_type\_non\_existent message\_not\_compatible\_with\_call\_state ie\_non\_existent invalid\_ie\_content msg\_not\_compatible\_with\_call\_state recovery\_on\_timer\_expiry parameter\_non\_existent\_passed\_on message\_with\_non\_recognized\_parameters\_discarded protocol\_error interworking\_unspecified

#### List of toolpack reason causes

> toolpack\_normal or :normal toolpack\_resource\_error or :resource\_error toolpack\_timeout or :timeout toolpack\_no\_route or :no\_route toolpack\_call\_collision or :call\_collision toolpack\_sync\_drop or :sync\_drop toolpack\_signaling\_error or :signaling\_error toolpack\_locally\_rejected or :locally\_rejected toolpack\_interface\_not\_available or :interface\_not\_available toolpack\_reset\_in\_progress or :reset\_in\_progress toolpack\_adapter\_reject or :adapter\_reject toolpack\_missing\_or\_invalid\_ie or :missing\_or\_invalid\_ie toolpack\_incoming\_only or :incoming\_only toolpack\_system\_configuration\_changed or :system\_configuration\_changed toolpack\_resource\_no\_more\_available or :resource\_no\_more\_available toolpack\_incompatible\_media or :incompatible\_media toolpack\_resource\_allocation\_failed or :resource\_allocation\_failed toolpack\_data\_path\_not\_available or :data\_path\_not\_available toolpack\_local\_congestion or :local\_congestion toolpack\_authorization\_required or :authorization\_required toolpack\_call\_divert\_is\_not\_allowed or :call\_divert\_is\_not\_allowed

#### List of SIP reason causes

Reason causes starting with a digit must use the following syntax (can't use : as prefix).

```
'300_multiple_choices'
'301_moved_permanently'
'302_moved_temporarily'
'305_use_proxy'
'380_alternative_service'
'400_bad_request'
'401_unauthorized'
'402_payment_required'
'403_forbidden'
'404_not_found'
'405_method_not_allowed'
'406_not_acceptable'
'407_proxy_authentication_required'
'408_request_timeout'
'409_conflict'
'410_gone'
'413_request_entity_too_large'
'414_request_URI_too_long'
'415_unsupported_media'
'416_unsupported_URI_scheme'
'420_bad_extension'
'421_extension_required'
'422_session_timer_too_small'
'423_interval_too_brief'
'429_referrer_identity_error'
'480_temporary_unavailable'
'481_call_or_transaction_does_not_exist'
'482_loop_detected'
'483_too_many_hops'
'484_address_incomplete'
'485_ambiguous'
'486_busy_here'
'487_request_terminated'
'488_not_acceptable_here'
'489_bad_event'
'491_retry_after'
'500_server_internal_error'
'501_not_implemented'
'502_bad_gateway'
'503_service_unavailable'
'504_server_timeout'
'505_version_unsupported'
'513_message_too_large'
'600_busy_everywhere'
'603_decline'
'604_not_exist_anywhere'
'606_not_acceptable'
```

![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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://prosbcdocs.telcobridges.com/telecom-references/telecom-concepts/terminating-calls.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
