AST_CLOSERstats.php calculation error

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

AST_CLOSERstats.php calculation error

Postby GaD » Mon Feb 08, 2016 11:45 pm

Hi all

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...
GaD
 
Posts: 195
Joined: Fri Jul 08, 2011 3:56 pm

Re: AST_CLOSERstats.php calculation error

Postby mflorell » Tue Feb 09, 2016 6:47 am

If you want agent talk time, the vicidial_closer_log isn't going to provide it. You would need to look in the vicidial_agent_log, which this report doesn't do.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: AST_CLOSERstats.php calculation error

Postby GaD » Tue Feb 09, 2016 10:53 am

Agent Time is no good for me as it will give me talk time for an outbound campaign (and hence a closer or many closer campaigns). I need the stats for a specific closer camp and not all the campaigns associated to the outbound camp. That report that you mentioned is no good for me. Is there a way to calculate that from the *stock* reporting? Also, if what you're saying is correct, I believe than the the title "AGENT STATS" can be missleading; I would name it "CALL STATS" or something....

Thanks Matt, let me know what you think.
GaD
 
Posts: 195
Joined: Fri Jul 08, 2011 3:56 pm

Re: AST_CLOSERstats.php calculation error

Postby mflorell » Tue Feb 09, 2016 4:19 pm

There is currently no report that does exactly what you are looking for, although I'm sure one could be created, but it would require more than a single simple query to generate those stats.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 104 guests