It's been a while since I've been around these walls....., Listen, I recently updated a production Vicidial server and I noticed that there's a report that looks wrong. I'm not sure if I'm missinterpreting the report or if this is an actual bug. I'm doing an inbound report (AST_CLOSERstats.php). I believe the secion ---------- AGENT STATS is meant to show how much time an agent was talking to a customer for the time period. The calculation is wrong.
On line 2144
- Code: Select all
$stmt="select ".$vicidial_closer_log_table.".user,full_name,count(*),length_in_sec,avg(length_in_sec) from ".$vicidial_closer_log_table.",vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and ".$vicidial_closer_log_table.".user is not null and length_in_sec is not null and ".$vicidial_closer_log_table.".user=vicidial_users.user group by ".$vicidial_closer_log_table.".user;";
I believe you're trying to calculate the time the agent spends on the phone talking (or talk time), or time that the agent was connected to the caller. This number is wrong, you're including the total length of the call including the time the call was on queue. So if a call was in queue for ten minutes, but only spoke for one minute with the agent, this report will show the whole ten minutes.
I have corrected the problem with the following SQL:
- Code: Select all
$stmt="select ".$vicidial_closer_log_table.".user,full_name,count(*),floor(sum(length_in_sec-queue_seconds)),avg(length_in_sec-queue_seconds) from ".$vicidial_closer_log_table.",vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and ".$vicidial_closer_log_table.".user is not null and length_in_sec is not null and ".$vicidial_closer_log_table.".user=vicidial_users.user group by ".$vicidial_closer_log_table.".user;";
Similar change was done at line 2147. BTW, I did round thee seconds DOWN forcefully just because....
Let me know if this was really a bug or if I'm just missinterpreting the report.
Cheers!
BTW. I have: VERSION: 2.12-538a | BUILD: 160122-1401 . I have a 10 server 'farm' mostly installed from different Vicibox ISOS. I don't think my signature specs are correct...