Skip to content

Instantly share code, notes, and snippets.

@roramirez
Created November 16, 2015 03:08
Show Gist options
  • Save roramirez/c332be92f45bc53b6ae4 to your computer and use it in GitHub Desktop.
Save roramirez/c332be92f45bc53b6ae4 to your computer and use it in GitHub Desktop.
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 862988b..0a2726b 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -5400,9 +5400,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->callscompleted ==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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment