Added more data output fields to agent_stats_export Non-Agent API function

git-svn-id: svn://192.168.202.10@3404 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2021-03-26 00:45:23 +00:00
parent 7ffcf95039
commit fcc1a6c35c
3 changed files with 28 additions and 12 deletions
+5 -4
View File
@@ -1,4 +1,4 @@
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2021-03-22
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2021-03-25
This document describes the functions of an API(Application Programming
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
@@ -181,6 +181,7 @@ Changes:
210319-1720 - Added special 'xDAYS' value option for callback_datetime
210320-2127 - Added 'custom_fields_add' option for update_list function
210322-1218 - Added display of bad wav file formats on sounds_list function
210325-2042 - Added more data output fields to agent_stats_export function
API Functions use the 'function' variable
@@ -568,9 +569,9 @@ ERROR: agent_stats_export INVALID SEARCH PARAMETERS - 6666||2010-12-03 00:00:00|
ERROR: agent_stats_export NO RECORDS FOUND - 1255||2010-12-03 00:00:00|2010-12-03 00:00:01|
A SUCCESS response will not show "SUCCESS", but instead will just print the results in the following format:
user|full_name|user_group|calls|login_time|total_talk_time|avg_talk_time|avg_wait_time|pct_of_queue|pause_time|sessions|avg_session|pauses|avg_pause_time|pause_pct|pauses_per_session|total_wait_time
1029|test agent|ADMIN|1|0:01:52|0:00:16|0:00:16|0:00:18|16.7%|54|3|0:00:37|5|0:00:11|48.2%|2|0:00:32
6666|Admin|ADMIN|5|0:04:11|0:01:48|0:00:22|0:00:17|83.3%|27|2|0:02:06|4|0:00:07|10.8%|2|0:00:32
user|full_name|user_group|calls|login_time|total_talk_time|avg_talk_time|avg_wait_time|pct_of_queue|pause_time|sessions|avg_session|pauses|avg_pause_time|pause_pct|pauses_per_session|wait_time|talk_time|dispo_time|dead_time
1029|test agent|ADMIN|1|0:01:52|0:00:16|0:00:16|0:00:18|16.7%|54|3|0:00:37|5|0:00:11|48.2%|2|0:00:32|0:07:54|0:01:22|0:00:00
6666|Admin user|ADMIN|16|0:34:31|0:07:54|0:00:00|0:00:07|100%|1411|13|0:02:39|42|0:00:34|68.1%|3|0:01:44|0:07:54|0:01:22|0:00:00
* if the 'group_by_campaign' option is enabled, the format above will have 'campaign_id' as the first column, and each agent's activity will be divided on separate lines by the campaigns they were logged into during the requested time period.
@@ -16,6 +16,7 @@ In 2017, the Google Chrome development team announced that, in an effort to redu
In early 2021, Google Chrome build 88 changed this behavior by default and enabled what they call "Intensive Javascript Throttling" which would only affect hidden tabs starting at 5 minutes being hidden, with no audio having played for 30 seconds and no Web RTC connections on the page(like VICIphone). This "Intensive" throttling actually begins as soon as the VICIdial Agent Screen is hidden from view by only allowing it to refresh every 2 seconds, instead of the standard every 1 second that happens when the agent screen is visible. Then after 5 minutes of being hidden, the refresh rate is limited to once every minute(usually at a set number of seconds past the minute, like :02, :22, etc...). At this point, the VICIdial Agent Screen will become unusable unless you make it visible right away, and the agent session will pause automatically.
NOTE: Any web browser that is based on the Chromium Open-Source codebase, like Google Chrome and Microsoft Edge, might be affected by this issue.
@@ -72,7 +73,7 @@ We have tested the following settings and found them to be effective on all clie
- Set "volume" to '25'
- Set "Agent Hidden Browser Sound Seconds" to '20'
Adding this new feature also required us to add Agent Screen Vicibility Logging to VICIdial, so you can now also view statistics of how long your agents' screens were visible to them in the Agent Time Detail report and the User Stats report.
Adding this new feature also required us to add Agent Screen Visibility Logging to VICIdial, so you can now also view statistics of how long your agents' screens were visible to them in the Agent Time Detail report and the User Stats report.
+21 -7
View File
@@ -169,10 +169,11 @@
# 210319-1720 - Added special 'xDAYS' value option for callback_datetime
# 210320-2127 - Added 'custom_fields_add' option for update_list function
# 210322-1218 - Added display of bad wav file formats on sounds_list function
# 210325-2042 - Added more data output fields to agent_stats_export function
#
$version = '2.14-146';
$build = '210322-1218';
$version = '2.14-147';
$build = '210325-2042';
$api_url_log = 0;
$startMS = microtime();
@@ -9010,11 +9011,11 @@ if ($function == 'agent_stats_export')
{
if ($group_by_campaign == 'YES')
{
$output .= 'campaign_id' . $DL . 'user' . $DL . 'full_name' . $DL . 'user_group' . $DL . 'calls' . $DL . 'login_time' . $DL . 'total_talk_time' . $DL . 'avg_talk_time' . $DL . 'avg_wait_time' . $DL . 'pct_of_queue' . $DL . 'pause_time' . $DL . 'sessions' . $DL . 'avg_session' . $DL . 'pauses' . $DL . 'avg_pause_time' . $DL . 'pause_pct' . $DL . 'pauses_per_session' . "\n";
$output .= 'campaign_id' . $DL . 'user' . $DL . 'full_name' . $DL . 'user_group' . $DL . 'calls' . $DL . 'login_time' . $DL . 'total_talk_time' . $DL . 'avg_talk_time' . $DL . 'avg_wait_time' . $DL . 'pct_of_queue' . $DL . 'pause_time' . $DL . 'sessions' . $DL . 'avg_session' . $DL . 'pauses' . $DL . 'avg_pause_time' . $DL . 'pause_pct' . $DL . 'pauses_per_session' . $DL . 'wait_time' . $DL . 'talk_time' . $DL . 'dispo_time' . $DL . 'dead_time' . "\n";
}
else
{
$output .= 'user' . $DL . 'full_name' . $DL . 'user_group' . $DL . 'calls' . $DL . 'login_time' . $DL . 'total_talk_time' . $DL . 'avg_talk_time' . $DL . 'avg_wait_time' . $DL . 'pct_of_queue' . $DL . 'pause_time' . $DL . 'sessions' . $DL . 'avg_session' . $DL . 'pauses' . $DL . 'avg_pause_time' . $DL . 'pause_pct' . $DL . 'pauses_per_session' . "\n";
$output .= 'user' . $DL . 'full_name' . $DL . 'user_group' . $DL . 'calls' . $DL . 'login_time' . $DL . 'total_talk_time' . $DL . 'avg_talk_time' . $DL . 'avg_wait_time' . $DL . 'pct_of_queue' . $DL . 'pause_time' . $DL . 'sessions' . $DL . 'avg_session' . $DL . 'pauses' . $DL . 'avg_pause_time' . $DL . 'pause_pct' . $DL . 'pauses_per_session' . $DL . 'wait_time' . $DL . 'talk_time' . $DL . 'dispo_time' . $DL . 'dead_time' . "\n";
}
}
@@ -9048,6 +9049,8 @@ if ($function == 'agent_stats_export')
{
$uc++;
$ASuser[$uc] = $row[0];
# $ASdispo_sec[$uc] = $row[6];
# $ASdead_sec[$uc] = $row[7];
$AScampaign[$uc] = $row[9];
$ASstart_epoch[$uc] = $row[8];
$last_user = $temp_camp_user;
@@ -9062,7 +9065,9 @@ if ($function == 'agent_stats_export')
{
$uc++;
$ASuser[$uc] = $row[0];
$ASstart_epoch[$uc] = $row[8];
$ASdispo_sec[$uc] = $row[6];
# $ASdead_sec[$uc] = $row[7];
# $ASstart_epoch[$uc] = $row[8];
$last_user = $row[0];
$AScalls[$uc] = 0;
$ASpauses[$uc] = 0;
@@ -9124,11 +9129,17 @@ if ($function == 'agent_stats_export')
{
$cust_sec = 0;
$wait_sec = 0;
$talk_sec = 0;
$dead_sec = 0;
$dispo_sec = 0;
}
else
{
$cust_sec = ($AStalk_sec[$k] - $ASdead_sec[$k]);
$wait_sec = $ASwait_sec[$k];
$talk_sec = $AStalk_sec[$k];
$dead_sec = $ASdead_sec[$k];
$dispo_sec = $ASdispo_sec[$k];
}
$avg_session_sec = round($avg_session_sec);
$avg_pause_sec = round($avg_pause_sec);
@@ -9142,16 +9153,19 @@ if ($function == 'agent_stats_export')
$avg_pause_sec = sec_convert($avg_pause_sec,$time_format);
$cust_sec = sec_convert($cust_sec,$time_format);
$wait_sec = sec_convert($wait_sec,$time_format);
$talk_sec = sec_convert($talk_sec,$time_format);
$dead_sec = sec_convert($dead_sec,$time_format);
$dispo_sec = sec_convert($dispo_sec,$time_format);
$avg_cust_sec = sec_convert($avg_cust_sec,$time_format);
$avg_wait_sec = sec_convert($avg_wait_sec,$time_format);
if ($group_by_campaign == 'YES')
{
$output .= "$AScampaign[$k]$DL$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$ASpause_sec[$k]$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec\n";
$output .= "$AScampaign[$k]$DL$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$ASpause_sec[$k]$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec$DL$talk_sec$DL$dispo_sec$DL$dead_sec\n";
}
else
{
$output .= "$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$ASpause_sec[$k]$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec\n";
$output .= "$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$ASpause_sec[$k]$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec$DL$talk_sec$DL$dispo_sec$DL$dead_sec\n";
}
$k++;
}