Added system setting(agent_screen_timer) for selection of JavaScript timer: setTimeout or EventSource for the agent screen
git-svn-id: svn://192.168.202.10@3407 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
WEB BROWSER JAVASCRIPT THROTTLING Started: 2021-03-25 Updated: 2021-03-25
|
||||
WEB BROWSER JAVASCRIPT THROTTLING Started: 2021-03-25 Updated: 2021-03-27
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ Below are the ways you can prevent Chrome's Intensive Javascript Throttling from
|
||||
2. Manually disable the Chrome throttling flag on each of your agent's web browsers
|
||||
3. Use a WebRTC phone for your agent phone connection(like VICIphone)
|
||||
4. Enable the VICIdial System Settings for "Agent Hidden Browser Sound"
|
||||
5. Switch the VICIdial System Setting for "Agent Screen Timer" to 'EventSource'
|
||||
|
||||
|
||||
More information on each of the above...
|
||||
@@ -77,6 +78,12 @@ Adding this new feature also required us to add Agent Screen Visibility Logging
|
||||
|
||||
|
||||
|
||||
5. SWITCH THE VICIDIAL SYSTEM SETTING FOR "AGENT SCREEN TIMER" TO 'EventSource'
|
||||
|
||||
Thanks to 'fperdomo' on the VICIdial Forums for posting a simple method using SSE to work-around the Chrome JavasScript Throttling issue by replacing the JavaScript "setTimeout()" with an "EventSource()" that runs once a second. After some fine-tuning and testing in different web browsers, we committed this as an optional System Setting called "Agent Screen Timer" to the VICIdial codebase in svn/trunk revision 3407. Since EventSource SSE uses open connection streaming over HTTP, some older networks and proxy servers may have problems handling the open connections, so be sure to test on your network before enabling during production times.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
THE FUTURE
|
||||
@@ -84,6 +91,15 @@ THE FUTURE
|
||||
It looks like the maintainers of Chrome have every intention of increasing Javascript Throttling in the future, but hopefully they will leave the above methods for disabling it in place.
|
||||
|
||||
|
||||
Why not switch the VICIdial Agent Screen from AJAX(Polling) to using streaming server connections (SSE, Server-Sent-Events) like EventSource or WebSockets?
|
||||
|
||||
First of all, switching to SSE would take a tremendous amount of development and testing time since none of the code is set to work like that currently.
|
||||
|
||||
Second, this would require moving some of the data processing to the server, and it would require presistent connections to web services, which could greatly reduce webserver capacity.
|
||||
|
||||
Third, some older networks and proxy servers do not support perpetual connections like SSE uses, which will cause the network to fail to transmit all data to the client workstation, so it is not a one-size-fits-all solution like AJAX has been for the last 16 years.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1905,7 +1905,8 @@ two_factor_auth_hours SMALLINT(5) default '0',
|
||||
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'
|
||||
agent_hidden_sound_seconds TINYINT(3) UNSIGNED default '0',
|
||||
agent_screen_timer VARCHAR(20) default 'setTimeout'
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -4874,4 +4875,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='1627',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1628',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -1608,3 +1608,7 @@ UPDATE system_settings SET db_schema_version='1626',db_schema_update_date=NOW()
|
||||
ALTER TABLE vicidial_inbound_groups ADD populate_lead_comments VARCHAR(40) default 'CALLERID_NAME';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1627',db_schema_update_date=NOW() where db_schema_version < 1627;
|
||||
|
||||
ALTER TABLE system_settings ADD agent_screen_timer VARCHAR(20) default 'setTimeout';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1628',db_schema_update_date=NOW() where db_schema_version < 1628;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
header('Content-Type: text/event-stream');
|
||||
header('Cache-Control: no-cache');
|
||||
|
||||
$time = date('r');
|
||||
// If the connection closes, retry in 1 second
|
||||
echo "retry: {$_GET['refresh_interval']}\n";
|
||||
echo "data: The server time is: {$time}\n\n";
|
||||
flush();
|
||||
@@ -662,10 +662,11 @@
|
||||
# 210320-2348 - Added additional update_fields options: scriptreload,script2reload
|
||||
# 210322-1301 - Fixed issue with agent_hidden_sound
|
||||
# 210324-1604 - Added leave_3way_start_recording campaign options
|
||||
# 210327-2058 - Added system setting(agent_screen_timer) for selection of JavaScript timer: setTimeout or EventSource
|
||||
#
|
||||
|
||||
$version = '2.14-630c';
|
||||
$build = '210324-1604';
|
||||
$version = '2.14-631c';
|
||||
$build = '210327-2058';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=95;
|
||||
$one_mysql_log=0;
|
||||
@@ -786,7 +787,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,agent_hidden_sound_seconds,agent_hidden_sound,agent_hidden_sound_volume 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,agent_screen_timer 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";}
|
||||
@@ -843,6 +844,7 @@ if ($qm_conf_ct > 0)
|
||||
$SSagent_hidden_sound_seconds = $row[46];
|
||||
$SSagent_hidden_sound = $row[47];
|
||||
$SSagent_hidden_sound_volume = $row[48];
|
||||
$SSagent_screen_timer = $row[49];
|
||||
if ( ($SSagent_hidden_sound == '---NONE---') or ($SSagent_hidden_sound == '') ) {$SSagent_hidden_sound_seconds=0;}
|
||||
}
|
||||
else
|
||||
@@ -4594,6 +4596,7 @@ $CCAL_OUT .= "</table>";
|
||||
<script language="Javascript">
|
||||
|
||||
var needToConfirmExit = true;
|
||||
var source = null;
|
||||
var MTvar;
|
||||
var NOW_TIME = '<?php echo $NOW_TIME ?>';
|
||||
var SQLdate = '<?php echo $NOW_TIME ?>';
|
||||
@@ -20010,7 +20013,51 @@ function phone_number_format(formatphone) {
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout("all_refresh()", refresh_interval);
|
||||
<?php
|
||||
### Selection of JavaScript timer, either EventSource() or setTimeout()
|
||||
if ($SSagent_screen_timer == 'EventSource')
|
||||
{
|
||||
?>
|
||||
|
||||
if(typeof(EventSource) !== "undefined")
|
||||
{
|
||||
if (!source)
|
||||
{
|
||||
if (refresh_interval < 7300000)
|
||||
{
|
||||
source = new EventSource("sse.php?refresh_interval=" + refresh_interval);
|
||||
source.onmessage = function(event)
|
||||
{
|
||||
if (refresh_interval < 7300000)
|
||||
{
|
||||
//console.log('event', event);
|
||||
all_refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('Logout, connection closed 1');
|
||||
source.close();
|
||||
}
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('Logout, connection closed 2');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout("all_refresh()", refresh_interval);
|
||||
}
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\n setTimeout(\"all_refresh()\", refresh_interval);\n";
|
||||
}
|
||||
?>
|
||||
|
||||
}
|
||||
function all_refresh()
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
# version: 20210325223001
|
||||
# version: 20210327210801
|
||||
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>
|
||||
@@ -1094,6 +1094,7 @@ settings-enable_gdpr_download_deletion Enable GDPR-compliant Data Download Delet
|
||||
settings-enable_drop_lists Enable Drop Lists <QXZ>This setting if enabled will make the Drop Lists feature appear under the LISTS menu. This feature set can take dropped call log records and create new leads in a list from multiple inbound groups. Default is 0 for disabled.</QXZ>
|
||||
settings-source_id_display Admin Lead Source ID Display <QXZ>This setting will make the Source ID lead field show up in the Admin Modify Lead screen. Default is 0 for disabled.</QXZ>
|
||||
settings-agent_debug_logging Agent Screen Debug Logging <QXZ>This setting if enabled will log almost all agent screen mouse clicks and AJAX processes triggered by the agent screen. To enable for all agents, set this option to 1. To enable only for one agent on the system, set this option to the user that you want to log. Warning, this feature can log hundreds of entries per phone call, so use with caution. These agent debug records are deleted after 7 days. Default is 0 for disabled.</QXZ>
|
||||
settings-agent_screen_timer Agent Screen Timer <QXZ>This will select the method of JavaScript timer to be used by the Agent Screen. The original method is setTimeout, which maintains the timer directly in JavaScript. An alternative method is EventSource, which uses a script on the server to trigger the timer. You may want to use EventSource if your agents are using a Chromium-based web browser that has limitations on how native JavaScript timers work, although using this method may possibly cause issues if you have a poor network connection to the server or are on an older network or proxy that does not handle streaming web services well. Default is setTimeout</QXZ>
|
||||
settings-enhanced_disconnect_logging Enhanced Disconnect Logging <QXZ>This setting, set to 1, enables logging of calls that get a CONGESTION signal with a cause code of 1, 19, 21, 34 or 38. Setting this to 2 will additionally log calls with cause codes of 18-CHANUNAVAIL and 102. Default is 0 for disabled.</QXZ>
|
||||
settings-sip_event_logging SIP Event Logging <QXZ>This setting will enable logging of SIP events on outbound phone calls for servers that are running patched versions of Asterisk 13 or higher. Default is 0 for disabled.</QXZ>
|
||||
settings-cache_carrier_stats_realtime Cached Realtime Carrier Stats <QXZ>This setting if enabled will change the real-time report from gathering the carrier log stats every time it is refreshed on every screen it is running on, to a cached set of carrier log stats that are refreshed once per minute. Default is 0 for disabled.</QXZ>
|
||||
|
||||
Reference in New Issue
Block a user