[asterisk-commits] app queue: Fix initial hold time queue statistic (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 23 11:02:21 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6255 )

Change subject: app_queue: Fix initial hold time queue statistic
......................................................................

app_queue: Fix initial hold time queue statistic

Fixed to use correct initial value and fixed to use the
correct queue info to check the first value.

ASTERISK-27204

Change-Id: Ia9e36c828e566e1cc25c66f73307566e4acb8e73
---
M apps/app_queue.c
1 file changed, 7 insertions(+), 3 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/apps/app_queue.c b/apps/app_queue.c
index 91c8d61..678b4a7 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -3975,8 +3975,12 @@
 	/* 2^2 (4) is the filter coefficient; a higher exponent would give old entries more weight */
 
 	ao2_lock(qe->parent);
-	oldvalue = qe->parent->holdtime;
-	qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newholdtime) >> 2;
+	if ((qe->parent->callscompleted + qe->parent->callsabandoned) == 0) {
+		qe->parent->holdtime = newholdtime;
+	} else {
+		oldvalue = qe->parent->holdtime;
+		qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newholdtime) >> 2;
+	}
 	ao2_unlock(qe->parent);
 }
 
@@ -5527,7 +5531,7 @@
 	if (callcompletedinsl) {
 		q->callscompletedinsl++;
 	}
-	if (q->callscompletedinsl == 1) {
+	if (q->callscompleted == 1) {
 		q->talktime = newtalktime;
 	} else {
 		/* Calculate talktime using the same exponential average as holdtime code */

-- 
To view, visit https://gerrit.asterisk.org/6255
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9e36c828e566e1cc25c66f73307566e4acb8e73
Gerrit-Change-Number: 6255
Gerrit-PatchSet: 1
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170823/72701e99/attachment-0001.html>


More information about the asterisk-commits mailing list