[Asterisk-code-review] app queue: Fix initial hold time queue statistic (asterisk[15])
Jenkins2
asteriskteam at digium.com
Wed Aug 23 11:11:25 CDT 2017
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6257 )
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 004d93a..b139ef7 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4072,8 +4072,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);
}
@@ -5651,7 +5655,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/6257
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9e36c828e566e1cc25c66f73307566e4acb8e73
Gerrit-Change-Number: 6257
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-code-review/attachments/20170823/c493f66c/attachment-0001.html>
More information about the asterisk-code-review
mailing list