Newer Version Available

This content describes an older version of this product. View Latest

Two-Way Agent Status Syncing

Agent status (that is, agent presence) can be changed from the Omni-Channel widget, which sends status information to the partner connector. We added the ability to change the agent status from the connector, which passes status information back to Salesforce.

For example, a telephony partner system may have scheduled time breaks for the agents where they would want to change the agent status in Omni accordingly. If an agent is on a call, status change is ignored and doesn’t have any impact. In order to support complete two-way syncing of the status between Omni and the telephony system, the telephony system should persist a table with mapping between the Salesforce status ID and the partner status.

When the connector loads, the init() API is called, and the argument callCenterConfig contains a JSON field called userPresenceStatuses that can be parsed into a map of statusId: statusInfo. For example:

The statusId 0 is reserved for the Offline status. Other statusIDs represent Salesforce Omni-Channel presence statuses that are available for the user.

The statusInfo fields are:

  • statusName: The name of the status.
  • hasChannels: false indicates that the status is busy or offline. true indicates that it’s routable by a channel.
  • isOffline: true indicates that it’s an offline status (with statusId 0).
  • statusId: Salesforce status ID

In order to invoke the status change from the connector, call publishEvent() with the event SET_AGENT_STATUS and the required status ID. For example:

To change the status to offline:

See setAgentStatus() for information on how to update the vendor agent status when the Omni-Channel status changes.