# Initial Action

Initial Action is where every call flow begins. It defines which number or numbers callers dial to enter the flow, and it can play an opening prompt that greets callers or tells them what to do next.

Each call flow has exactly one Initial Action component. Cloud Voice adds it automatically when you create the flow, and you cannot remove it.

![Initial Action placed at the start of the call-flow canvas](/images/pbx/initial-action-component-cfd.png)

## Numbers you can assign

Callers reach the flow by dialing a number tied to the Initial Action component. You can use an internal extension, one or more trunk DID numbers, or both. A DID (Direct Inward Dialing) number is a public phone number that routes an outside caller straight to a specific internal destination.

| Number type | Details |
| --- | --- |
| Extension number | Cloud Voice sets aside the range **6900 to 6999** for call flows. When you create a flow, it takes the first free number in that range, but you can also enter a custom number from outside it. |
| Trunk DID number(s) | Assign one or more of your trunk DID numbers so external callers can dial straight into the flow. |

:::note
To change the extension range reserved for call flows, go to **PBX Settings > Preferences > Extension Preferences > Call Flow**.

![Setting the extension range reserved for call flows](/images/pbx/call-flow-ext-range.png)
:::

:::note
Manage the DID numbers on your SIP (Session Initiation Protocol) trunks under **Extension and Trunk > Trunk > DIDs/DDIs**.

![Cloud Voice, DID numbers listed for a SIP trunk](/images/pbx/did-call-flow.png)

When the same DID is used by both a call flow and an inbound route, the call flow wins. While the flow is **enabled**, calls to that DID enter the flow; if it is disabled, they fall back to the inbound route's destination instead.
:::

## Prompts you can play

Adding an opening prompt is optional. When you want one, pick from the following types.

| Prompt type | Details |
| --- | --- |
| Custom Prompt | Pick an existing custom prompt, or make a new one by recording it from an extension or uploading an audio file. |
| Music on Hold (MoH) | Play one of your existing Music on Hold selections. |
| Text to Speech (TTS) | Type the text you want callers to hear; Cloud Voice reads it aloud in the language and voice you choose. |

:::note
Before choosing Music on Hold, confirm the option you want exists under **PBX Settings > Voice Prompt > Music on Hold**.

![Music on Hold options available to the call flow](/images/pbx/moh-call-flow.png)
:::

:::note
Text to Speech requires the feature to be turned on first under **Integrations > AI**.

![Enabling the Text-to-Speech integration](/images/pbx/enable-tts-cfd.png)
:::

## Configure the component

1. Once the call flow exists, click the Initial Action component to open its settings.

   ![Opening the Initial Action component to begin configuration](/images/pbx/initial-action-cfd.png)

2. Set the number or numbers that callers dial to start the flow.

   ![Assigning the number and DIDs that trigger the flow](/images/pbx/number-initial-action.png)

   | Field | Details |
   | --- | --- |
   | Number | Keep the extension Cloud Voice assigned, or type your own. |
   | DID | Optional. Choose one or more trunk DID numbers from the list. |

   :::caution
   A custom number may sit outside the default **6900 to 6999** range. Once you save, the assigned number is locked and cannot be changed. To use a different number later, you would have to recreate the call flow, so double-check it before saving.
   :::

   :::note
   You can assign up to **500** DID numbers, but the larger the list, the longer it takes to match an incoming call to the flow. A call from a DID reaches the flow only when:

   - The received DID is **7 digits or fewer** and matches an assigned DID exactly, or
   - The received DID is **longer than 7 digits** and its **last 7 digits** match an assigned DID exactly.
   :::

3. Optional: add an opening prompt or a text-to-speech message to greet callers or guide them. Configure whichever type you chose.

   **Custom Prompt**

   ![Configuring custom prompts on the Initial Action component](/images/pbx/custom-prompt-initial-action.png)

   1. Select **Custom Prompt**.
   2. Choose your prompt or prompts.

      :::note
      You can add up to **5** custom prompts.
      :::

      - To reuse a saved prompt, pick it from the **Prompt** list.
      - To add a new one, click **Record New** to record from an extension, or **Upload** to add an audio file.

        :::note
        New prompts are stored under **PBX Settings > Voice Prompt > Custom Prompt**.
        :::

   3. Optional: to repeat the prompt or prompts continuously, select **Enable Loop Playback**.

      :::note
      A looping prompt stops if the next connected component has its own prompt, which takes over.
      :::

   **Music on Hold (MoH)**

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

   1. Select **Music on Hold**.
   2. Pick an existing selection from the **Music on Hold** list.

      :::note
      The Music on Hold stops if the next connected component has its own prompt, which takes over.
      :::

   **Text to Speech (TTS)**

   ![Entering text-to-speech content for the Initial Action component](/images/pbx/tts-initial-action.png)

   1. Select **Text to Speech**.
   2. Fill in the remaining settings. Cloud Voice converts your text to speech using those settings.

      :::note
      The generated audio is saved to the system and synced to **PBX Settings > Voice Prompt > Custom Prompt**.
      :::

4. Click **Confirm** in the bottom-right corner. The number you chose then appears on the component.

   ![The Initial Action component showing its assigned number](/images/pbx/initial-action-selected-cfd.png)

## Connect the next component

Initial Action connects to exactly **one** downstream component, which takes over once a caller enters the flow. You can connect any of the following.

| Component | What it does |
| --- | --- |
| [Prompt](/pbx/call-flow-designer-guide/prompt/) | Plays an audio prompt or a text-to-speech message to the caller. |
| [Business Hours](/pbx/call-flow-designer-guide/business-hours/) | Routes calls to different destinations based on the time of day. |
| [Menu](/pbx/call-flow-designer-guide/menu/) | Presents a set of options and routes the call on the DTMF (Dual-Tone Multi-Frequency) keypad digit the caller presses. DTMF is the tone a phone makes when a key is pressed. |
| [User Input](/pbx/call-flow-designer-guide/user-input/) | Collects DTMF digits, typically paired with Condition to route on what the caller entered. |
| [Language](/pbx/call-flow-designer-guide/language/) | Changes the system-prompt language for the components that follow. |
| [Record](/pbx/call-flow-designer-guide/record/) | Starts recording once the caller connects to another party, with optional notice prompts, or disables recording for a call that would otherwise be recorded. |
| [Dial by Number](/pbx/call-flow-designer-guide/dial-by-number/) | Lets callers dial a number directly to reach a destination. |
| [Dial by Name](/pbx/call-flow-designer-guide/dial-by-name/) | An end component that lets callers reach a user by entering the first three letters of their name. |
| [Transfer](/pbx/call-flow-designer-guide/transfer/) | An end component that sends the caller to a set destination, optionally with a prompt announcing the transfer. |
| [Hang Up Call](/pbx/call-flow-designer-guide/hang-up-call/) | An end component that disconnects the caller. |
| [Condition](/pbx/call-flow-designer-guide/condition/) | Routes calls based on logical expressions. |
| [Loop](/pbx/call-flow-designer-guide/loop/) | Repeats a group of components a set number of times or until a condition is met. |
| Internal Data Ops | Reads and updates data in the PBX's built-in 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](/pbx/call-flow-designer-guide/email-sender/) | Sends email for real-time notifications, alerts, or user-specific information. |
| [Database Access](/pbx/call-flow-designer-guide/database-access/) | Runs SQL against a database mid-call to read or update data. |
| [HTTP Request](/pbx/call-flow-designer-guide/http-request/) | Sends HTTP requests to external servers to exchange data with third-party services. |
