> For the complete documentation index, see [llms.txt](https://tmediadocs.telcobridges.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tmediadocs.telcobridges.com/telecom-references/developer-reference/routing-scripts/accessing-routing-script-parameters.md).

# Accessing Routing Script Parameters

[Hide TOC](/telecom-references/developer-reference/routing-scripts/accessing-routing-script-parameters.md)

### How to Access Routing Script Parameters

#### Get

This function is used to get the call parameters. The possible parameters are described in the section "Call parameters"

```
called_number = caf_call.get&nbsp;:called
```

#### List\_params

This function is used to retrieve the list of supported call parameters. For example to extract all the possible call parameters from the the call object and put it in hash.

```
caf_call.list_params.each {|param| call[param] = caf_call.get param }
```

#### Accept

This function is used to accept a call. It actually creates one outgoing route that the gateway application will use to bridge the incoming call leg. If more than one outgoing route is "accepted", the gateway will try them one by one in the same order that they were accepted. If an outgoing call leg fails (according to 'route retry' parameters), the next route in line will be used.

This method takes 2 arguments, the call parameters (hash) and the route parameters (hash). Note that calling this method does NOT stop the flow of the script.

Apply route remapping rules

```
caf_call.accept out_call, route
```

#### Refuse

This function is used to set the reason code for the incoming call leg refusal. However, this function does NOT stop the flow of the script.

```
caf_call.refuse&nbsp;:reason =&gt;&nbsp;:temporary_failure
```

To immediately refuse the incoming call leg and stop processing the script, the script must raise an exception. Exiting the script by raising the exception overwrites any reason cause previously stored using refuse().

```
raise RoutingException, :no_route
```

The supported refusal cause values for both refuse() and raise() are described in the section "[Reason values](/telecom-references/developer-reference/routing-scripts.md)".

#### Script parameters protocol mapping

The following call parameters are available in the call object. For example:

```
called_number = call[:called]
```

For information on how to use and remap call parameters, see [How to use regex in Remapped Called and Calling Number Mask](https://tmediadocs.telcobridges.com/other-pages/call-routing-scripts/how-to-use-regex-in-remapped-called-and-calling-number-mask)

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://tmediadocs.telcobridges.com/telecom-references/developer-reference/routing-scripts/accessing-routing-script-parameters.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.
