lightning:omniChannelStatusChanged

Indicates that an agent has changed his or her presence status in Omni-Channel.

Response 

NameTypeDescription
statusIdstringThe ID of the agent’s current presence status.
channelsstringJSON string of channel objects.
reasonstringThe reason for the user’s status change. Possible values are:
  • OmniToolkitStatusChange
  • OmniPushTimeout
  • OmniDeclineWork
  • OmniManualStatusChange
  • OmniSupervisorStatusChange
  • OmniLoginStatusChange
statusNamestringThe name of the agent’s current presence status.
statusApiNamestringThe API name of the agent’s current presence status.

Example 

This example prints status details to the browser’s developer console when an Omni-Channel user’s presence status is changed.

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2    <lightning:omniToolkitAPI aura:id="omniToolkit" />  
3    <aura:handler event="lightning:omniChannelStatusChanged" action="{! c.onStatusChanged }"/>
4</aura:component>

Controller code:

1({
2    onStatusChanged : function(component, event, helper) {
3        console.log("Status changed.");
4        var statusId = event.getParam('statusId');
5        var channels = event.getParam('channels');
6        var statusName = event.getParam('statusName');
7        var statusApiName = event.getParam('statusApiName');
8        console.log(statusId);
9        console.log(channels);
10        console.log(statusName);
11        console.log(statusApiName);
12    }, 
13})

channel 

The channel object contains the following properties:

NameTypeDescription
channelIdstringRetrieves the ID of the service channel that’s associated with a presence status.
developerNamestringRetrieves the developer name of the service channel that’s associated with the channelId.