agentStateEvent Method

This method notifies Fusion Service of a change in the user's signed in or availability status for the specified channel.

Note: In order to properly reflect the agent state on the phone icon at the top of the application window, it's important to inform Fusion Service of the agent's current state: logged in, logged out, available, or on break. Upon establishing the initial connection to the toolbar, be sure to call agentStateEvent() passing the correct values for isLoggedIn and isAvailable. All state changes must be conveyed using the same method.

Here's a list of the method parameters:

Parameter

Description

channel

Name of the channel. (Required.)

eventId

Unique identifier for the event. (Required.)

isAvailable

Boolean to indicate if the user is available to receive routed assignments for the specified channel. (Required.)

isLoggedIn

Boolean to indicate if the user is signed in to the specified channel. (Required.)

stateCd

System code to indicate the current availability status of the user. (Optional.) For future use.

stateDisplayString

Translatable string to indicate the user's current channel activity state in the Fusion Service UI, such as idle, busy, on break on so on. This must be translated to the user's language. (Required.)

reasonCd

System code to indicate the reason for the current availability status. (Optional.) For future use.

reasonDisplayString

Translatable string to display the reason for the current status on the Fusion Service UI. (Optional.) For future use.

inData

Object containing the name value pairs if additional details are required.

callback

Function on the toolbar to indicate event receipt by Fusion Service Service.

channelType

The type of channel. (Required.)

The following is sample code to call this method.

<html>
<head>
<script type="text/javascript" src="http://domain:port/ora_support/js/mcaInteractionV1.js">
</script>
<script type="text/javascript">
   function agentStateEvent() {
      svcMcaTlb.api.agentStateEvent("PHONE","1",true,true,"AVAILABLE","Available",null,null,{}, 
         function(response){
            if (response.result == 'success') {
               alert("success response for agentStateEvent received");
            } else {
               alert("error response for agentStateEvent received: "+response.error);
            }
         }, 'ORA_SVC_PHONE');
   }
</script>
<body>
   <input type="button" value="Fire agentStateEvent" onclick="agentStateEvent()"/>
</body>
</html>