mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 19:38:22 +00:00
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
This commit is contained in:
@@ -3975,8 +3975,12 @@ static void recalc_holdtime(struct queue_ent *qe, int newholdtime)
|
|||||||
/* 2^2 (4) is the filter coefficient; a higher exponent would give old entries more weight */
|
/* 2^2 (4) is the filter coefficient; a higher exponent would give old entries more weight */
|
||||||
|
|
||||||
ao2_lock(qe->parent);
|
ao2_lock(qe->parent);
|
||||||
oldvalue = qe->parent->holdtime;
|
if ((qe->parent->callscompleted + qe->parent->callsabandoned) == 0) {
|
||||||
qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newholdtime) >> 2;
|
qe->parent->holdtime = newholdtime;
|
||||||
|
} else {
|
||||||
|
oldvalue = qe->parent->holdtime;
|
||||||
|
qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newholdtime) >> 2;
|
||||||
|
}
|
||||||
ao2_unlock(qe->parent);
|
ao2_unlock(qe->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5527,7 +5531,7 @@ static int update_queue(struct call_queue *q, struct member *member, int callcom
|
|||||||
if (callcompletedinsl) {
|
if (callcompletedinsl) {
|
||||||
q->callscompletedinsl++;
|
q->callscompletedinsl++;
|
||||||
}
|
}
|
||||||
if (q->callscompletedinsl == 1) {
|
if (q->callscompleted == 1) {
|
||||||
q->talktime = newtalktime;
|
q->talktime = newtalktime;
|
||||||
} else {
|
} else {
|
||||||
/* Calculate talktime using the same exponential average as holdtime code */
|
/* Calculate talktime using the same exponential average as holdtime code */
|
||||||
|
|||||||
Reference in New Issue
Block a user