diff options
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 10 |
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; } |