Merge "app_queue: fix Calculate talktime when is first call answered"

This commit is contained in:
Joshua Colp 2016-02-18 13:12:03 -06:00 committed by Gerrit Code Review
commit 7beedb5465
1 changed files with 7 additions and 3 deletions

View File

@ -5441,9 +5441,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;
}