Using Lightning Message Channel

The SiX Agent is set up to accept many different types of events.  Events can be sent to the SiX Agent by using Salesforce's Lightning Message Channel and referencing the channel SiX__agentLMC__c.  This can be done from both Lightning Web Components and VisualForce Pages.

1

Send Events From VSP

<apex:page >
   <script>
   // Load the MessageChannel token in a variable
   var SAMPLEMC = "{!$MessageChannel.SiX__agentLMC__c}";
   function handleClick() {
      const let payLoad = {
      "type":"SIX_CUSTOM_EVENT","subType":"ADD_WHAT_HISTORY","data":{"what":{"id":"123","label":"123","isStandalone":"N"}}
      }
      sforce.one.publish(SAMPLEMC, payload);
   }
   </script>
   <div>
   <p>Publish SampleMessageChannel</p>
   <button onclick="handleClick()">Publish</button>
   </div>
</apex:page>

2

Sending Events From Lightning Components

Component Page:

<aura:component implements="flexipage:availableForAllPageTypes">
   <!--Step1: include Lightning:messageChannel tag -->
   <lightning:messageChannel type="SiX__agentLMC__c" aura:id="agentLMC">
   </lightning:messageChannel>
   <lightning:button variant="success" label="Success" title="Send Event Test" onclick="{! c.handleClick }"/>
</aura:component>

Component Page Controller:

({
   handleClick : function(component, event, helper) {
      let payLoad = {
      "type":"SIX_CUSTOM_EVENT","subType":"ADD_WHAT_HISTORY","data":{"what":   {"id":"123","label":"123","isStandalone":"N"}}
      }
   var compId = component.find('agentLMC').publish(payLoad);
   }
})

3

Available SiX Events

All events passed must have a type attribute of SIX_CUSTOM_EVENT, a subType attribute of the event name being passed, and a data attribute with the data associated with the event.

Add What History
Adds an entry to the What dropdown on the disposition page.

Attribute Description
id Salesforce unique id
label How the entry will display in the dropdown
isStandalone Y/N Determines if a Who entry can be selected with this What entry

{"type":"SIX_CUSTOM_EVENT","subType":"ADD_WHAT_HISTORY","data":{"what":{"id":"003f100001q0aGCAAY","label":"00002296","isStandalone":"N"}}}

Add Who History
Adds an entry to the Who dropdown on the disposition page.

Attribute Description
id Salesforce unique id
label How the entry will display in the dropdown
isStandalone Y/N Determines if a Who entry can be selected with this What entry

{"type":"SIX_CUSTOM_EVENT","subType":"ADD_WHO_HISTORY","data":{"who":{"id":"003f100001q0aGCAAY","label":"Jim Smith","isStandalone":"N"}}}

Add History
Adds both an entry to the Who dropdown and the What dropdown on the disposition page.

Attribute Description
what id Salesforce unique id
what label How the entry will display in the dropdown
what isStandalone Y/N Determines if a Who entry can be selected with this What entry
who id Salesforce unique id
who label How the entry will display in the dropdown
who isStandalone Y/N Determines if a Who entry can be selected with this What entry

{"type":"SIX_CUSTOM_EVENT","subType":"ADD_HISTORY","data":{"what":{"id":"003f100001q0aGCAAY","label":"00002296","isStandalone":"N"},"who":{"id":"003f100001q0aGCAAY","label":"Jim Smith","isStandalone":"N"}}}

Dial Outbound Call
Send an outbound call through the SiX Agent.

Attribute Description
phoneNumber Phone number being dialed
skillId Outbound Skill ID to use. If no Skill ID is passed, it will use the agent's outbound Skill if they only have 1 assigned or pop up a selection box to select the correct outbound Skill
what id Salesforce unique ID
what label How the entry will display in the dropdown
what isStandalone Y/N Determines if a Who entry can be selected with this What entry
who id Salesforce unique id
who label How the entry will display in the dropdown
who isStandalone Y/N Determines if a Who entry can be selected with this What entry

{"type":"SIX_CUSTOM_EVENT","subType":"DIAL_OUTBOUND_CALL","data":{"phoneNumber":"4075551234","skillId":"123456","what":{"id":"003f100001q0aGCAAY","label":"00002296","isStandalone":"N"},"who":{"id":"003f100001q0aGCAAY","label":"Jim Smith","isStandalone":"N"}}}

Set Agent State
Sets the current state of the Contact Center agent.

Attribute Description
agentStateName Available or Unavailable
agentStateDescription The specific Unavailable type ( i.e. Meeting, Lunch )

{"type":"SIX_CUSTOM_EVENT","subType": "SET_AGENT_STATE","data":{"agentStateName": "Unavailable","agentStateDescription": "' + agentStateDescription + '"}}

Call Masking
Toggles the masking for the current call on or off

Attribute Description
isMasked Y to mask call, N to unmask call

{"type":"SIX_CUSTOM_EVENT","subType": "MASK_CALLS","data":{"isMasked": "Y"}}

Dial Agent Leg 
Attempts to connect to the agent leg.

{"type":"SIX_CUSTOM_EVENT","subType": "DIAL_AGENT_LEG","data":{}}

End Agent Leg
Attempts to disconnect from the agent leg.

{"type":"SIX_CUSTOM_EVENT","subType": "END_AGENT_LEG","data":{}}

Dial Skill
Makes a call to the skill provided.

Attribute Description
skillId Skill ID to be dialed

{"type":"SIX_CUSTOM_EVENT","subType": "DIAL_SKILL","data":{"skillId": "123456"}}

Send DTMF String
Sends DTMF tones to the current call.

Attribute Description
dtmf_string Sequence of codes to be sent during the call

{"type": "SEND_DTMF","data":{"dtmf_string": "1 2 3 4 5"}}

TOP