From ff4c525a6faedda95c0612bfd222492725028925 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 21 Oct 2022 16:42:59 +0000 Subject: [PATCH] Added webphone_settings option to phones, pointed to a settings container git-svn-id: svn://192.168.202.10@3650 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 3 + .../trunk/extras/MySQL_AST_CREATE_tables.sql | 4 +- agc_2-X/trunk/extras/upgrade_2.14.sql | 6 ++ agc_2-X/trunk/www/agc/phone_only.php | 44 ++++++++++- agc_2-X/trunk/www/agc/vicidial.php | 44 ++++++++++- agc_2-X/trunk/www/vicidial/admin.php | 76 ++++++++++++++++--- .../trunk/www/vicidial/help_documentation.txt | 3 +- 7 files changed, 160 insertions(+), 20 deletions(-) diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 2a0f8105..d81ee74b 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -730,6 +730,9 @@ OTHER CHANGES: 205. Added User Group "Script Override" option, with per-campaign activation. +206. Added "Webphone Settings" option to Phones, allows for more WebRTC config + options to be set through a Settings Container. + 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 84e2072e..09c124f1 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -105,6 +105,7 @@ webphone_layout VARCHAR(255) default '', mohsuggest VARCHAR(100) default '', peer_status ENUM('UNKNOWN','REGISTERED','UNREGISTERED','REACHABLE','LAGGED','UNREACHABLE') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'UNKNOWN', ping_time SMALLINT(6) DEFAULT NULL, +webphone_settings VARCHAR(40) default 'VICIPHONE_SETTINGS', index (server_ip), index (voicemail_id), index (dialplan_number), @@ -5159,6 +5160,7 @@ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_type,user_group,container_entry) VALUES ('INTERNATIONAL_DNC_IMPORT','Process DNC lists of various countries from FTP site','PERL_CLI','---ALL---','# This setting container is used for the international DNC system. \r\n# The below two settings are mandatory for importing suppression lists\r\n# and tell the import process where to look for new files and where to\r\n# move them when handled. These settings cannot have the same value. \r\n--file-dir=/root/ftp\r\n--file-destination=/root/ftp/DONE\r\n\r\n# Uncomment below and set the status to whatever custom disposition you \r\n# would like already-loaded leads to be set to when they dedupe against\r\n# a country\'s DNC list (default is \"DNCI\")\r\n# --dnc-status-override=BMNR\r\n\r\n# The below settings are optional for when files are stored on a remote\r\n# server. It is strongly recommended these settings are not used and\r\n# that the processing scripts and files are stored locally on the same\r\n# server. \r\n# --ftp-host=localhost\r\n# --ftp-user=user\r\n# --ftp-pwd=pwd\r\n# --ftp-port=21\r\n# --ftp-passive=1\r\n'),('DNC_IMPORT_FORMATS','Import formats for DNC files','OTHER','---ALL---','# This setting container is used for storing file formats used when \r\n# loading DNC suppression lists into the dialer. \r\n#\r\n# import template => (delimited|fixed),delimiter,phone1(,phone2,phone3)\r\n#\r\n# For delimited files, the phone1 value should be the index value of\r\n# the field where the phone appears. The first array index is 0 and\r\n# indexes continue through the natural numbers.\r\n\r\n# In delimited files, acceptable values for the \"delimiter\" field are:\r\n# - \"tab\", \"pipe\", \"comma\", \"quote-comma\"\r\nBASIC_DELIMITED_FORMAT => delimited,pipe,0\r\n\r\n# If the phone number is split into multiple fields (ex: area code in\r\n# one field, rest of the number in another), simply list additional \r\n# indices of the phone number fields separated by commas in the order \r\n# in which the data should be combined to make the complete phone \r\n# number \r\nDELIMITED_WITH_AC_AND_EXCHANGE_SPLIT => delimited,tab,0,1\r\n\r\n# For fixed-length files, the phone field values should be of the type:\r\n# - \"starting_position|length\"\r\nBASIC_FIXED_FORMAT => fixed,,0|10\r\n\r\n# (delimited|fixed) is not used for CSV/Excel files, so all that needs \r\n# providing for those is the index field value(s) of the phone number\r\nBASIC_CSV_OR_EXCEL_FORMAT => ,,0'),('DNC_CURRENT_BLOCKED_LISTS','Lists currently blocked due to pending DNC scrub','READ_ONLY','---ALL---',''); INSERT INTO vicidial_settings_containers(container_id,container_notes,container_type,user_group,container_entry) VALUES ('USER_LOCATIONS_SYSTEM','User Locations List','OTHER','---ALL---',';location|description\n|default\n'); INSERT INTO vicidial_settings_containers(container_id,container_notes,container_type,user_group,container_entry) VALUES ('USER_CODES_SYSTEM','User Codes List','OTHER','---ALL---',''); +INSERT INTO vicidial_settings_containers(container_id,container_notes,container_type,user_group,container_entry) VALUES ('VICIPHONE_SETTINGS','VICIphone WebRTC Extra Settings','WEBPHONE_SETTINGS','---ALL---','# determines if automatic gain control is enabled\nautoGain : 0\n\n# determines if echo cancellation is enabled\nechoCan : 0\n\n# determines if noise suppression is enabled\nnoiseSup :0\n\n# determines if the reg_exten is called upon successful registration\ndialRegExten : 1\n\n# determines the regional sound to use for progress audio\nprogReg : na\n\n# English translation phrases\nlangAttempting:"Attempting"\nlangConnected:"WS Connected"\nlangDisconnected:"WS Disconnected"\nlangExten:"Extension"\nlangIncall:"Incall"\nlangInit:"Initializing..."\nlangRedirect:"Redirect"\nlangRegFailed:"Reg. Failed"\nlangRegistering:"Registering"\nlangRegistered:"Registered"\nlangReject:"Rejected"\nlangRinging:"Ringing"\nlangSend:"Send"\nlangTrying:"Trying"\nlangUnregFailed:"Unreg. Failed"\nlangUnregistered:"Unregistered"\nlangUnregistering:"Unregistering"\nlangWebrtcError:"Something went wrong with WebRTC. Either your browser does not support the necessary WebRTC functions, you did not allow your browser to access the microphone, or there is a configuration issue. Please check your browsers error console for more details. For a list of compatible browsers please vist http://webrtc.org/"'); INSERT INTO `vicidial_settings_containers` VALUES ('VERM_STATUS_NAMES_OVERRIDE','Override dialer status names in enhanced reporting','OTHER','---ALL---','; For each status name you want overridden, type the status followed by\r\n; a pipe, then the new status name\r\n; Ex:\r\n; NZ|Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupoka\r\n201214|Request To Cancel\r\n210200|No Answer-Incomplete Call\r\n210201|Contact Established\r\n210202|Provider Review - HB\r\n210203|Promise to Pay\r\n210204|Setup Payment Plan\r\n210205|Research-Inquiry\r\n210206|Voice Mail Left - HB\r\n210207|Do Not Call\r\n210208|Appeal Verification\r\n210209|Bad Phone\r\n210210|Bad Address\r\n210211|Direct Pay Verification\r\n210213|Provider Approved\r\n210215|Update Notes Only\r\n210216|Voicemail-No Status Change\r\n210217|Sent Letter Request - HB\r\n210218|Auto VoiceMail Left - HB\r\n210219|Auto VoiceMail-No Status Change\r\n210302|Provider Review - LB\r\n210306|Voice Mail Left - LB\r\n210317|Sent Letter Request - LB\r\n210318|Auto VoiceMail Left - LB\r\n211503|Provider - COVID-19\r\n211603|Transferred Call to MLA\r\n'), ('VERM_REPORT_OPTIONS','Container for customizing VERM report output','OTHER','---ALL---','; This is the report queue used if none is chosen by the user\r\n; It\'s preloaded in some forms as well\r\nVERM_default_report_queue => ALL\r\n\r\n; If there are statuses to exclude from reports, list them here\r\n; Separate with commas. Default is AFTHRS\r\nexc_addtl_statuses => AFTHRS\r\n\r\n; Set the below value to 1 (or anything non-blank/non-zero) in order to \r\n; show the agents ID in addition to their full name in the report results\r\nshow_full_agent_info => 1\r\n\r\n; Some reports count \"lost\" calls - which are defined by the below variable\r\n; listing what you define as \"lost\" dispos. Separate with commas.\r\nlost_statuses => LOST,210208,DISPO\r\n\r\n; You can create a detailed IVR survey report for ingroups by defining\r\n; \"ivr_survey_ingroups_detail\" and \"ivr_survey_ingroups_voicemails.\"\r\n; For \"details\", supply an ingroup used as a tracking group on call menus.\r\n; Then, add a pipe and after that list all call menus that use the ingroup\r\n; as the tracking group, separating each with a comma\r\n; To track whether the calls went to voicemail, list every call menu/option\r\n; combination that goes to voicemail, separating the call menu from the \r\n; option with a pipe. One callmenu/option combo per line.\r\nivr_survey_ingroups_detail => 521205|561401,561402,561403,561404,561505\r\nivr_survey_ingroups_voicemails => 561505|t\r\n\r\n; #####################################################\r\n; # ALL of the below are used in the wallboard report #\r\n; #####################################################\r\nVERM_default_outb_widget_queue => ALL_OUT\r\nVERM_default_inb_widget_queue1 => 514915v_USA_Shared\r\nVERM_default_inb_widget_queue2 => 515915v_MLA_Shared\r\n\r\n; Used specifically for the SLA widget\r\n; Uses ingroups - separate multiple ingroups by commas\r\n; Comment out or leave blank to count all ingroups\r\nSLA_LEVEL_PCT_ingroups => 514915v,515915v\r\n\r\n; This removes remote agents from the wallboard reports\r\n; Comment out to include remote agents (or set to zero)\r\nomit_remote_agents => 1\r\n'); INSERT INTO `wallboard_widgets` VALUES ('queues_widget_1','AGENTS_AND_QUEUES','queues','','TEXT',5,'N',1,'Queue Information','','',NULL,'','',NULL,2),('queues_widget_0','AGENTS_AND_QUEUES','queues','','LOGO',2,'N',1,NULL,'','',NULL,'','',NULL,1),('queues_widget_2','AGENTS_AND_QUEUES','queues','SLA Level %','SLA_LEVEL_PCT',1,'N',1,NULL,'','>60',NULL,'','',NULL,3),('queues_widget_3','AGENTS_AND_QUEUES','queues','Outbound calls','LIVE_QUEUE_INFO',1,'N',1,'','201201','','','','','yellow_alarm,|red_alarm,',4),('queues_widget_4','AGENTS_AND_QUEUES','queues','USA Ded Inbound','LIVE_QUEUE_INFO',1,'N',1,'','ALL_IN','','','','','yellow_alarm,|red_alarm,',5),('queues_widget_5','AGENTS_AND_QUEUES','queues','MLA Ded Inbound','LIVE_QUEUE_INFO',1,'N',1,'','514911','','','','','yellow_alarm,|red_alarm,',6),('queues_widget_6','AGENTS_AND_QUEUES','queues','N Waiting Calls','N_WAITING_CALLS',1,'N',1,NULL,'','',NULL,'','',NULL,7),('queues_widget_7','AGENTS_AND_QUEUES','queues','Offered Calls','OFFERED_CALLS',1,'N',1,NULL,'','',NULL,'','',NULL,8),('queues_widget_8','AGENTS_AND_QUEUES','queues','Answered Calls','ANSWERED_CALLS',1,'N',1,NULL,'','',NULL,'','',NULL,9),('queues_widget_9','AGENTS_AND_QUEUES','queues','Lost Calls','LOST_CALLS',1,'N',1,NULL,'','',NULL,'','',NULL,10),('queues_widget_10','AGENTS_AND_QUEUES','queues','Longest Wait','LONGEST_WAIT',1,'N',1,NULL,'','',NULL,'','',NULL,11),('queues_widget_11','AGENTS_AND_QUEUES','queues','Live Queues','LIVE_QUEUES',1,'Y',1,NULL,'','',NULL,'','',NULL,12),('queues_widget_12','AGENTS_AND_QUEUES','queues','Live Calls','LIVE_CALLS',1,'Y',2,NULL,'','',NULL,'','',NULL,13),('agent_widget_0','AGENTS_AND_QUEUES','agents','','LOGO',2,'N',1,NULL,'','',NULL,'','',NULL,1),('agent_widget_1','AGENTS_AND_QUEUES','agents','N Waiting Calls','N_WAITING_CALLS',1,'N',1,NULL,'','',NULL,'','',NULL,2),('agent_widget_2','AGENTS_AND_QUEUES','agents','Agents Ready','AGENTS_READY',1,'N',1,NULL,'','',NULL,'','',NULL,3),('agent_widget_3','AGENTS_AND_QUEUES','agents','Agents On Call','N_AGENTS_ON_CALL',1,'N',1,NULL,'','',NULL,'','',NULL,4),('agent_widget_4','AGENTS_AND_QUEUES','agents','N Answered Calls','N_ANSWERED_CALLS',1,'N',1,NULL,'','',NULL,'','',NULL,5),('agent_widget_5','AGENTS_AND_QUEUES','agents','Clock','CLOCK',1,'N',1,NULL,'','',NULL,'','',NULL,6),('agent_widget_6','AGENTS_AND_QUEUES','agents','Live Agents','LIVE_AGENTS',1,'Y',3,NULL,'','',NULL,'','',NULL,7); @@ -5167,4 +5169,4 @@ INSERT INTO `wallboard_reports` VALUES ('AGENTS_AND_QUEUES','Agents and Queues', UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1668',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1669',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 3ff75187..15149049 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -2043,3 +2043,9 @@ UPDATE system_settings SET db_schema_version='1667',db_schema_update_date=NOW() ALTER TABLE system_settings ADD login_kickall ENUM('0','1','2','3','4','5','6','7') default '0'; UPDATE system_settings SET db_schema_version='1668',db_schema_update_date=NOW() where db_schema_version < 1668; + +ALTER TABLE phones ADD webphone_settings VARCHAR(40) default 'VICIPHONE_SETTINGS'; + +INSERT INTO vicidial_settings_containers(container_id,container_notes,container_type,user_group,container_entry) VALUES ('VICIPHONE_SETTINGS','VICIphone WebRTC Extra Settings','WEBPHONE_SETTINGS','---ALL---','# determines if automatic gain control is enabled\nautoGain : 0\n\n# determines if echo cancellation is enabled\nechoCan : 0\n\n# determines if noise suppression is enabled\nnoiseSup :0\n\n# determines if the reg_exten is called upon successful registration\ndialRegExten : 1\n\n# determines the regional sound to use for progress audio\nprogReg : na\n\n# English translation phrases\nlangAttempting:"Attempting"\nlangConnected:"WS Connected"\nlangDisconnected:"WS Disconnected"\nlangExten:"Extension"\nlangIncall:"Incall"\nlangInit:"Initializing..."\nlangRedirect:"Redirect"\nlangRegFailed:"Reg. Failed"\nlangRegistering:"Registering"\nlangRegistered:"Registered"\nlangReject:"Rejected"\nlangRinging:"Ringing"\nlangSend:"Send"\nlangTrying:"Trying"\nlangUnregFailed:"Unreg. Failed"\nlangUnregistered:"Unregistered"\nlangUnregistering:"Unregistering"\nlangWebrtcError:"Something went wrong with WebRTC. Either your browser does not support the necessary WebRTC functions, you did not allow your browser to access the microphone, or there is a configuration issue. Please check your browsers error console for more details. For a list of compatible browsers please vist http://webrtc.org/"'); + +UPDATE system_settings SET db_schema_version='1669',db_schema_update_date=NOW() where db_schema_version < 1669; diff --git a/agc_2-X/trunk/www/agc/phone_only.php b/agc_2-X/trunk/www/agc/phone_only.php index e02e9926..5eea366d 100644 --- a/agc_2-X/trunk/www/agc/phone_only.php +++ b/agc_2-X/trunk/www/agc/phone_only.php @@ -22,10 +22,11 @@ # 210615-1028 - Default security fixes, CVE-2021-28854 # 210616-2043 - Added optional CORS support, see options.php for details # 220220-0936 - Added allow_web_debug system setting +# 221021-1026 - Added webphone_settings phones option # -$version = '2.14-18p'; -$build = '220220-0936'; +$version = '2.14-19p'; +$build = '221021-1026'; $php_script = 'phone_only.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=74; @@ -629,7 +630,7 @@ else echo "\n"; } echo ""._QXZ("Phone web client")."\n"; - $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list,webphone_dialpad,phone_ring_timeout,on_hook_agent,webphone_auto_answer,webphone_dialbox,webphone_mute,webphone_volume,webphone_debug,webphone_layout from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list,webphone_dialpad,phone_ring_timeout,on_hook_agent,webphone_auto_answer,webphone_dialbox,webphone_mute,webphone_volume,webphone_debug,webphone_layout,webphone_settings from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'09015',$VD_login,$server_ip,$session_name,$one_mysql_log);} @@ -709,6 +710,7 @@ else $webphone_volume=$row[82]; $webphone_debug=$row[83]; $webphone_layout=$row[84]; + $webphone_settings=$row[85]; $no_empty_session_warnings=0; if ( ($phone_login == 'nophone') or ($on_hook_agent == 'Y') ) @@ -831,6 +833,40 @@ else $system_key =$row[0]; } } + + $webphone_settings_scrubbed = ''; + if (strlen($webphone_settings) > 0) + { + $stmt="SELECT container_entry FROM vicidial_settings_containers WHERE container_id='$webphone_settings';"; + $rslt=mysql_to_mysqli($stmt, $link); + if (mysqli_num_rows($rslt) > 0) + { + $row=mysqli_fetch_row($rslt); + $webphone_settings_entry = $row[0]; + + ### scrub unnecessary characters from the settings container + $webphone_settings_lines = preg_split('/\r\n|\r|\n/',$webphone_settings_entry); + + foreach( $webphone_settings_lines as $line ) + { + # remove comments + if ( strpos($line, '#') === 0 ) + { + $line = substr($line, 0, strpos($line, '#')); + } + + # remove whitespace outside double quotes + $line = preg_replace('~"[^"]*"(*SKIP)(*F)|\s+~',"",$line); + + # remove blank lines + if ($line != '') + { + $webphone_settings_scrubbed = $webphone_settings_scrubbed . $line . '\n'; + } + } + } + } + $webphone_options='INITIAL_LOAD'; if ($webphone_dialpad == 'Y') {$webphone_options .= "--DIALPAD_Y";} if ($webphone_dialpad == 'N') {$webphone_options .= "--DIALPAD_N";} @@ -847,6 +883,8 @@ else if ($webphone_debug == 'Y') {$webphone_options .= "--DEBUG";} if (strlen($web_socket_url) > 5) {$webphone_options .= "--WEBSOCKETURL$web_socket_url";} if (strlen($webphone_layout) > 0) {$webphone_options .= "--WEBPHONELAYOUT$webphone_layout";} + if (strlen($session_id) > 0) { $webphone_options .= "--SESSION$session_id";} + if (strlen($webphone_settings_scrubbed) > 0) {$webphone_options .= "--SETTINGS$webphone_settings_scrubbed";} $webphone_url = preg_replace("/LOCALFQDN/",$FQDN,$webphone_url); if ($DB > 0) {echo "";} diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index bb15b458..33f47c17 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -703,10 +703,11 @@ # 220922-1032 - Fix for loading internal chat while agent screen is still loading # 221012-1723 - Fix for webform URLs updates with correct recording variables # 221020-1651 - Added login_kickall system setting +# 221021-1022 - Added webphone_settings phones option # -$version = '2.14-671c'; -$build = '221020-1651'; +$version = '2.14-672c'; +$build = '221021-1022'; $php_script = 'vicidial.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=98; @@ -3600,7 +3601,7 @@ else ##### END phone login load balancing functions ##### echo "Agent web client\n"; - $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list,webphone_dialpad,phone_ring_timeout,on_hook_agent,webphone_auto_answer,webphone_dialbox,webphone_mute,webphone_volume,webphone_debug,webphone_layout from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list,webphone_dialpad,phone_ring_timeout,on_hook_agent,webphone_auto_answer,webphone_dialbox,webphone_mute,webphone_volume,webphone_debug,webphone_layout,webphone_settings from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} @@ -3680,6 +3681,7 @@ else $webphone_volume=$row[82]; $webphone_debug=$row[83]; $webphone_layout=$row[84]; + $webphone_settings=$row[85]; if (strlen($webphone_layout_override)>0) {$webphone_layout = $webphone_layout_override;} @@ -4099,6 +4101,40 @@ else $system_key =$row[0]; } } + + $webphone_settings_scrubbed = ''; + if (strlen($webphone_settings) > 0) + { + $stmt="SELECT container_entry FROM vicidial_settings_containers WHERE container_id='$webphone_settings';"; + $rslt=mysql_to_mysqli($stmt, $link); + if (mysqli_num_rows($rslt) > 0) + { + $row=mysqli_fetch_row($rslt); + $webphone_settings_entry = $row[0]; + + ### scrub unnecessary characters from the settings container + $webphone_settings_lines = preg_split('/\r\n|\r|\n/',$webphone_settings_entry); + + foreach( $webphone_settings_lines as $line ) + { + # remove comments + if ( strpos($line, '#') === 0 ) + { + $line = substr($line, 0, strpos($line, '#')); + } + + # remove whitespace outside double quotes + $line = preg_replace('~"[^"]*"(*SKIP)(*F)|\s+~',"",$line); + + # remove blank lines + if ($line != '') + { + $webphone_settings_scrubbed = $webphone_settings_scrubbed . $line . '\n'; + } + } + } + } + $webphone_options='INITIAL_LOAD'; if ($webphone_dialpad == 'Y') {$webphone_options .= "--DIALPAD_Y";} if ($webphone_dialpad == 'N') {$webphone_options .= "--DIALPAD_N";} @@ -4115,6 +4151,8 @@ else if ($webphone_debug == 'Y') {$webphone_options .= "--DEBUG";} if (strlen($web_socket_url) > 5) {$webphone_options .= "--WEBSOCKETURL$web_socket_url";} if (strlen($webphone_layout) > 0) {$webphone_options .= "--WEBPHONELAYOUT$webphone_layout";} + if (strlen($session_id) > 0) { $webphone_options .= "--SESSION$session_id";} + if (strlen($webphone_settings_scrubbed) > 0) {$webphone_options .= "--SETTINGS$webphone_settings_scrubbed";} $webphone_url = preg_replace("/LOCALFQDN/",$FQDN,$webphone_url); ### base64 encode variables diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 1b687c49..422ab3e4 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -17,7 +17,7 @@ require("functions.php"); ###################################################################################################### $page_width='870'; -$section_width='750'; +$section_width='850'; $header_font_size='12'; $subheader_font_size='11'; $subcamp_font_size='11'; @@ -5939,12 +5939,13 @@ if ($SSscript_remove_js > 0) # 220921-1319 - Added more User failed login details for level 9 users # 221017-0822 - Fix for Copy Carrier issue #1384 # 221020-1632 - Added login_kickall system setting +# 221021-1038 - Added webphone_settings option to phones, pointed to a settings container # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-868a'; -$build = '221020-1632'; +$admin_version = '2.14-869a'; +$build = '221021-1038'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -11225,6 +11226,7 @@ if ($ADD==192111111111) + $NWB#settings_containers-container_type$NWE\n"; echo ""._QXZ("Admin User Group").": $NWB#phones-login$NWE\n"; echo ""._QXZ("Login Password").": $NWB#phones-pass$NWE\n"; echo ""._QXZ("Registration Password").": $NWB#phones-conf_secret$NWE     "._QXZ("Strength").":   "._QXZ("Length").": 0\n"; - echo ""._QXZ("Set As Webphone").": $NWB#phones-is_webphone$NWE\n"; - echo ""._QXZ("Webphone Dialpad").": $NWB#phones-webphone_dialpad$NWE\n"; - echo ""._QXZ("Webphone Auto-Answer").": $NWB#phones-webphone_auto_answer$NWE\n"; - echo ""._QXZ("Webphone Dialbox").": $NWB#phones-webphone_dialbox$NWE\n"; - echo ""._QXZ("Webphone Mute").": $NWB#phones-webphone_mute$NWE\n"; - echo ""._QXZ("Webphone Volume").": $NWB#phones-webphone_volume$NWE\n"; - echo ""._QXZ("Webphone Debug").": $NWB#phones-webphone_debug$NWE\n"; - echo ""._QXZ("Webphone Layout").": $NWB#phones-webphone_layout$NWE\n"; + echo ""._QXZ("Set As Webphone").": $NWB#phones-is_webphone$NWE\n"; + echo ""._QXZ("Webphone Dialpad").": $NWB#phones-webphone_dialpad$NWE\n"; + echo ""._QXZ("Webphone Auto-Answer").": $NWB#phones-webphone_auto_answer$NWE\n"; + echo ""._QXZ("Webphone Dialbox").": $NWB#phones-webphone_dialbox$NWE\n"; + echo ""._QXZ("Webphone Mute").": $NWB#phones-webphone_mute$NWE\n"; + echo ""._QXZ("Webphone Volume").": $NWB#phones-webphone_volume$NWE\n"; + echo ""._QXZ("Webphone Debug").": $NWB#phones-webphone_debug$NWE\n"; + echo ""._QXZ("Webphone Layout").": $NWB#phones-webphone_layout$NWE\n"; + + ##### get container listings for dynamic WEBPHONE_SETTINGS container pulldown menu + $stmt="SELECT container_id,container_notes from vicidial_settings_containers where container_type='WEBPHONE_SETTINGS' $LOGadmin_viewable_groupsSQL order by container_id;"; + $rslt=mysql_to_mysqli($stmt, $link); + $pws_to_print = mysqli_num_rows($rslt); + $webphone_settings_menu=''; + $pws_selected=0; + $o=0; + while ($pws_to_print > $o) + { + $rowx=mysqli_fetch_row($rslt); + if (mb_strlen($rowx[1],'utf-8')>40) + {$rowx[1] = mb_substr($rowx[1],0,40,'utf-8') . '...';} + $webphone_settings_menu .= "\n"; + $o++; + } + + echo ""; + if ($pws_selected > 0) + {echo ""._QXZ("Webphone Extra Settings")."";} + else + {echo _QXZ("Webphone Extra Settings");} + echo ": $NWB#phones-webphone_settings$NWE\n"; + echo ""._QXZ("Use External Server IP").": $NWB#phones-use_external_server_ip$NWE\n"; echo ""._QXZ("Status").": $NWB#phones-status$NWE\n"; echo ""._QXZ("Active Account").": $NWB#phones-active$NWE\n"; @@ -41295,6 +41327,7 @@ if ($ADD==392111111111) + $NWB#settings_containers-container_type$NWE\n"; @@ -41372,7 +41405,26 @@ if ($ADD==392111111111) } echo "
\n"; + } + if (preg_match("/WEBPHONE_SETTINGS/",$container_type)) + { + echo ""._QXZ("PHONES USING THIS SETTINGS CONTAINER").":
\n"; + echo "\n"; + + $stmt="SELECT extension,server_ip from phones where (webphone_settings='$container_id') $LOGadmin_viewable_groupsSQL order by server_ip,extension;"; + $rslt=mysql_to_mysqli($stmt, $link); + $p_to_print = mysqli_num_rows($rslt); + if ($DB > 0) {echo "$p_to_print|$stmt
\n";} + $o=0; + while ($p_to_print > $o) + { + $row=mysqli_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] - $row[1] $row[1]

\n"; } if ($LOGast_delete_phones > 0) diff --git a/agc_2-X/trunk/www/vicidial/help_documentation.txt b/agc_2-X/trunk/www/vicidial/help_documentation.txt index 1258a1fc..cc481a26 100644 --- a/agc_2-X/trunk/www/vicidial/help_documentation.txt +++ b/agc_2-X/trunk/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20221020163901 +# version: 20221021101501 users-user User ID This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-. users-pass Password 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. users-force_change_password Force Change Password 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. @@ -888,6 +888,7 @@ phones-webphone_mute Webphone Mute For the WebRTC phone, this setting will phones-webphone_volume Webphone Volume For the WebRTC phone, this setting will allow the volume buttons to be active. Default is Y. phones-webphone_debug Webphone Debug For the WebRTC phone, this setting will show debug output. Default is N. phones-webphone_layout Webphone Layout For the WebRTC phone, this setting will allow you to use an alternate layout. Default is blank. +phones-webphone_settings Webphone Extra Settings This option allows you to define additional webphone settings that will be passed from the agent screen to the webphone that is loaded for that agent. See the VICIPHONE_SETTINGS settings container for more information. phones-use_external_server_ip Use External Server IP If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the Server IP. Default is empty. phones-status Status The status of the phone in the system, ACTIVE and ADMIN allow for GUI clients to work. ADMIN allows access to this administrative web site. All other statuses do not allow GUI or Admin web access. phones-active Active Account Whether the phone is active to put it in the list in the GUI client.