diff --git a/agc_2-X/trunk/docs/WEB_BROWSER_JAVASCRIPT_THROTTLING.txt b/agc_2-X/trunk/docs/WEB_BROWSER_JAVASCRIPT_THROTTLING.txt index 70383063..6c7326d1 100644 --- a/agc_2-X/trunk/docs/WEB_BROWSER_JAVASCRIPT_THROTTLING.txt +++ b/agc_2-X/trunk/docs/WEB_BROWSER_JAVASCRIPT_THROTTLING.txt @@ -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. + + diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index 1d398e33..a8273f10 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -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(); diff --git a/agc_2-X/trunk/extras/upgrade_2.14.sql b/agc_2-X/trunk/extras/upgrade_2.14.sql index c2b7c8ac..46bfc99e 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -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; diff --git a/agc_2-X/trunk/www/agc/sse.php b/agc_2-X/trunk/www/agc/sse.php new file mode 100644 index 00000000..6391e1bd --- /dev/null +++ b/agc_2-X/trunk/www/agc/sse.php @@ -0,0 +1,9 @@ + 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 .= "";