# Record

The Record component controls whether a call is recorded once the caller is connected to another party. Add it to a call flow to begin recording at that point and, if you like, play prompts that let everyone on the call know recording is happening. You can also use it the other way around, to switch recording off for a call that would otherwise be recorded.

![Record component placed on the call-flow canvas](/images/pbx/record-component-cfd.png)

:::note
After a Record component turns recording on, a second Record component cannot pause or stop it. Extension users who have the right permission can still change the recording state themselves, from **Extension and Trunk > Extension > Features > Call Recording**.
:::

![Cloud Voice, call recording permission on an extension's Features tab](/images/pbx/ext-recording-permission-cfd.png)

To stop a call from being recorded, set the component to disable recording instead.

![Record component set to disable call recording](/images/pbx/disable-call-recording-cfd.png)

## Supported prompt types

When you announce recording, you can source the audio in one of two ways.

| Prompt type | Description |
| --- | --- |
| Custom Prompt | Pick an existing custom prompt, or make a new one by recording it from an extension or uploading an audio file. |
| Text to Speech (TTS) | Type the wording you want and have it spoken in the language and voice style you choose. |

:::note
Before you can use TTS, turn the Text-to-Speech feature on under **Integrations > AI**.
:::

![Text-to-Speech feature enabled under Integrations AI](/images/pbx/enable-tts-cfd.png)

## Configure the component

1. Add the Record component to your call flow, then click it to open its settings.

   ![Opening the Record component to begin configuration](/images/pbx/record-cfd-pce.png)

2. In the **Recording** list, choose whether to enable or disable call recording.

   ![Choosing the recording status from the drop-down list](/images/pbx/recording-status-cfd-pce.png)

   :::caution
   Call-recording rules vary by location, and many require that you notify everyone on the call before recording begins. When you turn recording on, use the start-of-recording prompt or the periodic beep tone (both set up in the next step) to announce it, and check what your local rules require.
   :::

3. If you enabled recording, set up the prompts that tell participants the call is being recorded.

   :::note
   Participants in a **Conference Call** or a **Multi-party Call** do not hear these prompts.
   :::

   **Play a prompt when recording starts**

   Announce the start of recording with one or more audio prompts or a text-to-speech message.

   *Using a custom prompt:*

   ![Custom prompt settings for the start-of-recording announcement](/images/pbx/record-custom-prompt-cfd-pce.png)

   1. Select **Custom Recording Prompt**.
   2. Click **Custom Prompt**.
   3. Choose the prompt(s) to play.

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

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

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

   *Using text to speech:*

   ![Text-to-speech settings for the start-of-recording announcement](/images/pbx/record-tts-cfd.png)

   1. Select **Custom Recording Prompt**.
   2. Select **Text to Speech**.
   3. Fill in the remaining fields to turn your text into speech.

      :::note
      You can convert both static and dynamic text.

      - **Static text**: type the wording straight into the **Text** field.
      - **Dynamic text**: type the wording and add placeholders backed by [variables](/pbx/call-flow-designer-guide/constants-and-variables-in-cloud-voice-cfd-expression/) so the message is composed on the fly. You can also set a generation timeout; if the speech is not ready in time, the caller moves on to the next component without hearing a prompt.
      :::

      ![Example of dynamic text-to-speech in the Record component](/images/pbx/cfd-tts-example.gif)

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

   **Play a prompt while recording continues**

   Play a periodic beep so participants know the recording is still running.

   ![Beep-tone settings for ongoing recording](/images/pbx/recording-beep-cfd.png)

   1. Select **Play Beep Tone Periodically During Call Recording**.
   2. In **Interval Duration(s)**, enter how many seconds to wait between beeps.

4. Click **Confirm** in the bottom-right corner. The recording status then shows on the component.

   ![Record component displaying its enabled recording status](/images/pbx/recording-enabled-cfd.png)

## Component variable

When a Record component uses TTS, the system saves the outcome of that conversion in a variable. You can read this variable from components that accept expressions, Condition, for example, and branch the call on the result.

:::note
Because a call flow can contain more than one Record component, each is numbered in the order you add it (Record 1, Record 2, and so on). Include the matching index in the variable name so you read the value from the component you mean.
:::

| Variable | Type | Description | Example value |
| --- | --- | --- | --- |
| `$Record{index}.ttsResult` | String | The text-to-speech outcome for the Record component. `RecordTTSResult.Success` means the text was spoken to the caller; `RecordTTSResult.Timeout` means it was not generated in time, so the caller was sent straight to the next component with no prompt. | `$Record1.ttsResult(STRING)=RecordTTSResult.Timeout` |

## Connect the component

A Record component connects to exactly **one** downstream component, which takes over once recording is set. You can connect any of the components below.

| 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/) | Offers callers a set of options and routes on the DTMF (Dual-Tone Multi-Frequency, the tones a phone sends when a caller presses keypad keys) digit they press. |
| [User Input](/pbx/call-flow-designer-guide/user-input/) | Collects DTMF digits from the caller, usually paired with Condition to route on what was entered. |
| [Language](/pbx/call-flow-designer-guide/language/) | Switches 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 their destination. |
| [Dial by Name](/pbx/call-flow-designer-guide/dial-by-name/) | An end component that lets callers reach a user by typing the first three letters of their name. |
| [Transfer](/pbx/call-flow-designer-guide/transfer/) | An end component that hands the caller to a set destination, with an optional 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 according to 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 from and writes to 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. |
