# Caller Based Router

## Introduction

The Caller Based Routing skill enables a Smart App to take a call and route it based on the caller's number. By configuring Routing Rules, the Smart App will be able to implement several use cases, like:

* when a number starts with +49, route it to our German speaking department
* when a caller called before, route it to a second line department
* when a caller never called before, route it to our new customers department
* route the caller to a predefined department based on a tag set in the CRM
* etc

## Getting Started

### Channel Requirements

* [**Phone**](/studio/channels/phone.md)\
  The Caller Based Router will route the call to a specific extension or phone number based on the caller's details.

### Installation Process

The bot requires no extra information to get started.

## Using the Caller Based Router App

### App Settings

To be able to use this Smart App there are two configuration items to configure:

1. Fallback number
2. Routing rules

#### Fallback number

In the content section of the Smart App, click on the "Fallback number" page.

<figure><img src="/files/94nPqSbXNxhZviOuCTLC" alt=""><figcaption><p>Configure Fallback number</p></figcaption></figure>

Now configure the extension or phone number this Smart App should refer to when none of the Routing Rules apply based on the incoming number. This way, a phone call never gets lost, even if the rules you configured don't cover all possible cases.

#### Routing rules

Click on Routing rules in the content section of your Smart App in order to define the rules that should apply.

<figure><img src="/files/QlZYhZAPfLx59UmkDAPo" alt=""><figcaption><p>Configure routing rules</p></figcaption></figure>

1. Click on the Add rule button to add a new rule.&#x20;
2. Select the Type
3. Fill in the specific details needed for this type, like the number in case of the "number equals" type
4. Fill in the target number to which the call should be routed (this can be an extension or queue too)
5. Optionally add a tag that should be set in order to measure the number of times this rule was triggered in your Smart App in a time period

### Routing Rules

The following rules are supported:

| Routing rule       | Applies when                                                  | Example                     |
| ------------------ | ------------------------------------------------------------- | --------------------------- |
| Number equals      | the caller's number equals the configured **number**          | +316123456789               |
| Number starts with | the caller's number starts with a given **pattern**           | +49                         |
| Anonymous caller   | no phone or extension number is available in the call details |                             |
| Returning contact  | this contact called before with this number                   |                             |
| New contact        | this contact has never called before with this number         |                             |
| Number in the list | the number is included in the given **list of numbers**       | 101, 102, 103, 104, 105     |
| Custom condition   | the caller's details match a given **custom condition**       | has tags \[vip] \[customer] |

### Custom conditions

The routing rules described in the table above are quite straightforward. The "Custom condition" rule requires a bit more explanation. It uses the [Flow Conditions](/studio/flows/conditions.md) option to let you define a custom condition based on multiple expressions. This way you can base a rule on certain variables (user fields) and/or user tags.&#x20;

The ability to configure a custom condition allows for more complex use cases. For instance, using the [REST API contacts endpoint](https://developer.dialox.ai/dev/rest/#/User%20operations) or by uploading a CSV file with your customer data, it is possible to feed the DialoX CRM with your customers. You can use specific user fields or tags to indicate certain customer attributes, like which department they belong to, their customer number, their region or location, etc. Based on this information you can then configure routing rules.


---

# 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://manuals.dialox.ai/store/marketplace-apps/level-1-basic/caller-based-router.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.
