Omnichannel

Omnichannel

Mandatory: No

Description: The Omnichannel feature serves as an agent-state management system designed to streamline work distribution across multiple agent teams. Additionally, it acts as a communication bridge between the CRM and the CRM Connector solution, ensuring that the agent's state remains synchronized with the overall user presence within the CRM.

The CRM Connector solution provides two settings for this feature which can be changed within the Contact Center Definition (CCDef):

  • Synchronized (S): It ensures the fact that the Agent State inside the CRM Connector application is the same as the overall user presence within the CRM.
  • Complementary (C): It ensures the fact that both states cannot be Ready at the same time. NOTE: They can be Not Ready at the same. Whenever one of the states becomes Ready the other one automatically becomes Not Ready.

The Omnichannel feature ensures the fact that the agent cannot receive work on a channel if the other has work assigned. For example if the agent receives a ticket in the CRM, CRM Connector will set the agent state to Not Ready and vice-versa. When an agent receives an interaction within the CRM Connector application, a change state request will also be sent to the CRM to set the general user presence to Not Ready.

This feature requires a two-way communication between the CRM and the CRM Connector application.

  1. The Client Application must implement an Omnichannel listener which sends a omnichannelResponse Client Action whenever the user presence within the CRM changes.
  2. The Client Application must implement an in-place event handling mechanism to listen to the CRM Connector requests.

CRM Connector event handling example

const processCRMEvent = (event) => {
  // Make sure to fetch the CRM Connector origin
  if (event.origin !== crmConnectOrigin) {
    return;
  }

  const { action, data } = event.data;
  clientIframe = {} as HTMLElement // fetch the client iframe HTML element

  if (action === 'requestSyncOmnichannel') {
    processRequestSyncOmnichannel(data);
  }
  // ... Other CRM events
}

processRequestSyncOmnichannel example

// The `data` parameter is the CRM Connector event payload.
// The payload JSON definition will be at the bottom of the page 

const processRequestSyncOmnichannel = (data) => {
  if (!data) {
    return;
  }
  setOmnichannelState(data.statusId.split(';')[0]);
}

setOmnichannelState example

// Dummy implementation
// CRM presence setter implementation using the CRM's API
const setOmnichannelState = (newState) => {
  CRMFramework.setOmnichannelState(newState).then((result) => {
    if (result) {
      return Promise.resolve(result)
    }
  }).catch((error) => {
    return Promise.reject(error)
  });
}

CRM Omnichannel listener example

// Dummy implementation
// CRM presence change event listener using the CRM's API
CRMFramework.addEventHandler('presenceChangeEvent', eventData => {
  if (eventData) {
    // This const represents the required CRM Connector message payload.
    // Mor of this at the bottom of the page
    const state = {
      statusId: eventData.newState,
      success: true
    };

    // Your own implementation of the publishMessage mechanism
    publishMessage(clientIframe, crmConnectOrigin, 'omnichannelResponse', state);
  } else {
    // Error handling
  }
});

Message formats

CRM Connector

{ "type": "CRMConnectMessage", "action": "requestSyncOmnichannel", "data": <crmObjectData> }

Client Application

{ "type": "ClientAppMessage", "action": "crmDirectory", "data": <crmDirectoryObject> }

CRM Object/Client Application Data format

{
  "statusId": <string>,
  "success": <boolean>
}