# Set up a Live Chat Channel

Before you can embed live chat on your website, you first build a live chat channel in Cloud Voice. The channel defines who receives incoming conversations, how the widget looks and behaves, and what automatic messages visitors see. This page walks you through creating one.

## Before you begin

If you want website visitors to be able to place calls to your agents directly from the widget, set up a WebRTC (Web Real-Time Communication, the technology that carries voice calls inside a web browser) trunk and a matching inbound route ahead of time. You select both when you enable calling on the channel, so having them ready keeps the rest of the setup uninterrupted.

## Procedure

1. Sign in to the PBX (Private Branch Exchange, your phone system) web portal and go to **Messaging > Message Channel**.
2. Click **Add** and choose **Live Chat**.
3. On the **General** tab, define the core behavior of the channel.

   1. Under **Basic**, fill in the identifying details.

      ![Basic settings for a new live chat channel, including its name and website domain](/images/pbx/livechat-basic-setting.png)

      - **Name**: A label that helps you recognize this channel in the portal.
      - **Website Domain**: The domain where the widget will run.

      :::note
      The widget loads only on the domain you enter here. This restriction protects the channel from being used on other sites.
      :::

   2. Under **Interaction Mode**, decide how visitors reach your agents and where their messages land.

      ![Interaction mode options controlling how visitors contact agents and where conversations route](/images/pbx/livechat-interaction-mode.png)

      - **Interaction Mode**: Choose what the widget lets visitors do.

        | Option | What it allows |
        | --- | --- |
        | Chat Only | Visitors reach your agents through chat messages. |
        | Phone and Chat | Visitors reach your agents through chat messages or a phone call. |

        :::caution
        Calling from the widget works only when the visitor is on the site over HTTPS (HyperText Transfer Protocol Secure, the encrypted version of HTTP). If your website does not serve pages over HTTPS, phone calls will silently fail, so confirm this before choosing **Phone and Chat**.
        :::

      - **Destination**: Decide where incoming live chat messages are delivered.

        | Option | What it does |
        | --- | --- |
        | Extension | Pick an extension from the **Extension** list. Only that extension user receives the incoming messages. |
        | Message Queue | Pick a queue from the **Message Queue** list. Every agent in the queue sees new sessions, but once an agent picks up a session, only that agent receives and answers the rest of its messages. |
        | Third-Party Message Analytics Platform (Transmitted via API) | Incoming messages are forwarded automatically to an external analytics platform over the API (Application Programming Interface, the connection that lets two systems exchange data) for further processing. |

        :::note
        Automatic forwarding to a third-party analytics platform requires your PBX to be integrated with that platform through the API. With this option selected, the system pushes incoming messages to the platform, and you can track them through the new-message notification event. A full set of message API interfaces is also available for richer interaction with the connected platform.
        :::

      - **Enable WebRTC Inbound Call**: If you are letting visitors call from the widget, turn this on and select the WebRTC trunk and its inbound route.

   3. Under **Advanced**, adjust the remaining channel behavior.

      ![Advanced channel settings for concurrent call limits, allowed message types, and session timeout](/images/pbx/livechat-advanced-setting.png)

      - **Maximum Concurrent Calls**: The ceiling on simultaneous calls through this channel. Once it is reached, no new calls can be placed from the widget.

        :::note
        - Every call through live chat counts against this limit, whether an agent or a visitor started it.
        - The default is **5**, and you can raise it as high as **10**.
        :::

      - **Supported Message Types for Visitors**: What visitors are allowed to send.

        | Option | What visitors can send |
        | --- | --- |
        | Text Only | Text and emojis. |
        | Text and Image | Text, emojis, and images. |

        :::note
        A single image uploaded through the widget can be no larger than **10 MB**.
        :::

      - **Close Session Automatically**: To end sessions that sit idle, select this checkbox and enter how long a session may stay inactive in the **Session Timeout** field.

4. On the **Display & Appearance** tab, shape how the widget looks and what it shows visitors.

   :::tip
   As you make changes, the panel on the right previews the widget so you can see the result immediately.
   :::

   1. Under **Appearance**, style the widget.

      
      ![Cloud Voice, appearance controls for styling the chat widget](/images/pbx/livechat-appearance.png)

   2. Under **Display**, choose what information appears when a visitor starts a chat or a call.

      
      ![Cloud Voice, display settings for the details shown to visitors during a chat or call](/images/pbx/livechat-display.png)

      :::note
      For **Agent Information Display**, choosing **Name** or **Name and Profile Photo** shows the real name and photo of the agent handling the conversation. With any other choice, the widget shows a default agent name and photo instead.
      :::

5. In the **Message** section, set the widget's language and its automatic messages.

   1. Under **Language**, pick an entry from the list. This sets the language the widget displays.

   2. To collect visitor details before a chat begins, complete the fields under **Pre-Chat**.

      ![Pre-chat form settings for gathering visitor information before a conversation starts](/images/pbx/livechat-prechat.png)

   3. **Optional:** Under **Message**, edit the automatic replies that go out to visitors in specific situations.

      ![Auto-reply message fields for greetings, first-message responses, and session-closed notices](/images/pbx/livechat-message.png)

      :::note
      The online and offline greetings depend on your PBX office hours, so make sure business hours are configured correctly first.
      :::

      - **Online Greeting Message**: Sent when a visitor opens the chat and either the destination is a message queue during business hours, or the destination is an extension signed in to the Cloud Voice App with presence set to Available during business hours.
      - **Offline Greeting Message**: Sent when a visitor opens the chat and either the PBX is outside business hours or on a holiday, or the destination extension is logged out of the Cloud Voice App or logged in with presence set to Away, Business Trip, Do Not Disturb, Lunch Break, or Off Work.
      - **Auto-response to the First Message**: Sent when a visitor sends their first message in the chat.
      - **Chat Session Closed Message**: Sent when a session ends, whether an agent or visitor closes it manually or it closes on timeout.

6. Click **Save**.

## Result

Cloud Voice generates a code snippet for the live chat channel and shows it in a pop-up window.

![Cloud Voice, pop-up window displaying the generated live chat embed code](/images/pbx/livechat-embed-code-pce.png)

## What to do next

1. Click **Copy** to grab the code snippet.

   :::note
   You can also email the snippet and the website domain to someone else, such as your website administrator, to have them install it. The system sends the message from the default **Request to Add Live Chat to Website** template (found at **System > Email > Email Templates**) with installation instructions.

   
   ![Cloud Voice, dialog for emailing the embed code and website domain to another user](/images/pbx/livechat-send-email.png)
   :::

2. [Enable live chat on your website using the code snippet](/pbx/contact-center-guide/embed-live-chat-on-your-website/).
