Brekeke Contact Center Suite Wiki

CIM - Change Timeout Interval of Agent Wrapup State

Step 1. Add the following parameters at the [Admin Menu] > [Settings] > [Advanced Settings] on CIM.

widget.scripting.source=<script>widget.scripting.event.agentstatus.function=<function>

Example:
widget.scripting.source=agent_controlwidget.scripting.event.agentstatus.function=agentstatus

 

Step 2.  Add the following script named as “agent_control” at the [Script] menu on CIM.

var intervalId = null;
var TIMEOUT_WRAPUP = 10 * 1000;//10 sec
var previousStatus = 0;
var agentstatus = function( widget, ev, param ) {
    if(ev.agentState == 4){
        var callInfo = widget.getWrapUpCallInfo();
        if(!callInfo){
            callInfo = widget.getCallsInfo()[0];
        }
     
        if(!callInfo.appUrl){
            //do nothing when crm loaded
            return;
        }

        //change to ready after 10 sec when wrapup until success
        intervalId = setInterval( function(){
              var info = widget.getAgentInfo();
              widget.operate(Brekeke.CTI.DCIAgentWidget.Constants.manageAgentState,
                                {agentId:info.agentId,agentState:previousStatus,agentStateReason:'wrap up timeout'},"");
        }, TIMEOUT_WRAPUP );
    } else {
        if(ev.agentState != 3){ // remember the previous status
        previousStatus = ev.agentState;
        }
    
        //stop loop because task completed
        if(intervalId){
            clearInterval(intervalId);
            intervalId = null;
        }
    }
}
Yes No
Suggest Edit