# Dial by Number

The Dial by Number component lets a caller reach a destination by dialing its number on the keypad, without waiting to be routed by a menu. This section explains what the component can reach, how to prompt callers for input, and how to configure the numbers it accepts.

## Overview

When a call reaches a Dial by Number component, the caller can dial a number to be connected to one of the following destinations:

- Extension
- Ring Group
- Queue
- Conference
- Call Flow
- Paging
- IVR (Interactive Voice Response, an automated menu)
- External Number
- Check Voicemail (extension voicemail or group voicemail)

![The Dial by Number component shown on the call flow canvas](/images/pbx/dial-by-number-component-cfd.png)

### Prompts

You can play a prompt to tell callers what to dial. Three prompt types are available.

| Prompt type | What it does |
|-------------|--------------|
| Custom Prompt | Plays one of your existing custom prompts, or a new one you record from an extension or upload as an audio file. |
| Music on Hold (MoH) | Plays an existing Music on Hold profile. Configure the profile you want under **PBX Settings > Voice Prompt > Music on Hold** before you select it here. |
| Text to Speech (TTS) | Reads out text you enter, converted to speech in the language and voice style you pick. Enable Text-to-Speech under **Integrations > AI** before you use it. |

### End keys

An end key tells the system that the caller has finished entering a number, so it can stop collecting input and route the call. Supported end keys are `#`, `*`, a numeric key, or no key at all. Set the end key under **Call Flow Designer > Options**.

![Setting the end key under Call Flow Designer Options](/images/pbx/endkey-cfd.png)

:::note
With no end key set, the caller is routed to the next component only when their input matches an allowed number or when the timeout is reached.
:::

## Configure the numbers callers can dial

After you drop a Dial by Number component onto the canvas, click it to open its settings, then work through the prompt, the allowed numbers, and the input timeouts.

![Opening the Dial by Number component to edit its settings](/images/pbx/dial-by-number-cfd.png)

### 1. Set the prompt

Choose one prompt type and configure it.

**Custom Prompt**

![Selecting a custom prompt for the component](/images/pbx/custom-prompt-initial-action.png)

1. Click **Custom Prompt**.
2. Add up to **5** prompts. For each one, either pick an existing recording from the **Prompt** drop-down, or click **Record New** to capture it from an extension, or click **Upload** to add an audio file.

   :::note
   Prompts you record or upload here are also saved under **PBX Settings > Voice Prompt > Custom Prompt**.
   :::

3. Optional: to repeat the prompt(s) continuously, select **Enable Loop Playback**.

   :::note
   A looped prompt stops and is replaced if the next connected component has its own prompt.
   :::

**Music on Hold (MoH)**

![Selecting a Music on Hold profile for the component](/images/pbx/select-moh-initial-action.png)

1. Select **Music on Hold**.
2. Pick an existing profile from the **Music on Hold** drop-down.

   :::note
   The music stops and is replaced if the next connected component has its own prompt.
   :::

**Text to Speech (TTS)**

![Entering text and a generation timeout for a text-to-speech prompt](/images/pbx/tts-prompt-default-timeout.png)

1. Select **Text to Speech**.
2. Fill in the rest of the fields to turn your text into speech. You can use static or dynamic text:
   - **Static text**: type the words directly in the **Text** field.
   - **Dynamic text**: type the words and insert placeholders backed by [variables](/pbx/call-flow-designer-guide/constants-and-variables-in-cloud-voice-cfd-expression/) so the message is composed at call time. You can also set a generation timeout; if the speech is not ready within that window, the caller moves on to the next component without hearing the prompt.

   ![Example of a text-to-speech prompt built with dynamic placeholders](/images/pbx/cfd-tts-example.gif)

Generated speech is saved and synced to **PBX Settings > Voice Prompt > Custom Prompt**.

### 2. Choose which numbers are allowed

Turn on any combination of the following options to control what callers can dial.

**Dial Extensions**

![Choosing which extensions callers may dial](/images/pbx/dial-ext-cfd.png)

1. Turn on **Dial Extensions**.
2. Open the **Extension Scope** drop-down and select one:
   - **All Extensions**: callers can dial any extension.
   - **Allowed Extensions**: callers can dial only the extensions you move from the **Available** box to the **Selected** box.
   - **Restricted Extensions**: callers can dial any extension except the ones you move from the **Available** box to the **Selected** box.

**Dial Numbers**

![Selecting the numbers callers may dial](/images/pbx/dial-number-cfd.png)

1. Turn on **Dial Numbers**.
2. Move the numbers you want to allow from the **Available** box to the **Selected** box.

**Dial External Number**

![Selecting the outbound routes callers may use](/images/pbx/dial-ext-number-cfd.png)

1. Turn on **Dial External Number**.
2. Move the outbound routes you want to allow from the **Available** box to the **Selected** box.

:::danger
With Dial External Number on, any caller who reaches this component can place outbound calls through the outbound routes you select, and those calls are billed to your account. On a call flow that outside callers can reach, this is a toll-fraud exposure. Leave the option off unless callers genuinely need to dial out, and select only the specific outbound routes you trust rather than all of them.
:::

**Dial to Check Voicemail**

![Enabling voicemail access from the component](/images/pbx/dial-check-vm-cfd.png)

1. Turn on **Dial to Check Voicemail**.
2. Click **OK** in the confirmation window. Callers can then reach extension or group voicemail by dialing the Check Voicemail feature code plus the extension number or group voicemail number, followed by the voicemail access PIN.

   :::note
   To change the feature code or a PIN:

   - **Check Voicemail feature code**: the default is `*2`. Change it under **Call Features > Feature Code > Voicemail > Check Voicemail/Subscribe Voicemail Status**.

     ![The Check Voicemail feature code setting](/images/pbx/vm-feature-code-cfd.png)

   - **Extension voicemail access PIN**: change it under **Extension and Trunk > Extension > Voicemail > Voicemail Access PIN**.

     
     ![Cloud Voice, the voicemail access PIN field on an extension](/images/pbx/ext-vm-pin-cfd.png)

   - **Group voicemail access PIN**: change it under **Call Features > Voicemail > Group Voicemail > Voicemail Access PIN**.

     ![The voicemail access PIN field for a group voicemail](/images/pbx/group-vm-pin-cfd.png)
   :::

### 3. Set the input timeouts

![Setting the digit and component response timeouts](/images/pbx/dial-by-number-timeout-cfd.png)

- **Digit Timeout(s)**: how long the system waits for the caller to press the next digit. Pick a value from the drop-down or enter any value from 1 to 9999.
- **Component Response Timeout(s)**: how long the system waits for the caller to act at all. Pick a value from the drop-down or enter any value from 1 to 9999.

## Set a retry strategy for no match

Every Dial by Number component includes a **No Match** branch that handles input the component does not accept. You can give callers another chance instead of routing them straight down that branch.

1. Click the **No Match** branch.

   ![The No Match branch settings for the component](/images/pbx/dial-by-number-invalid.png)

2. Select **Return to Previous Step**.
3. In the **Return Count** drop-down, choose how many times a caller may be sent back to the component after a failed match.
4. Optional: add an audio prompt or a text-to-speech message that asks the caller to try dialing again.
5. Click **Confirm** in the bottom-right corner.

## Component variable

When a Dial by Number component uses a TTS prompt, the system records the outcome in a variable. You can read that variable in components that support expressions, such as [Condition](/pbx/call-flow-designer-guide/condition/), and route the call based on its value.

:::note
Because a call flow can contain more than one Dial by Number component, each is numbered by the order in which it was added (Dial by Number 1, Dial by Number 2, and so on). Include the matching index in the variable name to read the value from the right component.
:::

| Variable | Type | Description | Example |
|----------|------|-------------|---------|
| `$DialByNumber{index}.ttsResult` | String | The text-to-speech outcome for the component. `DialByNumberTTSResult.Success` means the text was converted and played to the caller. `DialByNumberTTSResult.Timeout` means the speech was not ready in time, so the caller was routed to the next component without hearing it. | `$DialByNumber1.ttsResult(STRING)=DialByNumberTTSResult.Success` |

## Connections

The **No Match** branch can connect to a **single** downstream component, chosen from any of the following.

| Component | What it does |
|-----------|--------------|
| Prompt | Plays an audio prompt or a text-to-speech message to callers. See [Prompt](/pbx/call-flow-designer-guide/prompt/). |
| Business Hours | Routes calls to different destinations based on the time of day. See [Business Hours](/pbx/call-flow-designer-guide/business-hours/). |
| Menu | Presents a set of menu options and routes calls by the DTMF (Dual-Tone Multi-Frequency, the tone a phone keypad sends) digit the caller presses. See [Menu](/pbx/call-flow-designer-guide/menu/). |
| User Input | Collects DTMF digits from callers, usually paired with Condition to evaluate the input and route the call. See [User Input](/pbx/call-flow-designer-guide/user-input/). |
| Language | Changes the system prompt language for the components that follow. See [Language](/pbx/call-flow-designer-guide/language/). |
| Record | Starts recording once the caller is connected to another party, with optional prompts at the start and during the call, or disables recording for calls that would otherwise be recorded. See [Record](/pbx/call-flow-designer-guide/record/). |
| Dial by Number | Lets callers dial a number to reach a destination. See [Dial by Number](/pbx/call-flow-designer-guide/dial-by-number/). |
| Dial by Name | A terminating component that lets callers reach an extension by entering the first three letters of a user's name. See [Dial by Name](/pbx/call-flow-designer-guide/dial-by-name/). |
| Transfer | A terminating component that sends callers to a set destination, with an optional prompt to announce the transfer. See [Transfer](/pbx/call-flow-designer-guide/transfer/). |
| Hang Up Call | A terminating component that disconnects the call. See [Hang Up Call](/pbx/call-flow-designer-guide/hang-up-call/). |
| Condition | Routes calls based on logical expressions. See [Condition](/pbx/call-flow-designer-guide/condition/). |
| Loop | Runs a group of components repeatedly, either a set number of times or until a condition is met. See [Loop](/pbx/call-flow-designer-guide/loop/). |
| Internal Data Ops | Reads and writes data in the PBX's own database. See [Get Extension Presence Status](/pbx/call-flow-designer-guide/get-extension-presence-status/), [Set Extension Presence Status](/pbx/call-flow-designer-guide/set-extension-presence-status/), [Get Queue Agent](/pbx/call-flow-designer-guide/get-queue-agent/), [Get Queue Info](/pbx/call-flow-designer-guide/get-queue-info/), [Get Agent Status](/pbx/call-flow-designer-guide/get-agent-status/), [Set Agent Status](/pbx/call-flow-designer-guide/set-agent-status/), [Get System Info](/pbx/call-flow-designer-guide/get-system-info/), [Get System Capacity](/pbx/call-flow-designer-guide/get-system-capacity/), [Get Extension Info](/pbx/call-flow-designer-guide/get-extension-info/), and [Get Company Contact Info](/pbx/call-flow-designer-guide/get-company-contact-info/). |
| Email Sender | Sends email for real-time notifications, alerts, or user-specific details. See [Email Sender](/pbx/call-flow-designer-guide/email-sender/). |
| Database Access | Runs SQL against a database during the call flow to retrieve or update records. See [Database Access](/pbx/call-flow-designer-guide/database-access/). |
| HTTP Request | Sends HTTP requests to outside web servers to exchange data with third-party services. See [HTTP Request](/pbx/call-flow-designer-guide/http-request/). |
