# Set Up an SMS Channel for Flowroute

Adding a Flowroute SMS (Short Message Service) channel lets your agents send and receive text messages and MMS (Multimedia Messaging Service) media, such as images, with customers straight from the Cloud Voice App. This page walks through the full setup, from generating a webhook on your PBX to routing incoming messages to the right agent or queue.

## Requirements

Confirm that both platforms meet these conditions before you start.

**Cloud Voice PBX**

- **Firmware**: Version 84.23.0.123 or later.
- **Domain name**: The PBX domain name must not contain underscore characters. An underscore causes the messaging channel to fail authentication or to stop receiving messages.
- **Domain certificate**: A valid domain certificate must be installed.

:::note
If your Cloud Voice PBX uses a custom root domain rather than a standard platform-provided domain, install a valid domain certificate before you continue. Without one, the messaging channel can fail authentication or fail to receive messages.
:::

**Flowroute**

- **API version**: v2.1. You can check or change this in the Flowroute portal under **PREFERENCE > API Control > SMS Webhook Version**.

## Supported message types and limits

The channel handles both SMS text messages and MMS multimedia messages. The MMS file types you can send are determined by Flowroute; see [Flowroute's supported MMS file types](https://support.flowroute.com/937402-Supported-MMS-file-types) for the current list.

:::caution
For outbound MMS, Flowroute downloads each attachment from a link generated by the PBX. If you have set up an Allowed Country/Region IP Access Protection rule, permit IP access from the country where Flowroute operates, otherwise the file transfer will fail.
:::

Channel limits:

- **Maximum file size**: 100 MB
- **File retention period**: 72 hours

## How the setup works

The setup has three stages:

1. Obtain a webhook URL from your Cloud Voice PBX.
2. Configure a number for SMS in Flowroute.
3. Create the SMS channel in Cloud Voice and connect it with your Flowroute credentials and number.

## Step 1. Obtain a webhook URL on the PBX

You need this webhook URL when you configure a number for SMS in Flowroute.

1. Log in to the PBX web portal and go to **Messaging > Message Channel**.
2. Click **Add** and choose **SMS**.
3. In the **ITSP** (Internet Telephony Service Provider) drop-down list, select **Flowroute**, then copy the **Webhook URL**.

:::caution
The webhook URL changes as soon as you leave this page. Always use the most recently generated URL when you configure the service provider's portal.
:::

![Cloud Voice, the SMS channel dialog with Flowroute selected and the generated webhook URL highlighted](/images/pbx/webhook-for-flowroute-pce.png)

## Step 2. Configure a number for SMS on Flowroute

:::caution
Under US legislation (A2P 10DLC), 10-digit long code (10DLC) numbers used for application-to-person messaging must be registered. SMS sent to US numbers from an unregistered 10DLC number will be blocked. If you communicate with US-based customers, confirm the requirements with Flowroute and [complete the phone number registration](https://support.flowroute.com/265034-Messaging-Guidelines---10DLC-Carrier-Fees-and-Registration) to avoid delivery disruptions.
:::

Log in to the [Flowroute portal](https://manage.flowroute.com) and complete the following.

1. Enable the messaging feature for the DID (Direct Inward Dialing) number you want to use. This is the phone number your customers will text.

   ![The Flowroute number settings with the messaging feature turned on for a DID](/images/pbx/enable-msg-for-did-flowroute.png)

2. Configure the messaging webhook to match how you want to receive inbound notifications:

   - To receive callbacks for inbound messages from one specific number, set that number's individual messaging webhook to the PBX webhook URL from Step 1.

     
     ![Cloud Voice, a single Flowroute DID configured with the PBX webhook URL](/images/pbx/set-webhook-for-did-number-flowroute-pce.png)

   - To receive callbacks for inbound messages from every number in your account, set the global messaging webhook to the PBX webhook URL.

     
     ![Cloud Voice, the Flowroute global messaging webhook set to the PBX webhook URL](/images/pbx/configure-webhook-global-flowroute-pce.png)

3. Create an API key for the integration with the PBX.

   :::caution
   Record the generated key from the pop-up window immediately. It is shown only once.
   :::

   
   ![Cloud Voice, the Flowroute dialog for creating a new API key](/images/pbx/create-api-key-flowroute.png)

4. Note the **Access Key** of the API key.

   
   ![Cloud Voice, the Flowroute API key detail showing its access key](/images/pbx/flowroute-access-key.png)

## Step 3. Create and configure the SMS channel on the PBX

Create the channel and connect it with the credentials and number you obtained from Flowroute.

1. Log in to the PBX web portal and go to **Messaging > Message Channel**.
2. Click **Add** and choose **SMS**.
3. On the **Authentication** tab, enter your Flowroute details:

   - **Name**: A label that helps you recognize the channel.
   - **ITSP**: Select **Flowroute**.
   - **Access Key**: Paste the access key you noted from Flowroute.
   - **Secret Key**: Paste the API key you created in Flowroute.

   
   ![Cloud Voice, the Authentication tab of a Flowroute SMS channel](/images/pbx/flowroute-auth-setting-pce.png)

4. On the **Messaging Settings** tab, configure the channel.

   a. In **Message Sending Rate**, set how many messages the PBX may send per second.

   :::note
   - If more messages are queued than the rate allows, the PBX holds them in a queue and sends them at the configured rate.
   - If your rate exceeds the limit set by Flowroute, messages may fail to send. Check your account's rate limit with Flowroute and raise it if needed.
   :::

   b. Configure the session settings as needed:

   - **Close Session Automatically**: Select this to have the system close sessions that have been inactive for a set period, then enter the number of days in **Session Timeout (Days)**.
   - **Allow the Creation of Duplicate Active Sessions**: Select this to allow a new session even when an active session already exists between the same sender and receiver. When enabled, if an agent starts a session in the Cloud Voice App and a matching active session already exists on the channel, the app prompts them to confirm. If they continue, the original session moves out of the previous handler's list and is taken over by the new agent, along with the full chat history.

   ![The session settings for an SMS channel, including automatic session closure](/images/pbx/auto-closure-of-conversations.png)

   c. In the **Number** section, click **Add** to create a message routing rule.

   ![Adding a message routing rule that maps a number to an inbound destination](/images/pbx/sms-did-number-rule.png)

   - **Number**: Enter your purchased number or specify an Alphanumeric Sender ID.

     :::note
     Enter the phone number in E.164 format (`[+][country code][phone number]`), for example `+14102161183`.
     :::

   - **Destination for Inbound Messaging**: Choose where inbound messages from this number go.

     - **Extension**: Pick an extension from the **Extension** drop-down list. Only that extension user receives inbound messages from the number.
     - **Message Queue**: Pick a queue from the **Message Queue** drop-down list. Every agent in the queue is notified of new sessions, but once an agent picks up a session, only that agent receives and can reply to the follow-up messages in it.
     - **Third-Party Message Analytics Platform (Transmitted via API)**: Forward inbound messages to a third-party analytics platform over the API (Application Programming Interface) for advanced processing. This requires your PBX to already be integrated with the analytics platform through the Cloud Voice API; once selected, the PBX transmits inbound messages to it automatically. Your integration can watch for the (30031) New Message Notification API event to be alerted about each inbound message, and the Cloud Voice API includes a full message API suite for two-way message interaction with the platform.

   - **Extensions allowed to create messaging sessions**: Select which extensions may start a new messaging session with customers.

   d. Click **Save**.

5. Click **Save**.

## Result

- The channel is created and appears in the Message Channel list with a green **Status** indicator, confirming the connection is active.

  ![The Message Channel list showing an active Flowroute SMS channel](/images/pbx/flowroute-sms-channel-ok.png)

- The PBX tracks the number of messages sent and received on the channel. The **Total** column shows all outbound messages, including both successful and failed sends.

  :::note
  - Sent-message counts only include messages sent from agents' Cloud Voice Apps. To calculate actual cost, ask Flowroute for the precise number of messages transmitted, since long texts (over 160 characters) are split into segments before delivery, which increases the sent count.
  - Use the time filter to narrow the statistics to a specific period.
  :::

  ![The message report with sent and received counts per channel](/images/pbx/message-report.png)

## What to do next

Send a text message to the configured number and confirm that the assigned agent receives it in the Cloud Voice App.
