summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2016-02-18 14:43:59 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-02-18 14:43:59 -0600
commit37c273f0de946282e69c0a6166b955eb3b4f8c2e (patch)
tree6995000adba242befc89c772495dda8391279d7b
parent5a3a857dd62638609ce0d7dbc8d97287f1aa6580 (diff)
parent79dc5e2f00e0b78f6278c34740b824eb289d1518 (diff)
Merge "app_queue: fix Calculate talktime when is first call answered" into 13
-rw-r--r--apps/app_queue.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index e77b2be23..939a0e2ad 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -5416,9 +5416,13 @@ static int update_queue(struct call_queue *q, struct member *member, int callcom
if (callcompletedinsl) {
q->callscompletedinsl++;
}
- /* Calculate talktime using the same exponential average as holdtime code*/
- oldtalktime = q->talktime;
- q->talktime = (((oldtalktime << 2) - oldtalktime) + newtalktime) >> 2;
+ if (q->callscompletedinsl == 1) {
+ q->talktime = newtalktime;
+ } else {
+ /* Calculate talktime using the same exponential average as holdtime code */
+ oldtalktime = q->talktime;
+ q->talktime = (((oldtalktime << 2) - oldtalktime) + newtalktime) >> 2;
+ }
ao2_unlock(q);
return 0;
}