Added system settings for agent_hidden_sound and added more browser_alert_sounds

Added agent screen visibility logging and Agent Hidden Browser Sounds

git-svn-id: svn://192.168.202.10@3390 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2021-03-18 06:49:09 +00:00
parent 26ff4c9a15
commit fe57e2dec0
17 changed files with 394 additions and 22 deletions
+6
View File
@@ -596,6 +596,12 @@ OTHER CHANGES:
167. Added a page to allow Editing existing Lead Loader Templates.
168. Added System Settings for "Agent Hidden Browser Sound" to repeatedly play
a selected sound at a set interval to an agent when their Agent Screen
is hidden from view. Can be used to disable web browser javascript
throttling if set to an audible sound at a 20 second interval. Tested
with the 'click_quiet' sound file at a volume of '25'.
+83 -1
View File
@@ -20,7 +20,7 @@
# Based on perl scripts in ViciDial from Matt Florell and post:
# http://www.vicidial.org/VICIDIALforum/viewtopic.php?p=22506&sid=ca5347cffa6f6382f56ce3db9fb3d068#22506
#
# Copyright (C) 2020 I. Taushanov, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2021 I. Taushanov, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 90615-1701 - First version
@@ -59,6 +59,7 @@
# 190926-0005 - Added vicidial_sip_action_log archiving
# 200102-0846 - Added vicidial_vmm_counts archiving
# 201107-2206 - Added optional park_log archiving
# 210317-2104 - Added vicidial_agent_visibility_log archiving
#
$CALC_TEST=0;
@@ -768,6 +769,35 @@ if (!$T)
}
##### END vicidial_agent_log_archive trim processing #####
##### BEGIN vicidial_agent_visibility_log_archive trim processing #####
$stmtA = "SELECT count(*) from vicidial_agent_visibility_log_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$vicidial_agent_visibility_log_archive_count = $aryA[0];
}
$sthA->finish();
if (!$Q) {print "Trimming vicidial_agent_visibility_log_archive table... ($vicidial_agent_visibility_log_archive_count)\n";}
$rv = $sthA->err();
if (!$rv)
{
$stmtA = "DELETE FROM vicidial_agent_visibility_log_archive WHERE db_time < '$del_time';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows deleted from vicidial_agent_visibility_log_archive table \n";}
$stmtA = "optimize table vicidial_agent_visibility_log_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
}
##### END vicidial_agent_visibility_log_archive trim processing #####
##### BEGIN vicidial_closer_log_archive trim processing #####
$stmtA = "SELECT count(*) from vicidial_closer_log_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
@@ -2469,6 +2499,58 @@ if (!$T)
}
##### vicidial_agent_visibility_log
$stmtA = "SELECT count(*) from vicidial_agent_visibility_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$vicidial_agent_visibility_log_count = $aryA[0];
}
$sthA->finish();
$stmtA = "SELECT count(*) from vicidial_agent_visibility_log_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$vicidial_agent_visibility_log_archive_count = $aryA[0];
}
$sthA->finish();
if (!$Q) {print "\nProcessing vicidial_agent table... ($vicidial_agent_visibility_log_count|$vicidial_agent_visibility_log_archive_count)\n";}
$stmtA = "INSERT IGNORE INTO vicidial_agent_visibility_log_archive SELECT * from vicidial_agent_visibility_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows inserted into vicidial_agent_visibility_log_archive table \n";}
$rv = $sthA->err();
if (!$rv)
{
if ($wipe_all > 0)
{$stmtA = "DELETE FROM vicidial_agent_visibility_log;";}
else
{$stmtA = "DELETE FROM vicidial_agent_visibility_log WHERE db_time < '$del_time';";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows deleted from vicidial_agent_visibility_log table \n";}
$stmtA = "optimize table vicidial_agent_visibility_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$stmtA = "optimize table vicidial_agent_visibility_log_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
}
##### vicidial_carrier_log
$stmtA = "SELECT count(*) from vicidial_carrier_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
+19 -3
View File
@@ -1899,7 +1899,10 @@ phone_defaults_container VARCHAR(40) default '---DISABLED---',
qc_claim_limit TINYINT UNSIGNED DEFAULT '3',
qc_expire_days TINYINT UNSIGNED DEFAULT '3',
two_factor_auth_hours SMALLINT(5) default '0',
two_factor_container VARCHAR(40) default '---DISABLED---'
two_factor_container VARCHAR(40) default '---DISABLED---',
agent_hidden_sound VARCHAR(20) default 'click_quiet',
agent_hidden_sound_volume TINYINT(3) UNSIGNED default '25',
agent_hidden_sound_seconds TINYINT(3) UNSIGNED default '0'
) ENGINE=MyISAM;
CREATE TABLE vicidial_campaigns_list_mix (
@@ -3152,7 +3155,6 @@ index (lead_id),
index (call_date)
) ENGINE=MyISAM;
CREATE TABLE vicidial_qc_agent_log (
qc_agent_log_id INT(9) unsigned NOT NULL AUTO_INCREMENT,
qc_user VARCHAR(20) COLLATE utf8_unicode_ci NOT NULL,
@@ -4514,6 +4516,18 @@ index (auth_date),
index (auth_exp_date)
) ENGINE=MyISAM;
CREATE TABLE vicidial_agent_visibility_log (
db_time DATETIME NOT NULL,
event_start_epoch INT(10) UNSIGNED,
event_end_epoch INT(10) UNSIGNED,
user VARCHAR(20),
length_in_sec INT(10),
visibility ENUM('VISIBLE','HIDDEN','LOGIN','NONE') default 'NONE',
agent_log_id INT(9) UNSIGNED,
index (db_time),
unique index visibleuser (user, visibility, event_end_epoch)
) ENGINE=MyISAM;
ALTER TABLE vicidial_email_list MODIFY message text character set utf8;
@@ -4767,6 +4781,8 @@ CREATE TABLE vicidial_vmm_counts_archive LIKE vicidial_vmm_counts;
CREATE TABLE park_log_archive LIKE park_log;
CREATE UNIQUE INDEX uniqueidtime_park on park_log_archive (uniqueid,parked_time);
CREATE TABLE vicidial_agent_visibility_log_archive LIKE vicidial_agent_visibility_log;
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
@@ -4850,4 +4866,4 @@ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1622',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1623',db_schema_update_date=NOW(),reload_timestamp=NOW();
+20
View File
@@ -1567,3 +1567,23 @@ UPDATE system_settings SET db_schema_version='1621',db_schema_update_date=NOW()
ALTER TABLE vicidial_campaigns ADD clear_form ENUM('DISABLED','ENABLED','ACKNOWLEDGE') default 'ACKNOWLEDGE';
UPDATE system_settings SET db_schema_version='1622',db_schema_update_date=NOW() where db_schema_version < 1622;
CREATE TABLE vicidial_agent_visibility_log (
db_time DATETIME NOT NULL,
event_start_epoch INT(10) UNSIGNED,
event_end_epoch INT(10) UNSIGNED,
user VARCHAR(20),
length_in_sec INT(10),
visibility ENUM('VISIBLE','HIDDEN','LOGIN','NONE') default 'NONE',
agent_log_id INT(9) UNSIGNED,
index (db_time),
unique index visibleuser (user, visibility, event_end_epoch)
) ENGINE=MyISAM;
CREATE TABLE vicidial_agent_visibility_log_archive LIKE vicidial_agent_visibility_log;
ALTER TABLE system_settings ADD agent_hidden_sound VARCHAR(20) default 'click_quiet';
ALTER TABLE system_settings ADD agent_hidden_sound_volume TINYINT(3) UNSIGNED default '25';
ALTER TABLE system_settings ADD agent_hidden_sound_seconds TINYINT(3) UNSIGNED default '0';
UPDATE system_settings SET db_schema_version='1623',db_schema_update_date=NOW() where db_schema_version < 1623;
+33 -4
View File
@@ -1,7 +1,7 @@
<?php
# conf_exten_check.php version 2.14
#
# Copyright (C) 2020 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send whether the meetme conference has live channels connected and which they are
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -85,10 +85,11 @@
# 191013-2105 - Fixes for PHP7
# 200825-2343 - Added option for manual-only sip actions
# 201111-2140 - Fix for AGENTDIRECT selected in-groups issue #1241
# 210317-1935 - Added visibility logging
#
$version = '2.14-59';
$build = '201111-2140';
$version = '2.14-60';
$build = '210317-1935';
$php_script = 'conf_exten_check.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=51;
@@ -146,7 +147,8 @@ if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
if (isset($_GET["visibility"])) {$visibility=$_GET["visibility"];}
elseif (isset($_POST["visibility"])) {$visibility=$_POST["visibility"];}
if ($bcrypt == 'OFF')
{$bcrypt=0;}
@@ -200,6 +202,7 @@ $conf_exten = preg_replace("/[^-_0-9a-zA-Z]/","",$conf_exten);
$exten = preg_replace("/\'|\"|\\\\|;/","",$exten);
$clicks = preg_replace("/\'|\"|\\\\|;/","",$clicks);
$customer_chat_id = preg_replace("/[^0-9a-zA-Z]/","",$customer_chat_id);
$visibility = preg_replace("/\'|\"|\\\\|;/","",$visibility);
# default optional vars if not set
if (!isset($format)) {$format="text";}
@@ -1124,6 +1127,32 @@ if ($format=='debug')
echo "\n</body>\n</html>\n";
}
### log the visibility changes sent from the agent screen
if (strlen($visibility) > 1)
{
$vc=0;
$visibility_details = explode('|',$visibility);
$visibility_details_ct = count($visibility_details);
while($vc < $visibility_details_ct)
{
$visibility_data = explode(' ',$visibility_details[$vc]);
$visibility_type = $visibility_data[0];
$visibility_length = $visibility_data[1];
$visibility_start_epoch = $visibility_data[2];
$visibility_end_epoch = $visibility_data[3];
#$visibility_length = ($StarTtime - $visibility_data[2]);
$agent_log_id = $visibility_data[4];
if (strlen($visibility_type) > 1)
{
$stmtA="INSERT INTO vicidial_agent_visibility_log set db_time=NOW(),event_start_epoch='$visibility_start_epoch',event_end_epoch='$visibility_end_epoch',user='$user',length_in_sec='$visibility_length',visibility='$visibility_type',agent_log_id='$agent_log_id';";
$rslt=mysql_to_mysqli($stmtA, $link);
}
$vc++;
}
}
if ($SSagent_debug_logging > 0)
{
vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+169 -8
View File
@@ -657,10 +657,11 @@
# 210312-1520 - Force clearing of webphone panel upon logout
# 210315-2102 - Added CALLBACK manual dial filter option, Issue #1139
# 210317-1207 - Fixes for better consistency in password change process, Issue #1261
# 210318-0236 - Added agent browser visibility logging and Agent Hidden Browser Sounds
#
$version = '2.14-625c';
$build = '210317-1207';
$version = '2.14-626c';
$build = '210318-0236';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=95;
$one_mysql_log=0;
@@ -781,7 +782,7 @@ if ($sl_ct > 0)
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_third_webform,default_language,active_modules,allow_chats,chat_url,default_phone_code,agent_screen_colors,manual_auto_next,agent_xfer_park_3way,admin_web_directory,agent_script,agent_push_events,agent_push_url,agent_logout_link,agentonly_callback_campaign_lock,manual_dial_validation,mute_recordings,enable_second_script,enable_first_webform,recording_buttons,outbound_cid_any,browser_call_alerts,manual_dial_phone_strip,require_password_length,pass_hash_enabled FROM system_settings;";
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_third_webform,default_language,active_modules,allow_chats,chat_url,default_phone_code,agent_screen_colors,manual_auto_next,agent_xfer_park_3way,admin_web_directory,agent_script,agent_push_events,agent_push_url,agent_logout_link,agentonly_callback_campaign_lock,manual_dial_validation,mute_recordings,enable_second_script,enable_first_webform,recording_buttons,outbound_cid_any,browser_call_alerts,manual_dial_phone_strip,require_password_length,pass_hash_enabled,agent_hidden_sound_seconds,agent_hidden_sound,agent_hidden_sound_volume FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -835,6 +836,10 @@ if ($qm_conf_ct > 0)
$SSmanual_dial_phone_strip = $row[43];
$SSrequire_password_length = $row[44];
$SSpass_hash_enabled = $row[45];
$SSagent_hidden_sound_seconds = $row[46];
$SSagent_hidden_sound = $row[47];
$SSagent_hidden_sound_volume = $row[48];
if ( ($SSagent_hidden_sound == '---NONE---') or ($SSagent_hidden_sound == '') ) {$SSagent_hidden_sound_seconds=0;}
}
else
{
@@ -970,7 +975,7 @@ $SSalt_row1_background='BDFFBD';
$SSalt_row2_background='99FF99';
$SSalt_row3_background='CCFFCC';
$browser_alert_sounds_list = 'bark_dog,beep_double,beep_five,beep_up,bell_double,bell_school,bird,blaster1,blaster2,buzz1,buzz2,cash_register,chat_alert,close_encounter,confirmation,ding,droplet,droplet_double,elephant,email_alert,hold_tone,horn_bike,horn_car,horn_car_triple,horn_clown,horn_double,horn_train,meow_cat,scream_wilhelm,silence_quick,siren,slide_down,slide_up,swish,teleport1,teleport2,whip,whoosh,xylophone1,xylophone2,xylophone3,xylophone4';
$browser_alert_sounds_list = 'bark_dog,beep_double,beep_five,beep_up,bell_double,bell_school,bird,blaster1,blaster2,buzz1,buzz2,cash_register,chat_alert,click_single,click_double,click_quiet,close_encounter,confirmation,ding,droplet,droplet_double,elephant,email_alert,hold_tone,horn_bike,horn_car,horn_car_triple,horn_clown,horn_double,horn_train,meow_cat,scream_wilhelm,silence_quick,siren,slide_down,slide_up,swish,teleport1,teleport2,ticking_two,ticking_four,ticking_six,whip,whistle_up,whistle_two,whistle_three,whoosh,xylophone1,xylophone2,xylophone3,xylophone4';
if ($agent_screen_colors != 'default')
{
@@ -4570,6 +4575,8 @@ $CCAL_OUT .= "</table>";
var UnixTime = '<?php echo $StarTtimE ?>';
var UnixTimeMS = 0;
var JSseedTIME = <?php echo $JS_date ?>;
var BrowserEpoch = Math.round(Date.now() / 1000);
var BrowserServerEpochDiff = (BrowserEpoch - UnixTime);
var t = new Date();
t.setTime(JSseedTIME);
var c = new Date();
@@ -5232,6 +5239,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var customer_gone_seconds='<?php echo $customer_gone_seconds_negative ?>';
var updatedispo_resume_trigger='0';
var button_click_log='<?php echo $NOW_TIME ?>-----LOGIN---<?php echo $version ?> <?php echo $build ?> <?php echo $script_name ?>|';
var visibility_log='LOGIN 0 <?php echo "$StarTtimE $StarTtimE $agent_log_id" ?>';
var agent_display_fields='<?php echo $agent_display_fields ?>';
var customer_sec='0';
var allow_required_fields='<?php echo $allow_required_fields ?>';
@@ -5311,6 +5319,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var browser_alert_sound='<?php echo $browser_alert_sound ?>';
var browser_alert_volume='<?php echo $browser_alert_volume ?>';
var transfer_button_launch='<?php echo $transfer_button_launch ?>';
var SSagent_hidden_sound_seconds='<?php echo $SSagent_hidden_sound_seconds ?>';
var SSagent_hidden_sound='<?php echo $SSagent_hidden_sound ?>';
var SSagent_hidden_sound_volume='<?php echo $SSagent_hidden_sound_volume ?>';
var last_hidden_sound_UnixTime = '<?php echo $StarTtimE ?>';
var DiaLControl_auto_HTML = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready','','','','','','','YES');\"><img src=\"./images/<?php echo _QXZ("vdc_LB_paused.gif") ?>\" border=\"0\" alt=\"You are paused\" /></a>";
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause','','','','','','','YES');\"><img src=\"./images/<?php echo _QXZ("vdc_LB_active.gif") ?>\" border=\"0\" alt=\"You are active\" /></a>";
var DiaLControl_auto_HTML_OFF = "<img src=\"./images/<?php echo _QXZ("vdc_LB_blank_OFF.gif") ?>\" border=\"0\" alt=\"pause button disabled\" />";
@@ -5444,6 +5456,134 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
<?php echo $INSERT_head_js; ?>
// ################################################################################
// BEGIN Browser window visibility functions, for agent visibility logging and hidden alert sounds
var last_UnixTime = UnixTime;
var visibility_state = 'WENT VISIBLE';
var browserPrefixes = ['moz', 'ms', 'o', 'webkit'],
isVisible = true; // internal flag, defaults to true
// get the correct attribute name
function getHiddenPropertyName(prefix)
{
return (prefix ? prefix + 'Hidden' : 'hidden');
}
// get the correct event name
function getVisibilityEvent(prefix)
{
return (prefix ? prefix : '') + 'visibilitychange';
}
// get current browser vendor prefix
function getBrowserPrefix()
{
for (var i = 0; i < browserPrefixes.length; i++)
{
if(getHiddenPropertyName(browserPrefixes[i]) in document)
{
// return vendor prefix
return browserPrefixes[i];
}
}
// no vendor prefix needed
return null;
}
// bind and handle events
var browserPrefix = getBrowserPrefix(),
hiddenPropertyName = getHiddenPropertyName(browserPrefix),
visibilityEventName = getVisibilityEvent(browserPrefix);
function onVisible(temp_force_visible)
{
// prevent double execution
if ( (isVisible) && (temp_force_visible == '0') )
{
return;
}
// change flag value
BrowserEpoch = Math.round(Date.now() / 1000);
var ServerEpochNow = (BrowserEpoch - BrowserServerEpochDiff);
if (UnixTime > ServerEpochNow) {ServerEpochNow = UnixTime;}
isVisible = true;
visibility_state = 'WENT VISIBLE';
var temp_seconds = (ServerEpochNow - last_UnixTime);
//console.log(visibility_state + ' ' + temp_seconds);
visibility_log = visibility_log + 'HIDDEN' + " " + temp_seconds + " " + last_UnixTime + " " + ServerEpochNow + " " + agent_log_id + "|";
last_UnixTime = ServerEpochNow;
last_hidden_sound_UnixTime = ServerEpochNow;
button_click_log = button_click_log + "" + SQLdate + "-----Browser_Visibility---" + visibility_state + " " + temp_seconds + " " + UnixTime + "|";
}
function onHidden(temp_force_hidden)
{
// prevent double execution
if ( (!isVisible) && (temp_force_hidden == '0') )
{
return;
}
// change flag value
BrowserEpoch = Math.round(Date.now() / 1000);
var ServerEpochNow = (BrowserEpoch - BrowserServerEpochDiff);
if (UnixTime > ServerEpochNow) {ServerEpochNow = UnixTime;}
isVisible = false;
visibility_state = 'WENT HIDDEN';
var temp_seconds = (ServerEpochNow - last_UnixTime);
//console.log(visibility_state + ' ' + temp_seconds);
visibility_log = visibility_log + 'VISIBLE' + " " + temp_seconds + " " + last_UnixTime + " " + ServerEpochNow + " " + agent_log_id + "|";
last_UnixTime = ServerEpochNow;
last_hidden_sound_UnixTime = ServerEpochNow;
button_click_log = button_click_log + "" + SQLdate + "-----Browser_Visibility---" + visibility_state + " " + temp_seconds + " " + UnixTime + "|";
}
function handleVisibilityChange(forcedFlag)
{
// forcedFlag is a boolean when this event handler is triggered by a
// focus or blur eventotherwise it's an Event object
if(typeof forcedFlag === "boolean")
{
if(forcedFlag)
{
return onVisible('0');
}
return onHidden('0');
}
if(document[hiddenPropertyName])
{
return onHidden('0');
}
return onVisible('0');
}
document.addEventListener(visibilityEventName, handleVisibilityChange, false);
// extra event listeners for better behaviour
document.addEventListener('focus', function()
{
handleVisibilityChange(true);
}, false);
document.addEventListener('blur', function()
{
handleVisibilityChange(false);
}, false);
window.addEventListener('focus', function()
{
handleVisibilityChange(true);
}, false);
window.addEventListener('blur', function()
{
handleVisibilityChange(false);
}, false);
// END Browser window visibility functions, for agent debug logging
// ################################################################################
// ################################################################################
// Send Hangup command for Live call connected to phone now to Manager
function livehangup_send_hangup(taskvar)
@@ -5491,7 +5631,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
// ################################################################################
// Play MP3 audio file upon call arriving in agent screen, if enabled in system settings and campaign/in-group
// Play MP3 audio file upon call arriving in agent screen or agent hiding screen, if enabled in system settings and campaign/in-group
function play_browser_sound(temp_sound,temp_volume)
{
if ( (temp_sound != '---NONE---') && (temp_sound != '---DISABLED---') && (temp_sound != '') )
@@ -6255,8 +6395,9 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
if (xmlhttprequestcheckconf)
{
checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp + "&customer_chat_id=" + document.vicidial_form.customer_chat_id.value + "&live_call_seconds=" + VD_live_call_secondS + "&xferchannel=" + document.vicidial_form.xferchannel.value + "&check_for_answer=" + MDcheck_for_answer + "&MDnextCID=" + MDnextCID + "&campaign=" + campaign + "&phone_number=" + dialed_number + "&clicks=" + button_click_log;
checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp + "&customer_chat_id=" + document.vicidial_form.customer_chat_id.value + "&live_call_seconds=" + VD_live_call_secondS + "&xferchannel=" + document.vicidial_form.xferchannel.value + "&check_for_answer=" + MDcheck_for_answer + "&MDnextCID=" + MDnextCID + "&campaign=" + campaign + "&phone_number=" + dialed_number + "&visibility=" + visibility_log + "&clicks=" + button_click_log;
button_click_log='';
visibility_log='';
xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php');
xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttprequestcheckconf.send(checkconf_query);
@@ -16332,6 +16473,10 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
function LogouT(tempreason,temppause)
{
button_click_log = button_click_log + "" + SQLdate + "-----LogouT---" + tempreason + " " + temppause + "|";
onHidden('1');
onVisible('1');
check_for_conf_calls(session_id, '0');
if (MD_channel_look==1)
{alert("<?php echo _QXZ("You cannot log out during a Dial attempt. Wait 50 seconds for the dial to fail out if it is not answered"); ?>");}
else
@@ -16412,11 +16557,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
{
if (agent_logout_link == '1')
{
document.getElementById("LogouTBoxLink").innerHTML = logout_content + "<font class=\"loading_text\"><a href=\"" + agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + original_phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + orig_pass + "&LOGINvarONE=" + LOGINvarONE + "&LOGINvarTWO=" + LOGINvarTWO + "&LOGINvarTHREE=" + LOGINvarTHREE + "&LOGINvarFOUR=" + LOGINvarFOUR + "&LOGINvarFIVE=" + LOGINvarFIVE + "&hide_relogin_fields=" + hide_relogin_fields + "\" onclick=\"needToConfirmExit = false;\"><?php echo _QXZ("CLICK HERE TO LOG IN AGAIN"); ?></a></font>\n";
document.getElementById("LogouTBoxLink").innerHTML = logout_content + "<font class=\"loading_text\"><a href=\"" + agcPAGE + "?relogin=YES&session_epoch=" + UnixTime + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + original_phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + orig_pass + "&LOGINvarONE=" + LOGINvarONE + "&LOGINvarTWO=" + LOGINvarTWO + "&LOGINvarTHREE=" + LOGINvarTHREE + "&LOGINvarFOUR=" + LOGINvarFOUR + "&LOGINvarFIVE=" + LOGINvarFIVE + "&hide_relogin_fields=" + hide_relogin_fields + "\" onclick=\"needToConfirmExit = false;\"><?php echo _QXZ("CLICK HERE TO LOG IN AGAIN"); ?></a></font>\n";
}
else if (agent_logout_link == '2')
{
document.getElementById("LogouTBoxLink").innerHTML = logout_content + "<font class=\"loading_text\"><a href=\"" + agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + original_phone_login + "&LOGINvarONE=" + LOGINvarONE + "&LOGINvarTWO=" + LOGINvarTWO + "&LOGINvarTHREE=" + LOGINvarTHREE + "&LOGINvarFOUR=" + LOGINvarFOUR + "&LOGINvarFIVE=" + LOGINvarFIVE + "&hide_relogin_fields=" + hide_relogin_fields + "\" onclick=\"needToConfirmExit = false;\"><?php echo _QXZ("CLICK HERE TO LOG IN AGAIN"); ?></a></font>\n";
document.getElementById("LogouTBoxLink").innerHTML = logout_content + "<font class=\"loading_text\"><a href=\"" + agcPAGE + "?relogin=YES&session_epoch=" + UnixTime + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + original_phone_login + "&LOGINvarONE=" + LOGINvarONE + "&LOGINvarTWO=" + LOGINvarTWO + "&LOGINvarTHREE=" + LOGINvarTHREE + "&LOGINvarFOUR=" + LOGINvarFOUR + "&LOGINvarFIVE=" + LOGINvarFIVE + "&hide_relogin_fields=" + hide_relogin_fields + "\" onclick=\"needToConfirmExit = false;\"><?php echo _QXZ("CLICK HERE TO LOG IN AGAIN"); ?></a></font>\n";
}
else
{
@@ -19761,6 +19906,7 @@ function phone_number_format(formatphone) {
}
function all_refresh()
{
UnixTime++;
epoch_sec++;
check_n++;
even++;
@@ -19989,6 +20135,21 @@ function phone_number_format(formatphone) {
agent_events('login_invalid', '<?php echo _QXZ("This agent screen was not opened properly."); ?>', aec); aec++;
}
}
if ( (!isVisible) && (SSagent_hidden_sound_seconds >= 5) && (SSagent_hidden_sound_volume > 0) )
{
BrowserEpoch = Math.round(Date.now() / 1000);
var ServerEpochNow = (BrowserEpoch - BrowserServerEpochDiff);
var temp_agent_hidden_counter = (ServerEpochNow - last_hidden_sound_UnixTime);
if (temp_agent_hidden_counter > SSagent_hidden_sound_seconds)
{
var temp_seconds = (ServerEpochNow - last_UnixTime);
last_hidden_sound_UnixTime = ServerEpochNow;
button_click_log = button_click_log + "" + SQLdate + "-----agent_hidden_alert---" + temp_agent_hidden_counter + " " + SSagent_hidden_sound_seconds + " " + temp_seconds + " " + SSagent_hidden_sound + " " + SSagent_hidden_sound_volume + "|";
play_browser_sound(SSagent_hidden_sound,SSagent_hidden_sound_volume);
}
}
}
function pause() // Pauses the refreshing of the lists
{active_display=2; display_message=" - <?php echo _QXZ("ACTIVE DISPLAY PAUSED"); ?> - ";}
+61 -5
View File
File diff suppressed because one or more lines are too long
+3 -1
View File
@@ -1,4 +1,4 @@
# version: 20210317173901
# version: 20210318023201
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length.</QXZ>
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
@@ -1035,6 +1035,8 @@ settings-agent_xfer_park_3way Agent Screen Park Xfer Button <QXZ>This option def
settings-agent_logout_link Agent Screen Logout Link Credentials <QXZ>This option controls whether the agent screen logout link will contain the agent credentials as a part of the link, or if the link will go to a blank login page. -0- will go to a blank form and -1- will go to a form that has the user credentials filled in.</QXZ>
settings-agent_soundboards Agent Soundboards <QXZ>This option allows you to create agent soundboards that allow an agent in the user screen to click on audio files to have them play in their session. Default is 0 for disabled.</QXZ>
settings-browser_call_alerts Agent Browser Call Alerts <QXZ>This option, if enabled, will allow you to select a sound, at the campaign level, when a call arrives in an agent session, to be played by the web browser program that the agent is using to log into the Agent Screen with. This is only recommended for agents using softphones or webphones. If you decide to use this option, you may want to contact your system administrator to disable the default enter and leave session sounds on your dialers. Default is 0 for disabled.</QXZ>
settings-agent_hidden_sound Agent Hidden Browser Sound <QXZ>This feature will allow you to have the selected sound file played to the Agent Screen when the web browser window with the Agent Screen in it is hidden or the agent changes to a different application on their computer. To enable this feature, the Agent Hidden Browser Sound Seconds below must be greater than 0. This feature can be used to disable web browser javascript throttling if set to an audible sound at a 20 second interval. We have tested this with the -click_quiet- sound file at a volume of -25-.</QXZ>
settings-agent_hidden_sound_seconds Agent Hidden Browser Sound Seconds <QXZ>This is the interval at which the selected Agent Hidden Browser Sound above will be played. If this is set to 20, then the Agent Hidden Browser Sound will be played every 20 seconds that the agent screen is hidden from view. Default is 0 for disabled.</QXZ>
settings-enable_pause_code_limits Enable Pause Code Time Limits <QXZ>This option allows you to be able to set the Time Limit field in campaign pause codes, which will change the color of the agent on the Real-Time Report if they are in that pause code for more than the defined amount of seconds. Default is 0 for disabled.</QXZ>
settings-agentonly_callback_campaign_lock Agent Only Callback Campaign Lock <QXZ>This option defines whether AGENTONLY callbacks are locked to the campaign that the agent originally created them under. Setting this to 1 means that the agent can only dial them from the campaign they were set under, 0 means that the agent can access them no matter what campaign they are logged into. Default is 1.</QXZ>
settings-callback_time_24hour Callback Time 24 Hours <QXZ>This option defines whether the agent sees 12 hour time with AM PM options or 24 hour time on the Callback setting screen in the agent interface. Default is 0 for disabled.</QXZ>