[Asterisk-code-review] app queue: fix Calculate talktime when is first call answered (asterisk[13])
Rodrigo Ramirez Norambuena
asteriskteam at digium.com
Wed Feb 17 15:04:16 CST 2016
Rodrigo Ramirez Norambuena has uploaded a new change for review.
https://gerrit.asterisk.org/2270
Change subject: app_queue: fix Calculate talktime when is first call answered
......................................................................
app_queue: fix Calculate talktime when is first call answered
Fix calculate of average time for talktime is wrong when is completed the
first call beacuse the time for talked would be that call.
ASTERISK-25800 #close
Change-Id: I94f79028935913cd9174b090b52bb300b91b9492
---
M apps/app_queue.c
1 file changed, 7 insertions(+), 3 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/70/2270/1
diff --git a/apps/app_queue.c b/apps/app_queue.c
index e77b2be..939a0e2 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -5416,9 +5416,13 @@
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;
}
--
To view, visit https://gerrit.asterisk.org/2270
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I94f79028935913cd9174b090b52bb300b91b9492
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Rodrigo Ramirez Norambuena <a at rodrigoramirez.com>
More information about the asterisk-code-review
mailing list