Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Incorrect behaviour of timer on Interaction Header

SA-12015

Summary



The timer is not reset to start from 00:00 sec in the Phone Call interactions following the first interaction made by a Customer Service Representative (CSR).
Sometimes the timer blinks in between the current interaction and previous interaction time.

Error Messages



Not Applicable.

Steps to Reproduce



1. Click on Phone-Call Interaction, and start the first interaction.
2. End the first interaction.
3. Click on Phone-Call Interaction again, and start the second Interaction. The timer does not start from 00:00 s.

Root Cause



The root cause of this problem is a defect in custom application code or rules.
The JavaScript (JS) function setInterval was called for displaying the timer. The associated JS file CPMCallTimer ensured the span element was regenerated every second in the rendered HTML modified by the user. The code snippet given below is the final call to setInterval.

this._timer = setInterval(cti.util.bind(this.handleTimer,this),refreshRate);

Resolution



Include the code snippet given below, which is based on the latest out-of-the-box file, in CPMCTICallTimer JS file.
 
  this._lStartTime = lStartTime;
  if ((this._lStartTime == -1) || (isNaN(this._lStartTime))){
     this._lStartTime = new Date().getTime();
  }
  this._lEndTime = -1;
  this._sTimerContainerDivName = sTimerContainerDivName; 
  this._oTimerContainerDiv = pega.util.Dom.get(sTimerContainerDivName);
  this._oThresholds = oThresholds;
  if (typeof oActionHandler != "undefined") 
    this._oActionHandler = oActionHandler;
   else 
    this._oActionHandler = new DefaultTimerActionHandler();
  this._oActionHandler.setTimerContainerDiv(this._oTimerContainerDiv);
  this._oActionHandler.setThresholds(this._oThresholds);
  this._oActionHandler.setId(sTimerContainerDivName);
 
 
            this._sTimerId;
 
DefaultTimerActionHandler.prototype.setId = function(sId) {
            this._sTimerId = sId;
}

Published January 8, 2016 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us