# Set Up CRM Integration Features

After your phone system is linked to a custom CRM (Customer Relationship Management system, the tool your team uses to track contacts and deals), you decide which integration features to switch on. Each one is configured independently, and together they keep contacts, calls, and chat history flowing between Cloud Voice and your CRM. This page covers how to set up each feature.

## Prerequisites

You have already [connected Cloud Voice to your custom CRM using an integration template](/pbx/integrations/custom-crm-integration/integrate-cloud-voice-cloud-voice-with-a-crm-using-template/).

## Synchronize contacts

With contact synchronization on, every inbound and outbound call prompts a lookup in the CRM. When the number matches a CRM record, that contact is copied into a linked Cloud Voice phonebook. Synchronized contacts are read-only within the phone system.

1. Sign in to the phone system portal and go to **Integrations > CRM**.
2. In the **Synchronize Contacts Automatically** section, enable the switch.
3. From the **Synchronize Contacts From** drop-down, choose which contact type or types to pull from the CRM.

   ![Drop-down for selecting which CRM contact types to synchronize](/images/pbx/sync-contacts-type.png)

4. From the **Synchronize to Phonebook** drop-down, select an empty phonebook, or create a new one, to hold the contacts brought over from the CRM.

   :::note
   Contacts can only sync into a phonebook that is empty.
   :::

   ![Dialog for creating a new phonebook to store synchronized CRM contacts](/images/pbx/create-new-phonebook-for-crm.png)

5. Use the **Always Query CRM** option to decide whether contacts are searched in the CRM in real time.

   
   ![Cloud Voice, Always Query CRM setting on the CRM integration page](/images/pbx/always-query-crm.png)

   - On: the phone system queries the CRM live for contact details, and users of the linked extensions can search CRM contacts as they dial from the Cloud Voice App.
   - Off: the phone system only queries the CRM when no match is found among your company contacts.

     :::caution
     - Real-time queries increase API (Application Programming Interface) usage, so keep an eye on your quota.
     - Real-time search is not available while the masked number feature is enabled.
     :::

6. Click **Save**.

## Create contacts in the CRM

With this feature on, a new record can be added to the CRM, automatically or by the user, depending on your settings, whenever a linked extension calls, or is called by, a number the CRM doesn't already know.

1. Go to **Integrations > CRM**.
2. In the **Create New Contact** section, enable the switch.
3. From the **Create Contact or Lead** drop-down, choose the record type to create.

   ![Drop-down for choosing whether to create a contact or a lead in the CRM](/images/pbx/auto-create-contact-integration-features.png)

4. In the **Create Method** section, choose how records are created:

   - To have the system create records on its own based on the call direction:
   1. Select **Automatically**.
   2. From the **Call Type** drop-down, choose which calls trigger a new record in the CRM.

        ![Call type options for automatically creating a CRM record](/images/pbx/select-in-or-out-to-create-new-contact.png)

        - **Inbound**: an inbound call from an unknown number that matches no Contact, Lead, or Account in the CRM.
        - **Outbound**: an outbound call to an unknown number that matches no Contact, Lead, or Account in the CRM.
   - To let extension users add records themselves during a call, select **Manually**. When a user is on a call with an unknown number, they can add the contact to the CRM straight from the call window.

     ![Call window showing the option to manually add a contact to the CRM](/images/pbx/manually-create-crm-contact.png)

5. Click **Save**.

## Set up call popup

Call popup opens a contact's CRM profile for an extension user in the Cloud Voice App (Web or Desktop). You can have the profile open automatically on specific call events, or let the user open it manually from the call window during a call with a CRM contact.

1. Go to **Extension and Trunk > Extension**.
2. Click the edit icon ![Edit](/images/pbx/edit.png) for the extension tied to a CRM user.
3. On the **Cloud Voice App** tab, scroll to the client you want, then select the **Open Contact URL Using System-Integrated CRM** checkbox.
4. In the **Popup Method** section, decide how the popup behaves:

   - To have the CRM contact page open on its own:
   1. Select **Automatically (Only for Incoming Calls)**.

        ![Trigger event options for an automatic call popup](/images/pbx/call-popup-event.png)

   2. From the **Trigger Event** drop-down, set when the popup appears:
        - **Ringing**: the popup opens when an inbound call from a CRM contact begins ringing.
        - **Answered**: the popup opens when the user answers an inbound call from a CRM contact.
        - **Call End**: the popup opens when the call with a CRM contact ends.
   - To let the user open the contact URL themselves during a call with a CRM contact, select **Manually**.

     ![Call window showing the option to manually open the CRM contact URL](/images/pbx/manually-open-call-popup.png)

5. Click **Save**.

## Log calls to the CRM

With call journaling on, outbound, inbound, and missed-call records are written to the CRM automatically, giving users a record of every conversation.

1. Go to **Integrations > CRM**.
2. In the **Call Journal** section, enable the switch.
3. Set the content of the call log to suit your needs.

   ![Fields for defining the subject and description of a logged call](/images/pbx/call-log-content.png)

   - **Subject**: the subject line of the call log.
   - **Description**: the description of the call log.

   :::note
   You can build these fields from variables. See [XML Description, Call Journal Scenario Variables](/pbx/integrations/xml-descriptions-for-integration-template/#crm-integration-template-xml-description__var-2).
   :::

4. Configure the additional settings:

   - **Play Call Recording**: when enabled, CRM users tied to phone-system extensions can view and play recordings stored on the phone system directly inside the CRM.

     :::note
     When a user plays a recording in the CRM, the system requests the recording file from the phone system. For how recording data privacy is handled on their platform, contact your CRM provider.
     :::

   - **Disable Display Missed Call Records in Unanswered Agents**: when enabled, for queue and ring group calls only the answering agent's CRM receives the call log; the matching missed-call log is not written to the CRMs of agents who did not answer.

5. Click **Save**.

## Log chats to the CRM

With chat journaling on, when an external chat session between a user (tied to a phone-system extension) and a CRM contact closes, whether the user or the system ends it, every message from that session syncs to the CRM, giving users a complete history of each customer interaction.

1. Go to **Integrations > CRM**.
2. On the CRM integration page, turn on **Chat Journal**.
3. In the **Subject** field, set the subject for the synced record.

   ![Subject field for a chat record synced to the CRM](/images/pbx/chat-journal.png)

   :::note
   You can build this field from variables. See [XML Description, Chat Journal Scenario Variables](/pbx/integrations/xml-descriptions-for-integration-template/#crm-integration-template-xml-description__var-chat-journal).
   :::

4. Click **Save**.
