diff --git a/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt b/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt index f0d7fc7f..182c6701 100644 --- a/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt +++ b/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt @@ -144,6 +144,7 @@ code country areacode state GMT DST DST_RANGE GEOGRAPHIC DESCRIPTION TZ_CODE PHP 1 USA 432 TX -6 Y SSM-FSN Texas CST America/Chicago 1 USA 434 VA -5 Y SSM-FSN Virginia EST America/New_York 1 USA 435 UT -7 Y SSM-FSN Utah MST America/Denver +1 USA 436 OH -5 Y SSM-FSN Ohio EST America/New_York 1 CAN 437 ON -5 Y SSM-FSN Ontario EST America/Toronto 1 CAN 438 QC -5 Y SSM-FSN Quebec EST America/Toronto 1 USA 440 OH -5 Y SSM-FSN Ohio EST America/New_York diff --git a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl index 10a1bfbd..65c059b7 100644 --- a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl +++ b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl @@ -161,9 +161,10 @@ # 230118-1623 - Added Playback audio then hangup extension # 230309-0926 - Added ara_url for server asterisk reboots, daily rolling of vicidial_abandon_check_queue table # 230331-2155 - Fix for issue #1458 +# 230412-1405 - Added daily rolling of vicidial_agent_notifications table, truncating of vicidial_agent_notifications_queue table # -$build = '230331-2155'; +$build = '230412-1405'; $DB=0; # Debug flag $teodDB=0; # flag to log Timeclock End of Day processes to log file @@ -1488,6 +1489,21 @@ if ($timeclock_end_of_day_NOW > 0) if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} $sthA->finish(); + $stmtA = "delete from vicidial_agent_notifications_queue where queue_date < \"$TDSQLdate\";"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows vicidial_agent_notifications_queue old records deleted|\n";} + if ($teodDB) {$event_string = "vicidial_agent_notifications_queue old records deleted($TDSQLdate): $affected_rows"; &teod_logger;} + + $stmtA = "optimize table vicidial_agent_notifications_queue;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); + # set past holidays to EXPIRED status $stmtA = "UPDATE vicidial_call_time_holidays SET holiday_status='EXPIRED' where holiday_date < \"$RMdate\" and holiday_status!='EXPIRED';"; if($DBX){print STDERR "\n|$stmtA|\n";} @@ -1707,6 +1723,33 @@ if ($timeclock_end_of_day_NOW > 0) } + # roll of vicidial_agent_notifications records, keep only 1 day of records in active table + if (!$Q) {print "\nProcessing vicidial_agent_notifications table...\n";} + $stmtA = "INSERT IGNORE INTO vicidial_agent_notifications_archive SELECT * from vicidial_agent_notifications;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows = $sthA->rows; + $event_string = "$sthArows rows inserted into vicidial_agent_notifications_archive table"; + if (!$Q) {print "$event_string \n";} + if ($teodDB) {&teod_logger;} + + $rv = $sthA->err(); + if (!$rv) + { + $stmtA = "DELETE FROM vicidial_agent_notifications WHERE notification_date < \"$RMSQLdate\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows = $sthA->rows; + $event_string = "$sthArows rows deleted from vicidial_agent_notifications table"; + if (!$Q) {print "$event_string \n";} + if ($teodDB) {&teod_logger;} + + $stmtA = "optimize table vicidial_agent_notifications;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + } + + # reset in-group closing_time_now_trigger trigger flag $stmtA = "UPDATE vicidial_inbound_groups SET closing_time_now_trigger='N' WHERE closing_time_now_trigger='Y';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; @@ -5023,6 +5066,36 @@ if ($active_asterisk_server =~ /Y/) +################################################################################ +##### BEGIN Clearing old/dead agent notifications +################################################################################ +# only run this on active voicemail server +if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_server)) eq (length($server_ip))) ) + { + $stmtA="UPDATE vicidial_agent_notifications set notification_status='DEAD' where notification_date <= NOW()-INTERVAL 1 MINUTE and notification_status='QUEUED';"; + $affected_rows = $dbhA->do($stmtA); + + $stmtC="UPDATE vicidial_agent_notifications set notification_status='DEAD' where notification_date <= NOW()-INTERVAL 1 HOUR and notification_status='READY';"; + $affected_rowsC = $dbhA->do($stmtC); + + $stmtB="DELETE FROM vicidial_agent_notifications_queue where queue_date <= NOW()-INTERVAL 1 MINUTE;"; + $affected_rowsB = $dbhA->do($stmtB); + + if ($DB) {print "Clearing old/dead agent notifications: $affected_rows $affected_rowsB $affected_rowsC \n";} + + if ( ($teodDB) && ( ($affected_rows > 0) || ($affected_rowsB > 0) || ($affected_rowsC > 0) ) ) + { + $event_string = "Clearing old/dead agent notifications: $affected_rows $affected_rowsB $affected_rowsC"; + &teod_logger; + } + } +################################################################################ +##### END Clearing old/dead agent notifications +################################################################################ + + + + ################################################################################ ##### START scheduled callbacks move old USERONLY triggered to ANYONE ################################################################################ diff --git a/agc_2-X/trunk/docs/AGENT_API.txt b/agc_2-X/trunk/docs/AGENT_API.txt index 87e07a45..47d897da 100644 --- a/agc_2-X/trunk/docs/AGENT_API.txt +++ b/agc_2-X/trunk/docs/AGENT_API.txt @@ -1,4 +1,4 @@ -AGENT API DOCUMENT Started: 2008-07-03 Updated: 2021-05-03 +AGENT API DOCUMENT Started: 2008-07-03 Updated: 2023-04-12 This document describes the functions of an API(Application Programming Interface) for the VICIDIAL Agent screen. This functionality will be rather limited at first @@ -39,6 +39,7 @@ switch_lead - for inbound calls, switches lead_id of live inbound call on agent calls_in_queue_count - display a count of the calls waiting in queue for the specific agent force_fronter_leave_3way - will send a command to fronter agent to leave-3way call that executing agent is on force_fronter_audio_stop - will send a command to fronter agent session to stop any audio_playback playing on it +send_notification - will send text alerts and/or confetti effects to agent interface vm_message - set a custom voicemail message to be played when agent clicks the VM button on the agent screen @@ -1032,6 +1033,57 @@ SUCCESS: force_fronter_audio_stop command sent over CCC - test_ccc +-------------------------------------------------------------------------------- +send_notification - + +DESCRIPTION: +can send a customizable message and customizable confetti effects to one or more active agent screens + +VALUES: + recipient_type - + REQUIRED, choices are below: + USER - send notification to a single user + USER_GROUP - send notification to all agents logged in under a particular user_group at the time the notification_date is reached + CAMPAIGN - send notification to all agents logged into a particular campaign at the time the notification_date is reached + ** If a recipient is passed but the recipient_type is missing or none of the above values, the recipient value will be used to look up a matching recipient_type. Order of priority is USER, then USER_GROUP, then CAMPAIGN + recipient - + REQUIRED, needs to be a value corresponding to the recipient_type, meaning if you send to a recipient_type USER, recipient must be that user's ID. For USER_GROUP, recipient must be a valid user_group from your dialer. + notification_date + OPTIONAL, date and time in yyyy-mm-dd HH:ii:ss format to send the notification. If the desired recipients are not logged in, the notification will remain active for 1 minute after the date/time is reached. Default is the current date and time. + notification_text + OPTIONAL, text to display in the agent alert box in the recipients agent interface. + text_size + OPTIONAL, used to customize the size of the notification text in points. Numeric only, default value is 12. + text_font + OPTIONAL, used to customize the font of the notification text. Default value is 'Arial'. + text_weight + OPTIONAL, used to customize the appearance of the notification text - currently supports 'bold', 'italic' and 'underline'. Value can be passed as a delimited string ("bold,underline") or even a long single string ("underlineitalicbold"). Default value is 'bold'. + text_color + OPTIONAL, used to customize the color of the notification text - can use either a color name ('red', 'aqua', 'yellow', 'green') or a three or six-character hexadecimal value ("FF0", "009900"). Default is 'black'. + show_confetti + OPTIONAL, a Y/N flag that determines if a confetti effect will appear on the agent interface. Default is 'N'. + duration + OPTIONAL, the length of time in seconds to show the confetti animation in the agent interface. Numeric only, default is collected from the settings container "CONFETTI_SETTINGS" - if that does not exist, the default is 2 seconds. Max value is 10 seconds. + maxParticleCount + OPTIONAL, the number of particles of confetti to show during the animation. Numeric only, default is collected from the settings container "CONFETTI_SETTINGS" - if that does not exist, the default is 2350 particles. Max value is 9999 particles. + particleSpeed + OPTIONAL, the speed at which the confetti floats through the screen. Numeric only, default is collected from the settings container "CONFETTI_SETTINGS" - if that does not exist, the default is 60. Max value is 100. + +EXAMPLE URLS: +http://server/agc/api.php?user=6666&pass=1234&function=send_notification&source=test&recipient=6666&recipient_type=USER&show_confetti=Y +http://server/agc/api.php?user=6666&pass=1234&function=send_notification&source=test&recipient=AGENTS&recipient_type=USER_GROUP&show_confetti=N¬ification_text=Ten+minutes+to+closing&text_size=36&text_color=9900FF&text_weight=bold,italic,underline +http://server/agc/api.php?user=6666&pass=1234&function=send_notification&source=test&recipient=TESTCAMP&recipient_type=CAMPAIGN&show_confetti=Y&duration=4&maxParticleCount=3000&particleSpeed=50¬ification_text=YOU+ARE+FIRED&text_weight=underline&text_size=48&text_color=red + +RESPONSES: +ERROR: Agent API Notifications are disabled on this system - 0 +ERROR: Missing recipient or recipient_type: (|) +ERROR: Invalid request, missing variables +SUCCESS: notification queued +** Additionally, there are "NOTICE" messages that will be included in the response if the notification date is improperly formatted/missing, or if the recipient_type is not included. + + + + -------------------------------------------------------------------------------- Other information: 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 e96abff4..e0126c41 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -1980,7 +1980,8 @@ allow_web_debug ENUM('0','1','2','3','4','5','6') default '0', max_logged_in_agents ENUM('0','1','2','3','4','5','6','7') default '0', user_codes_admin ENUM('0','1','2','3','4','5','6','7') default '0', login_kickall ENUM('0','1','2','3','4','5','6','7') default '0', -abandon_check_queue ENUM('0','1','2','3','4','5','6','7') default '0' +abandon_check_queue ENUM('0','1','2','3','4','5','6','7') default '0', +agent_notifications ENUM('0','1','2','3','4','5','6','7') default '0' ) ENGINE=MyISAM; CREATE TABLE vicidial_campaigns_list_mix ( @@ -4894,6 +4895,34 @@ index(phone_number), index(lead_id) ) ENGINE=MyISAM; +CREATE TABLE vicidial_agent_notifications ( +notification_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +entry_date DATETIME DEFAULT current_timestamp(), +recipient VARCHAR(20) DEFAULT NULL, +recipient_type ENUM('USER','USER_GROUP','CAMPAIGN') DEFAULT NULL, +notification_date DATETIME DEFAULT current_timestamp(), +notification_retry ENUM('Y','N') DEFAULT 'N', +notification_text TEXT DEFAULT NULL, +text_size TINYINT(3) UNSIGNED DEFAULT 12, +text_font VARCHAR(30) DEFAULT 'Arial', +text_weight VARCHAR(30) DEFAULT 'bold', +text_color VARCHAR(15) DEFAULT NULL, +show_confetti ENUM('Y','N') DEFAULT 'N', +confetti_options VARCHAR(15) DEFAULT NULL, +notification_status ENUM('QUEUED','READY','SENT','DEAD') DEFAULT NULL, +PRIMARY KEY (notification_id), +KEY recipient (recipient), +KEY notification_date (notification_date) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_agent_notifications_queue ( +queue_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +notification_id INT(10) UNSIGNED DEFAULT NULL, +queue_date DATETIME DEFAULT current_timestamp(), +user VARCHAR(20) DEFAULT NULL, +PRIMARY KEY (queue_id) +) ENGINE=MyISAM; + ALTER TABLE vicidial_email_list MODIFY message text character set utf8; @@ -5161,6 +5190,9 @@ CREATE UNIQUE INDEX caller_code_date on vicidial_dial_cid_log_archive (caller_co CREATE TABLE vicidial_abandon_check_queue_archive LIKE vicidial_abandon_check_queue; ALTER TABLE vicidial_abandon_check_queue_archive MODIFY abandon_check_id INT(9) UNSIGNED NOT NULL; +CREATE TABLE vicidial_agent_notifications_archive LIKE vicidial_agent_notifications; +ALTER TABLE vicidial_agent_notifications_archive MODIFY notification_id INT(10) UNSIGNED NOT NULL; + GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; @@ -5254,4 +5286,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='1678',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1679',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 281a32e4..e6f28cfa 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -2171,3 +2171,38 @@ CREATE TABLE vicidial_abandon_check_queue_archive LIKE vicidial_abandon_check_qu ALTER TABLE vicidial_abandon_check_queue_archive MODIFY abandon_check_id INT(9) UNSIGNED NOT NULL; UPDATE system_settings SET db_schema_version='1678',db_schema_update_date=NOW() where db_schema_version < 1678; + +ALTER TABLE system_settings ADD agent_notifications ENUM('0','1','2','3','4','5','6','7') default '0'; + +CREATE TABLE vicidial_agent_notifications ( +notification_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +entry_date DATETIME DEFAULT current_timestamp(), +recipient VARCHAR(20) DEFAULT NULL, +recipient_type ENUM('USER','USER_GROUP','CAMPAIGN') DEFAULT NULL, +notification_date DATETIME DEFAULT current_timestamp(), +notification_retry ENUM('Y','N') DEFAULT 'N', +notification_text TEXT DEFAULT NULL, +text_size TINYINT(3) UNSIGNED DEFAULT 12, +text_font VARCHAR(30) DEFAULT 'Arial', +text_weight VARCHAR(30) DEFAULT 'bold', +text_color VARCHAR(15) DEFAULT NULL, +show_confetti ENUM('Y','N') DEFAULT 'N', +confetti_options VARCHAR(15) DEFAULT NULL, +notification_status ENUM('QUEUED','READY','SENT','DEAD') DEFAULT NULL, +PRIMARY KEY (notification_id), +KEY recipient (recipient), +KEY notification_date (notification_date) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_agent_notifications_archive LIKE vicidial_agent_notifications; +ALTER TABLE vicidial_agent_notifications_archive MODIFY notification_id INT(10) UNSIGNED NOT NULL; + +CREATE TABLE vicidial_agent_notifications_queue ( +queue_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +notification_id INT(10) UNSIGNED DEFAULT NULL, +queue_date DATETIME DEFAULT current_timestamp(), +user VARCHAR(20) DEFAULT NULL, +PRIMARY KEY (queue_id) +) ENGINE=MyISAM; + +UPDATE system_settings SET db_schema_version='1679',db_schema_update_date=NOW() where db_schema_version < 1679; diff --git a/agc_2-X/trunk/www/agc/api.php b/agc_2-X/trunk/www/agc/api.php index 175c1d2c..e007117f 100644 --- a/agc_2-X/trunk/www/agc/api.php +++ b/agc_2-X/trunk/www/agc/api.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2023 Matt Florell LICENSE: AGPLv2 # # This script is designed as an API(Application Programming Interface) to allow # other programs to interact with the VICIDIAL Agent screen @@ -107,10 +107,11 @@ # 210616-2057 - Added optional CORS support, see options.php for details # 210819-0902 - Updated change_ingroups for changes in vicidial_live_inbound_agents insert/update # 220220-0847 - Added allow_web_debug system setting +# 230412-0945 - Added send_notification function # -$version = '2.14-72'; -$build = '220220-0847'; +$version = '2.14-73'; +$build = '230412-0945'; $php_script = 'api.php'; $startMS = microtime(); @@ -258,6 +259,32 @@ if (isset($_GET["cid_choice"])) {$cid_choice=$_GET["cid_choice"];} elseif (isset($_POST["cid_choice"])) {$cid_choice=$_POST["cid_choice"];} if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} +if (isset($_GET["duration"])) {$duration=$_GET["duration"];} + elseif (isset($_POST["duration"])) {$duration=$_POST["duration"];} +if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} + elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} +if (isset($_GET["recipient_type"])) {$recipient_type=$_GET["recipient_type"];} + elseif (isset($_POST["recipient_type"])) {$recipient_type=$_POST["recipient_type"];} +if (isset($_GET["show_confetti"])) {$show_confetti=$_GET["show_confetti"];} + elseif (isset($_POST["show_confetti"])) {$show_confetti=$_POST["show_confetti"];} +if (isset($_GET["maxParticleCount"])) {$maxParticleCount=$_GET["maxParticleCount"];} + elseif (isset($_POST["maxParticleCount"])) {$maxParticleCount=$_POST["maxParticleCount"];} +if (isset($_GET["particleSpeed"])) {$particleSpeed=$_GET["particleSpeed"];} + elseif (isset($_POST["particleSpeed"])) {$particleSpeed=$_POST["particleSpeed"];} +if (isset($_GET["notification_date"])) {$notification_date=$_GET["notification_date"];} + elseif (isset($_POST["notification_date"])) {$notification_date=$_POST["notification_date"];} +if (isset($_GET["notification_text"])) {$notification_text=$_GET["notification_text"];} + elseif (isset($_POST["notification_text"])) {$notification_text=$_POST["notification_text"];} +if (isset($_GET["notification_retry"])) {$notification_retry=$_GET["notification_retry"];} + elseif (isset($_POST["notification_retry"])) {$notification_retry=$_POST["notification_retry"];} +if (isset($_GET["text_size"])) {$text_size=$_GET["text_size"];} + elseif (isset($_POST["text_size"])) {$text_size=$_POST["text_size"];} +if (isset($_GET["text_font"])) {$text_font=$_GET["text_font"];} + elseif (isset($_POST["text_font"])) {$text_font=$_POST["text_font"];} +if (isset($_GET["text_weight"])) {$text_weight=$_GET["text_weight"];} + elseif (isset($_POST["text_weight"])) {$text_weight=$_POST["text_weight"];} +if (isset($_GET["text_color"])) {$text_color=$_GET["text_color"];} + elseif (isset($_POST["text_color"])) {$text_color=$_POST["text_color"];} $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); @@ -277,7 +304,7 @@ $pass = preg_replace("/'|\"|\\\\|;| /","",$pass); ############################################# ##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP ##### -$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging,outbound_cid_any,allow_web_debug FROM system_settings;"; +$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging,outbound_cid_any,allow_web_debug,agent_notifications FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} #if ($DB) {echo "$stmt\n";} @@ -291,6 +318,7 @@ if ($qm_conf_ct > 0) $SSagent_debug_logging = $row[3]; $SSoutbound_cid_any = $row[4]; $SSallow_web_debug = $row[5]; + $SSagent_notifications = $row[6]; } if ($SSallow_web_debug < 1) {$DB=0;} @@ -317,6 +345,7 @@ $stage = preg_replace("/\'|\"|\\\\|;/","",$stage); $close_window_link=preg_replace("/[^-_0-9a-zA-Z]/","",$close_window_link); $dnc_check=preg_replace("/[^-_0-9a-zA-Z]/","",$dnc_check); $campaign_dnc_check=preg_replace("/[^-_0-9a-zA-Z]/","",$campaign_dnc_check); +$notification_date = preg_replace('/[^- \:0-9]/','',$notification_date); if ($non_latin < 1) { @@ -397,6 +426,19 @@ if ($non_latin < 1) $dial_ingroup = preg_replace("/[^-\_0-9a-zA-Z]/","",$dial_ingroup); $cid_choice = preg_replace("/[^-\_0-9a-zA-Z]/","",$cid_choice); $outbound_cid = preg_replace("/[^-\_0-9a-zA-Z]/","",$outbound_cid); + $recipient = preg_replace("/[^-\_0-9a-zA-Z]/","",$recipient); + $recipient_type = preg_replace("/[^\_a-zA-Z]/","",$recipient_type); + $notification_text = preg_replace('/;|#/','',$notification_text); + $notification_text = preg_replace('/\+/',' ',$notification_text); + $notification_retry = preg_replace("/[^YN]/i", "", $notification_retry); + $text_size = preg_replace("/[^0-9]/","",$text_size); + $text_font = preg_replace("/[^\,\- a-zA-Z]/","",$text_font); + $text_weight = preg_replace("/[^\,a-zA-Z]/","",$text_weight); + $text_color = preg_replace("/[^0-9a-zA-Z]/","",$text_color); + $show_confetti = preg_replace("/[^YN]/i", "", $show_confetti); + $duration = preg_replace("/[^0-9]/","",$duration); + $maxParticleCount = preg_replace("/[^0-9]/","",$maxParticleCount); + $particleSpeed = preg_replace("/[^0-9]/","",$particleSpeed); } else { @@ -477,6 +519,19 @@ else $dial_ingroup = preg_replace("/[^-\_0-9\p{L}]/u","",$dial_ingroup); $cid_choice = preg_replace("/[^-\_0-9\p{L}]/u","",$cid_choice); $outbound_cid = preg_replace("/[^-\_0-9\p{L}]/u","",$outbound_cid); + $recipient = preg_replace("/[^-\_0-9\p{L}]/u","",$recipient); + $recipient_type = preg_replace("/[^\_\p{L}]/u","",$recipient_type); + $notification_text = preg_replace('/;|#/','',$notification_text); + $notification_text = preg_replace('/\+/',' ',$notification_text); + $notification_retry = preg_replace("/[^YN]/i", "", $notification_retry); + $text_size = preg_replace("/[^0-9]/","",$text_size); + $text_font = preg_replace("/[^\,\- \p{L}]/u","",$text_font); + $text_weight = preg_replace("/[^\,\p{L}]/u","",$text_weight); + $text_color = preg_replace("/[^0-9\p{L}]/u","",$text_color); + $show_confetti = preg_replace("/[^YN]/i", "", $show_confetti); + $duration = preg_replace("/[^0-9]/","",$duration); + $maxParticleCount = preg_replace("/[^0-9]/","",$maxParticleCount); + $particleSpeed = preg_replace("/[^0-9]/","",$particleSpeed); } ### date and fixed variables @@ -5007,7 +5062,168 @@ if ($function == 'force_fronter_audio_stop') ################################################################################ +################################################################################ +### BEGIN - send_notification - will send text alerts and/or confetti effects to agent interface +################################################################################ +if ($function == 'send_notification') + { + if ($SSagent_notifications < 1) + { + $result = _QXZ("ERROR"); + $result_reason = _QXZ("Agent API Notifications are disabled on this system"); + echo "$result: $result_reason - $SSagent_notifications\n"; + api_log($link,$api_logging,$api_script,$user,$recipient,$function,$recipient_type,$result,$result_reason,$source,$data); + } + else + { + if ( (!preg_match("/ $function /",$VUapi_allowed_functions)) and (!preg_match("/ALL_FUNCTIONS/",$VUapi_allowed_functions)) ) + { + $result = _QXZ("ERROR"); + $result_reason = _QXZ("auth USER DOES NOT HAVE PERMISSION TO USE THIS FUNCTION"); + echo "$result: $result_reason - $value|$user|$function|$VUuser_group\n"; + api_log($link,$api_logging,$api_script,$user,$recipient,$function,$recipient_type,$result,$result_reason,$source,$data); + exit; + } + $valid_request=0; + $valid_recipients=array("USER", "USER_GROUP", "CAMPAIGN"); + + # &user=6666&pass=1234&source=test&function=send_notification&recipient=6666&recipient_type=USER&show_confetti=1 + if ($recipient && !in_array($recipient_type, $valid_recipients)) + { + $old_recipient_type=$recipient_type; + $recipient_type=""; + $rt_stmt="select 'USER', 1 as priority from vicidial_users where user='$recipient' UNION select 'USER_GROUP', 2 from vicidial_user_groups where user_group='$recipient' UNION select 'CAMPAIGN', 3 as priority from vicidial_campaigns where campaign_id='$recipient' order by priority limit 1"; + $rt_rslt=mysql_to_mysqli($rt_stmt, $link); + echo "Invalid recipient_type ($old_recipient_type), "; + if (mysqli_num_rows($rt_rslt)>0) + { + $rt_row=mysqli_fetch_row($rt_rslt); + $recipient_type=$rt_row[0]; + echo "NOTICE: found $recipient as $recipient_type
\n"; + } + else + { + $result = _QXZ("ERROR"); + $result_reason = _QXZ("no matching recipient found in users, user_groups, or campaigns"); + echo "$result: $result_reason - $recipient\n"; + api_log($link,$api_logging,$api_script,$user,$recipient,$function,$recipient_type,$result,$result_reason,$source,$data); + exit; + } + if ($DBX) {echo "$rt_stmt";} + } + + if ($recipient && $recipient_type) + { + if(!$notification_date) {$notification_date=date("Y-m-d H:i:s");} + if (preg_match('/Y/i', $notification_retry)) + { + $notification_retry="Y"; + } + else + { + $notification_retry="N"; + } + if (!$text_size) {$text_size="12";} + if (!$text_font) {$text_font="Arial";} + if (!$text_weight) {$text_weight="bold";} + if (!$text_color) {$text_color="black";} + + if (preg_match('/^[0-9A-F]{3,6}$/', $text_color)) {$text_color="#".$text_color;} + + if(!preg_match('/[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\s?[0-9]{1,2}\:[0-9]{1,2}(\:[0-9]{1,2})?/', $notification_date)) + { + echo "NOTICE: Invalid notification date $notification_date, changing to now"; + $notification_date=date("Y-m-d H:i:s"); + } + + $notification_status='QUEUED'; + $SQL_columns="recipient, recipient_type, notification_date, notification_retry, notification_status, "; + $SQL_values="'$recipient', '$recipient_type', '$notification_date', '$notification_retry', '$notification_status', "; + + if(strlen($notification_text)>0) + { + $SQL_columns.="notification_text, text_size, text_font, text_weight, text_color, "; + $SQL_values.="'$notification_text', '$text_size', '$text_font', '$text_weight', '$text_color', "; + $valid_request=1; + } + + ## Confetti + if ($show_confetti=="Y") + { + # Check if any of the three confetti settings was NOT passed, meaning the container should be checked. + if (!$duration || !$maxParticleCount || !$particleSpeed) + { + $confetti_stmt="select * from vicidial_settings_containers where container_id='CONFETTI_SETTINGS'"; + if ($DBX) {echo $confetti_stmt."
\n";} + $confetti_rslt=mysql_to_mysqli($confetti_stmt, $link); + + if (mysqli_num_rows($confetti_rslt)>0) + { + $confetti_row=mysqli_fetch_array($confetti_rslt); + $container_entry=explode("\n", $confetti_row['container_entry']); + + for ($q=0; $q\s/', $container_entry[$q])) + { + $container_setting=explode(" => ", trim($container_entry[$q])); + $setting_name=$container_setting[0]; + $setting_value=$container_setting[1]; + if ($setting_name=="duration" || $setting_name=="maxParticleCount" || $setting_name=="particleSpeed") + { + if (!$$setting_name) {$$setting_name=$setting_value;} + } + } + } + } + } + + # Set any remaining missing confetti settings that aren't already set + if (!$duration) {$duration="2";} # seconds + if (!$maxParticleCount) {$maxParticleCount="2350";} + if (!$particleSpeed) {$particleSpeed="2";} + + $SQL_columns.="show_confetti, confetti_options, "; + $SQL_values.="'$show_confetti', '$duration,$maxParticleCount,$particleSpeed', "; + + $valid_request=1; + } + + if ($valid_request) + { + $SQL_columns=preg_replace('/, $/', "", $SQL_columns); + $SQL_values=preg_replace('/, $/', "", $SQL_values); + $ins_stmt="INSERT INTO vicidial_agent_notifications($SQL_columns) VALUES($SQL_values)"; + if ($DB) {echo $ins_stmt."
\n";} + $ins_rslt=mysql_to_mysqli($ins_stmt, $link); + $notification_id = mysqli_insert_id($link); + + $result = _QXZ("SUCCESS"); + $result_reason = _QXZ("notification queued"); + echo "$result: $result_reason - $recipient|$recipient_type|$notification_id\n"; + api_log($link,$api_logging,$api_script,$user,$recipient,$function,$recipient_type,$result,$result_reason,$source,$data); + } + else + { + $result = _QXZ("ERROR"); + $result_reason = _QXZ("invalid request"); + echo "$result: $result_reason - $recipient|$recipient_type\n"; + api_log($link,$api_logging,$api_script,$user,$recipient,$function,$recipient_type,$result,$result_reason,$source,$data); + } + } + else + { + $result = _QXZ("ERROR"); + $result_reason = _QXZ("Missing recipient or recipient_type"); + echo "$result: $result_reason - $recipient|$recipient_type\n"; + api_log($link,$api_logging,$api_script,$user,$recipient,$function,$recipient_type,$result,$result_reason,$source,$data); + } + } + } +################################################################################ +### END - send_notification +################################################################################ ################################################################################ diff --git a/agc_2-X/trunk/www/agc/conf_exten_check.php b/agc_2-X/trunk/www/agc/conf_exten_check.php index 6454e327..50c2d8f8 100644 --- a/agc_2-X/trunk/www/agc/conf_exten_check.php +++ b/agc_2-X/trunk/www/agc/conf_exten_check.php @@ -93,10 +93,11 @@ # 220219-2328 - Added allow_web_debug system setting # 220310-0934 - Added more time-sync detailed logging # 230220-1759 - Fix for In-Group manual dial issue +# 230412-1020 - Added code for send_notification API function # -$version = '2.14-67'; -$build = '230220-1759'; +$version = '2.14-68'; +$build = '230412-1020'; $php_script = 'conf_exten_check.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=51; @@ -184,7 +185,7 @@ $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); ############################################# ##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP ##### -$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging,allow_web_debug FROM system_settings;"; +$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging,allow_web_debug,agent_notifications FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$user,$server_ip,$session_name,$one_mysql_log);} #if ($DB) {echo "$stmt\n";} @@ -197,6 +198,7 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSagent_debug_logging = $row[3]; $SSallow_web_debug = $row[4]; + $SSagent_notifications = $row[5]; } if ($SSallow_web_debug < 1) {$DB=0; $format='text';} @@ -1374,6 +1376,52 @@ if ($ACTION == 'refresh') } } + if ($SSagent_notifications > 0) + { + // Check for alerts + // Activate notifications that are ready to be sent systemwide + $upd_stmt="update vicidial_agent_notifications set notification_status='READY' where notification_date<=now() and notification_status='QUEUED'"; + $upd_rslt=mysql_to_mysqli($upd_stmt, $link); + + # gather all READY notifications to be triggered, limit with $user, $VU_user_group, $campaign + $alert_stmt="select * from vicidial_agent_notifications where notification_status='READY' and ( (recipient_type='USER' and recipient='$user') or (recipient_type='USER_GROUP' and recipient='$VU_user_group') or (recipient_type='CAMPAIGN' and recipient='$campaign') ) order by notification_date asc limit 1"; + $alert_rslt=mysql_to_mysqli($alert_stmt, $link); + while ($alert_row=mysqli_fetch_array($alert_rslt)) + { + $notification_id=$alert_row["notification_id"]; + $recipient=$alert_row["recipient"]; + $recipient_type=$alert_row["recipient_type"]; + + $upd_stmt="update vicidial_agent_notifications set notification_status='SENT' where notification_id='$notification_id'"; + $upd_rslt=mysql_to_mysqli($upd_stmt, $link); + if (mysqli_affected_rows($link)>0) + { + if ($recipient_type=="CAMPAIGN") {$column="campaign_id"; $recipient_str="$recipient";} + else if ($recipient_type=="USER_GROUP") + { + $column="user"; + $ug_stmt="select user from vicidial_users where user_group='$recipient'"; + $ug_rslt=mysql_to_mysqli($ug_stmt, $link); + $recipient_str=""; + while ($ug_row=mysqli_fetch_row($ug_rslt)) + { + $recipient_str.="$ug_row[0]', '"; + } + } + else {$column="user"; $recipient_str="$recipient";} + + $agent_stmt="select user from vicidial_live_agents where $column in ('$recipient_str')"; + $agent_rslt=mysql_to_mysqli($agent_stmt, $link); + while($agent_row=mysqli_fetch_row($agent_rslt)) + { + $ins_stmt="INSERT INTO vicidial_agent_notifications_queue(notification_id, user) VALUES('$notification_id', '$agent_row[0]')"; + $ins_rslt=mysql_to_mysqli($ins_stmt, $link); + } + } + } + } + + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . '|DEADcall: ' . $DEADcustomer . '|InGroupChange: ' . $InGroupChangeDetails . '|APIFields: ' . $external_update_fields . '|APIFieldsData: ' . $external_update_fields_data . '|APITimerAction: ' . $timer_action . '|APITimerMessage: ' . $timer_action_message . '|APITimerSeconds: ' . $timer_action_seconds . '|APIdtmf: ' . $external_dtmf . '|APItransferconf: ' . $external_transferconf . '|APIpark: ' . $external_park . '|APITimerDestination: ' . $timer_action_destination . '|APIManualDialQueue: ' . $MDQ_count . '|APIRecording: ' . $external_recording . '|APIPaUseCodE: ' . $external_pause_code . '|WaitinGChats: ' . $WaitinGChats . '|WaitinGEmails: ' . $WaitinGEmails . '|LivEAgentCommentS: ' . $live_agents_comments . '|LeadIDSwitch: ' . $external_lead_id .'|DEADxfer: '.$DEADxfer .'|CHANanswer: '.$CHANanswer .'|Alogin_notes: '.$Alogin_notes. "\n"; @@ -1431,6 +1479,33 @@ if ($ACTION == 'refresh') echo "$countecho\n"; $stage = "$Astatus|$Aagent_log_id$DEADlog"; + + } + +################################################################################ +### AlertDisplay - send alerts to agents +################################################################################ +if ($ACTION == 'AlertDisplay') + { + $alert_check_stmt="select * from vicidial_agent_notifications_queue where user='$user' order by queue_date asc limit 1"; + $alert_check_rslt=mysql_to_mysqli($alert_check_stmt, $link); + if (mysqli_num_rows($alert_check_rslt)>0) + { + $acr_rows=mysqli_num_rows($alert_check_rslt); + $acr_row=mysqli_fetch_array($alert_check_rslt); + $notification_id=$acr_row["notification_id"]; + $queue_id=$acr_row["queue_id"]; + + $notification_stmt="select * from vicidial_agent_notifications where notification_id='$notification_id' limit 1"; + $notification_rslt=mysql_to_mysqli($notification_stmt, $link); + while($notif_row=mysqli_fetch_array($notification_rslt)) + { + echo "$acr_rows|$notif_row[notification_text]|$notif_row[text_size]|$notif_row[text_font]|$notif_row[text_color]|$notif_row[text_weight]|$notif_row[show_confetti]|$notif_row[confetti_options]"; + } + + $del_stmt="delete from vicidial_agent_notifications_queue where queue_id='$queue_id'"; + $del_rslt=mysql_to_mysqli($del_stmt, $link); + } } diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 4bf8a82a..b44fddc9 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -715,10 +715,11 @@ # 230306-1335 - Added 20Hz_tone browser sound, Issue #1448 # 230306-2034 - Added setTimeoutAudioLoop agent_screen_timer option, Issue #1448 # 230407-1839 - Fix for input variable filter issue +# 230412-1018 - Added code for send_notification API function # -$version = '2.14-683c'; -$build = '230407-1839'; +$version = '2.14-684c'; +$build = '230412-1018'; $php_script = 'vicidial.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=98; @@ -818,7 +819,7 @@ $random = (rand(1000000, 9999999) + 10000000); ############################################# ##### START SYSTEM_SETTINGS AND USER LANGUAGE 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,agent_screen_timer,agent_hide_hangup,allow_web_debug,max_logged_in_agents,login_kickall 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,agent_hide_hangup,allow_web_debug,max_logged_in_agents,login_kickall,agent_notifications 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";} @@ -880,6 +881,7 @@ if ($qm_conf_ct > 0) $SSallow_web_debug = $row[51]; $SSmax_logged_in_agents = $row[52]; $SSlogin_kickall = $row[53]; + $SSagent_notifications = $row[54]; if ( ($SSagent_hidden_sound == '---NONE---') or ($SSagent_hidden_sound == '') ) {$SSagent_hidden_sound_seconds=0;} } else @@ -5969,6 +5971,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var agent_hangup_value=''; var agent_hangup_ig_override=''; var show_confetti=''; + var agent_notifications=''; var DiaLControl_auto_HTML = "\" border=\"0\" alt=\"You are paused\" />"; var DiaLControl_auto_HTML_ready = "\" border=\"0\" alt=\"You are active\" />"; var DiaLControl_auto_HTML_OFF = "\" border=\"0\" alt=\"pause button disabled\" />"; @@ -8908,6 +8911,87 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } + function AlerTDisplaY() + { + // Store defaults from settings container + var default_confettiDuration = confettiDuration; + var default_maxParticleCount = maxParticleCount; + var default_particleSpeed = particleSpeed; + + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + AlerT_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&user_group=" + VU_user_group + "&campaign=" + campaign + "&ACTION=AlertDisplay"; + // alert(AlerT_query); + xmlhttp.open('POST', 'conf_exten_check.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(AlerT_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + + var AlerTrslt = xmlhttp.responseText; + if (AlerTrslt.length>0) + { + // alert(AlerTrslt); + } + + var AlerT_array=AlerTrslt.split("|"); + var AlerT = AlerT_array[0]; + + if (AlerT>0) + { + var AlerT_text = AlerT_array[1]; + var AlerT_size = AlerT_array[2]; + var AlerT_font = AlerT_array[3]; + var AlerT_color = AlerT_array[4]; + var AlerT_weight = AlerT_array[5]; + var show_confetti = AlerT_array[6]; + var confetti_options = AlerT_array[7]; + + if (AlerT_text.length>0) + { + alert_box(AlerT_text, AlerT_size, AlerT_font, AlerT_color, AlerT_weight); + } + + if (show_confetti=="Y") + { + confetti_options_array=confetti_options.split(","); + confettiDuration=confetti_options_array[0]; + maxParticleCount=confetti_options_array[1]; + particleSpeed=confetti_options_array[2]; + + startConfetti(); + setTimeout(() => {stopConfetti(); confettiDuration=default_confettiDuration; maxParticleCount=default_maxParticleCount; particleSpeed=default_particleSpeed;}, confettiDuration*1000) + } + } + + } + } + delete xmlhttp; + } + } + + // ################################################################################ // Request number of USERONLY callbacks for this agent function CalLBacKsCounTCheck() @@ -9196,7 +9280,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // ################################################################################ // closes callback list screen - function alert_box(temp_message) + function alert_box(temp_message, message_size, message_font, message_color, message_weight) { var ABtop='200px'; var ABleft='200px'; @@ -9212,6 +9296,30 @@ function set_length(SLnumber,SLlength_goal,SLdirection) document.getElementById("AlertBox").style.top = ABtop; document.getElementById("AlertBox").style.left = ABleft; + if (message_size && message_font && message_color && message_weight) + { + var tag_BEGIN=""; + var tag_END=""; + + if (message_weight.match(/bold/)) + { + tag_BEGIN+=""; + tag_END=""+tag_END; + } + if (message_weight.match(/italic/)) + { + tag_BEGIN+=""; + tag_END=""+tag_END; + } + if (message_weight.match(/underline/)) + { + tag_BEGIN+=""; + tag_END=""+tag_END; + } + + temp_message="

"+tag_BEGIN+temp_message+tag_END+"

"; + } + document.getElementById("AlertBoxContent").innerHTML = temp_message; showDiv('AlertBox'); @@ -20402,6 +20510,7 @@ function phone_number_format(formatphone) { else { var WaitingForNextStep=0; + if (agent_notifications > 0) {AlerTDisplaY();} if ( (CloserSelecting==1) || (TerritorySelecting==1) ) {WaitingForNextStep=1;} if (open_dispo_screen==1) { @@ -21890,7 +21999,7 @@ function phone_number_format(formatphone) { $zi=2; ?> - +
diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 30ce2933..6694adc3 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -131,7 +131,7 @@ $UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summa $Vtables = 'NONE,log_noanswer,did_agent_log,contact_information'; -$APIfunctions = 'ALL_FUNCTIONS add_group_alias add_lead add_list add_phone add_phone_alias add_user agent_ingroup_info agent_stats_export agent_status audio_playback blind_monitor call_agent callid_info change_ingroups check_phone_number copy_user did_log_export external_add_lead external_dial external_hangup external_pause external_status in_group_status logout moh_list ingroup_list callmenu_list park_call pause_code preview_dial_action ra_call_control recording recording_lookup send_dtmf server_refresh set_timer_action sounds_list st_get_agent_active_lead st_login_log transfer_conference update_fields update_lead batch_update_lead update_list list_info list_custom_fields update_log_entry update_phone update_phone_alias update_user user_group_status vm_list webphone_url webserver logged_in_agents update_campaign update_alt_url update_presets add_did update_did lead_field_info lead_all_info phone_number_log switch_lead ccc_lead_info lead_status_search lead_search call_status_stats calls_in_queue_count force_fronter_leave_3way force_fronter_audio_stop update_cid_group_entry add_dnc_phone add_fpg_phone'; +$APIfunctions = 'ALL_FUNCTIONS add_group_alias add_lead add_list add_phone add_phone_alias add_user agent_ingroup_info agent_stats_export agent_status audio_playback blind_monitor call_agent callid_info change_ingroups check_phone_number copy_user did_log_export external_add_lead external_dial external_hangup external_pause external_status in_group_status logout moh_list ingroup_list callmenu_list park_call pause_code preview_dial_action ra_call_control recording recording_lookup send_dtmf server_refresh set_timer_action sounds_list st_get_agent_active_lead st_login_log transfer_conference update_fields update_lead batch_update_lead update_list list_info list_custom_fields update_log_entry update_phone update_phone_alias update_user user_group_status vm_list webphone_url webserver logged_in_agents update_campaign update_alt_url update_presets add_did update_did lead_field_info lead_all_info phone_number_log switch_lead ccc_lead_info lead_status_search lead_search call_status_stats calls_in_queue_count force_fronter_leave_3way force_fronter_audio_stop update_cid_group_entry add_dnc_phone add_fpg_phone send_notification'; $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,20Hz_tone'; @@ -2748,6 +2748,8 @@ if (isset($_GET["show_confetti"])) {$show_confetti=$_GET["show_confetti"];} elseif (isset($_POST["show_confetti"])) {$show_confetti=$_POST["show_confetti"];} if (isset($_GET["webphone_settings"])) {$webphone_settings=$_GET["webphone_settings"];} elseif (isset($_POST["webphone_settings"])) {$webphone_settings=$_POST["webphone_settings"];} +if (isset($_GET["agent_notifications"])) {$agent_notifications=$_GET["agent_notifications"];} + elseif (isset($_POST["agent_notifications"])) {$agent_notifications=$_POST["agent_notifications"];} $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); @@ -2763,7 +2765,7 @@ if (strlen($dial_status) > 0) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,allow_emails,level_8_disable_add,pass_key,pass_hash_enabled,disable_auto_dial,country_code_list_stats,frozen_server_call_clear,active_modules,allow_chats,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,default_language,user_hide_realtime_enabled,log_recording_access,alt_ivr_logging,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,agent_soundboards,web_loader_phone_length,agent_script,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist,hide_inactive_lists,allow_manage_active_lists,expired_lists_inactive,did_system_filter,enable_gdpr_download_deletion,mute_recordings,user_admin_redirect,list_status_modification_confirmation,sip_event_logging,call_quota_lead_ranking,enable_second_script,enable_first_webform,recording_buttons,opensips_cid_name,require_password_length,user_account_emails,outbound_cid_any,entries_per_page,browser_call_alerts,inbound_answer_config,enable_international_dncs,daily_call_count_limit,allow_shared_dial,agent_search_method,admin_home_url,qc_claim_limit,qc_expire_days,two_factor_auth_hours,two_factor_container,call_limit_24hour,allowed_sip_stacks,agent_hide_hangup,allow_web_debug,max_logged_in_agents,user_codes_admin,abandon_check_queue FROM system_settings;"; +$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,allow_emails,level_8_disable_add,pass_key,pass_hash_enabled,disable_auto_dial,country_code_list_stats,frozen_server_call_clear,active_modules,allow_chats,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,default_language,user_hide_realtime_enabled,log_recording_access,alt_ivr_logging,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,agent_soundboards,web_loader_phone_length,agent_script,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist,hide_inactive_lists,allow_manage_active_lists,expired_lists_inactive,did_system_filter,enable_gdpr_download_deletion,mute_recordings,user_admin_redirect,list_status_modification_confirmation,sip_event_logging,call_quota_lead_ranking,enable_second_script,enable_first_webform,recording_buttons,opensips_cid_name,require_password_length,user_account_emails,outbound_cid_any,entries_per_page,browser_call_alerts,inbound_answer_config,enable_international_dncs,daily_call_count_limit,allow_shared_dial,agent_search_method,admin_home_url,qc_claim_limit,qc_expire_days,two_factor_auth_hours,two_factor_container,call_limit_24hour,allowed_sip_stacks,agent_hide_hangup,allow_web_debug,max_logged_in_agents,user_codes_admin,abandon_check_queue,agent_notifications FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); #if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); @@ -2876,6 +2878,7 @@ if ($qm_conf_ct > 0) $SSmax_logged_in_agents = $row[103]; $SSuser_codes_admin = $row[104]; $SSabandon_check_queue = $row[105]; + $SSagent_notifications = $row[106]; } if ($SSallow_web_debug < 1) {$DB=0;} ##### END SETTINGS LOOKUP ##### @@ -3252,6 +3255,7 @@ $log_recording_access = preg_replace('/[^0-9]/','',$log_recording_access); $dial_level_override = preg_replace('/[^0-9]/','',$dial_level_override); $conf_update_interval = preg_replace('/[^0-9]/','',$conf_update_interval); $login_kickall = preg_replace('/[^0-9]/','',$login_kickall); +$agent_notifications = preg_replace('/[^0-9]/','',$agent_notifications); $user_new_lead_limit = preg_replace('/[^-0-9]/','',$user_new_lead_limit); $drop_call_seconds = preg_replace('/[^-0-9]/','',$drop_call_seconds); @@ -5990,12 +5994,13 @@ if ($SSscript_remove_js > 0) # 230311-0859 - Added abandon_check_queue system setting, ara_url server option and show_confetti campaign feature # 230312-2212 - Fix for webphone_settings issue #1451 # 230407-1038 - Added VERM report links to main admin Reports page +# 230412-0946 - Added send_notification Agent-API function, agent_notifications system_setting # # 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-879a'; -$build = '230407-1038'; +$admin_version = '2.14-880a'; +$build = '230412-0946'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -20880,7 +20885,7 @@ if ($ADD==411111111111111) } } - $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='" . mysqli_real_escape_string($link, $queuemetrics_url) . "',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='" . mysqli_real_escape_string($link, $admin_home_url) . "',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='" . mysqli_real_escape_string($link, $vtiger_url) . "',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysqli_real_escape_string($link, $webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',label_lead_id='$label_lead_id',label_list_id='$label_list_id',label_entry_date='$label_entry_date',label_gmt_offset_now='$label_gmt_offset_now',label_source_id='$label_source_id',label_called_since_last_reset='$label_called_since_last_reset',label_status='$label_status',label_user='$label_user',label_date_of_birth='$label_date_of_birth',label_country_code='$label_country_code',label_last_local_call_time='$label_last_local_call_time',label_called_count='$label_called_count',label_rank='$label_rank',label_owner='$label_owner',label_entry_list_id='$label_entry_list_id',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db'$custom_reports_slave_SQL,webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add',queuemetrics_record_hold='$queuemetrics_record_hold',country_code_list_stats='$country_code_list_stats',queuemetrics_pause_type='$queuemetrics_pause_type',frozen_server_call_clear='$frozen_server_call_clear',callback_time_24hour='$callback_time_24hour',enable_languages='$enable_languages',language_method='$language_method',meetme_enter_login_filename='$meetme_enter_login_filename',meetme_enter_leave3way_filename='$meetme_enter_leave3way_filename',enable_did_entry_list_id='$enable_did_entry_list_id',enable_third_webform='$enable_third_webform',allow_chats='$allow_chats',chat_url='" . mysqli_real_escape_string($link, $chat_url) . "',chat_timeout='$chat_timeout',agent_debug_logging='$agent_debug_logging',default_language='$default_language',agent_whisper_enabled='$agent_whisper_enabled',user_hide_realtime_enabled='$user_hide_realtime_enabled',usacan_phone_dialcode_fix='$usacan_phone_dialcode_fix',cache_carrier_stats_realtime='$cache_carrier_stats_realtime',log_recording_access='$log_recording_access',report_default_format='$report_default_format',alt_ivr_logging='$alt_ivr_logging',default_phone_code='$default_phone_code',admin_row_click='$admin_row_click',admin_screen_colors='$admin_screen_colors',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',agent_screen_colors='$agent_screen_colors',script_remove_js='$script_remove_js',manual_auto_next='$manual_auto_next',user_new_lead_limit='$user_new_lead_limit',agent_xfer_park_3way='$agent_xfer_park_3way',agent_soundboards='$agent_soundboards',web_loader_phone_length='$web_loader_phone_length',agent_script='$agent_script',agent_chat_screen_colors='$agent_chat_screen_colors',enable_auto_reports='$enable_auto_reports',enable_pause_code_limits='$enable_pause_code_limits',enable_drop_lists='$enable_drop_lists',allow_ip_lists='$allow_ip_lists',system_ip_blacklist='$system_ip_blacklist',agent_push_events='$agent_push_events',agent_push_url='$agent_push_url',hide_inactive_lists='$hide_inactive_lists',allow_manage_active_lists='$allow_manage_active_lists',expired_lists_inactive='$expired_lists_inactive',did_system_filter='$did_system_filter',anyone_callback_inactive_lists='$anyone_callback_inactive_lists',enable_gdpr_download_deletion='$enable_gdpr_download_deletion',source_id_display='$source_id_display',agent_logout_link='$agent_logout_link',manual_dial_validation='$manual_dial_validation',mute_recordings='$mute_recordings',user_admin_redirect='$user_admin_redirect',list_status_modification_confirmation='$list_status_modification_confirmation',sip_event_logging='$sip_event_logging',call_quota_lead_ranking='$call_quota_lead_ranking',enable_second_script='$enable_second_script',enable_first_webform='$enable_first_webform',recording_buttons='$recording_buttons',opensips_cid_name='$opensips_cid_name',require_password_length='$require_password_length',user_account_emails='$user_account_emails',outbound_cid_any='$outbound_cid_any',entries_per_page='$entries_per_page',browser_call_alerts='$browser_call_alerts',queuemetrics_pausereason='$queuemetrics_pausereason',inbound_answer_config='$inbound_answer_config',enable_international_dncs='$enable_international_dncs',web_loader_phone_strip='$web_loader_phone_strip',manual_dial_phone_strip='$manual_dial_phone_strip',daily_call_count_limit='$daily_call_count_limit',allow_shared_dial='$allow_shared_dial',agent_search_method='$agent_search_method',phone_defaults_container='$phone_defaults_container',qc_claim_limit='$qc_claim_limit',qc_expire_days='$qc_expire_days',two_factor_auth_hours='$two_factor_auth_hours',two_factor_container='$two_factor_container',agent_hidden_sound='$agent_hidden_sound',agent_hidden_sound_volume='$agent_hidden_sound_volume',agent_hidden_sound_seconds='$agent_hidden_sound_seconds',agent_screen_timer='$agent_screen_timer',call_limit_24hour='$call_limit_24hour',allowed_sip_stacks='$allowed_sip_stacks',agent_hide_hangup='$agent_hide_hangup',allow_web_debug='$allow_web_debug',max_logged_in_agents='$max_logged_in_agents',user_codes_admin='$user_codes_admin',login_kickall='$login_kickall',abandon_check_queue='$abandon_check_queue'$custom_dialplanSQL;"; + $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='" . mysqli_real_escape_string($link, $queuemetrics_url) . "',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='" . mysqli_real_escape_string($link, $admin_home_url) . "',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='" . mysqli_real_escape_string($link, $vtiger_url) . "',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysqli_real_escape_string($link, $webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',label_lead_id='$label_lead_id',label_list_id='$label_list_id',label_entry_date='$label_entry_date',label_gmt_offset_now='$label_gmt_offset_now',label_source_id='$label_source_id',label_called_since_last_reset='$label_called_since_last_reset',label_status='$label_status',label_user='$label_user',label_date_of_birth='$label_date_of_birth',label_country_code='$label_country_code',label_last_local_call_time='$label_last_local_call_time',label_called_count='$label_called_count',label_rank='$label_rank',label_owner='$label_owner',label_entry_list_id='$label_entry_list_id',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db'$custom_reports_slave_SQL,webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add',queuemetrics_record_hold='$queuemetrics_record_hold',country_code_list_stats='$country_code_list_stats',queuemetrics_pause_type='$queuemetrics_pause_type',frozen_server_call_clear='$frozen_server_call_clear',callback_time_24hour='$callback_time_24hour',enable_languages='$enable_languages',language_method='$language_method',meetme_enter_login_filename='$meetme_enter_login_filename',meetme_enter_leave3way_filename='$meetme_enter_leave3way_filename',enable_did_entry_list_id='$enable_did_entry_list_id',enable_third_webform='$enable_third_webform',allow_chats='$allow_chats',chat_url='" . mysqli_real_escape_string($link, $chat_url) . "',chat_timeout='$chat_timeout',agent_debug_logging='$agent_debug_logging',default_language='$default_language',agent_whisper_enabled='$agent_whisper_enabled',user_hide_realtime_enabled='$user_hide_realtime_enabled',usacan_phone_dialcode_fix='$usacan_phone_dialcode_fix',cache_carrier_stats_realtime='$cache_carrier_stats_realtime',log_recording_access='$log_recording_access',report_default_format='$report_default_format',alt_ivr_logging='$alt_ivr_logging',default_phone_code='$default_phone_code',admin_row_click='$admin_row_click',admin_screen_colors='$admin_screen_colors',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',agent_screen_colors='$agent_screen_colors',script_remove_js='$script_remove_js',manual_auto_next='$manual_auto_next',user_new_lead_limit='$user_new_lead_limit',agent_xfer_park_3way='$agent_xfer_park_3way',agent_soundboards='$agent_soundboards',web_loader_phone_length='$web_loader_phone_length',agent_script='$agent_script',agent_chat_screen_colors='$agent_chat_screen_colors',enable_auto_reports='$enable_auto_reports',enable_pause_code_limits='$enable_pause_code_limits',enable_drop_lists='$enable_drop_lists',allow_ip_lists='$allow_ip_lists',system_ip_blacklist='$system_ip_blacklist',agent_push_events='$agent_push_events',agent_push_url='$agent_push_url',hide_inactive_lists='$hide_inactive_lists',allow_manage_active_lists='$allow_manage_active_lists',expired_lists_inactive='$expired_lists_inactive',did_system_filter='$did_system_filter',anyone_callback_inactive_lists='$anyone_callback_inactive_lists',enable_gdpr_download_deletion='$enable_gdpr_download_deletion',source_id_display='$source_id_display',agent_logout_link='$agent_logout_link',manual_dial_validation='$manual_dial_validation',mute_recordings='$mute_recordings',user_admin_redirect='$user_admin_redirect',list_status_modification_confirmation='$list_status_modification_confirmation',sip_event_logging='$sip_event_logging',call_quota_lead_ranking='$call_quota_lead_ranking',enable_second_script='$enable_second_script',enable_first_webform='$enable_first_webform',recording_buttons='$recording_buttons',opensips_cid_name='$opensips_cid_name',require_password_length='$require_password_length',user_account_emails='$user_account_emails',outbound_cid_any='$outbound_cid_any',entries_per_page='$entries_per_page',browser_call_alerts='$browser_call_alerts',queuemetrics_pausereason='$queuemetrics_pausereason',inbound_answer_config='$inbound_answer_config',enable_international_dncs='$enable_international_dncs',web_loader_phone_strip='$web_loader_phone_strip',manual_dial_phone_strip='$manual_dial_phone_strip',daily_call_count_limit='$daily_call_count_limit',allow_shared_dial='$allow_shared_dial',agent_search_method='$agent_search_method',phone_defaults_container='$phone_defaults_container',qc_claim_limit='$qc_claim_limit',qc_expire_days='$qc_expire_days',two_factor_auth_hours='$two_factor_auth_hours',two_factor_container='$two_factor_container',agent_hidden_sound='$agent_hidden_sound',agent_hidden_sound_volume='$agent_hidden_sound_volume',agent_hidden_sound_seconds='$agent_hidden_sound_seconds',agent_screen_timer='$agent_screen_timer',call_limit_24hour='$call_limit_24hour',allowed_sip_stacks='$allowed_sip_stacks',agent_hide_hangup='$agent_hide_hangup',allow_web_debug='$allow_web_debug',max_logged_in_agents='$max_logged_in_agents',user_codes_admin='$user_codes_admin',login_kickall='$login_kickall',abandon_check_queue='$abandon_check_queue',agent_notifications='$agent_notifications'$custom_dialplanSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $update_main_rows=mysqli_affected_rows($link); if ($DB) {echo "$update_main_rows|$stmt|\n";} @@ -42779,7 +42784,7 @@ if ($ADD==311111111111111) $ALLagent_count = $rowx[2]; } - $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial,queuemetrics_record_hold,country_code_list_stats,reload_timestamp,queuemetrics_pause_type,frozen_server_call_clear,callback_time_24hour,allow_chats,chat_url,chat_timeout,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,agent_debug_logging,default_language,agent_whisper_enabled,user_hide_realtime_enabled,usacan_phone_dialcode_fix,cache_carrier_stats_realtime,oldest_logs_date,log_recording_access,report_default_format,alt_ivr_logging,default_phone_code,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,rec_prompt_count,agent_soundboards,web_loader_phone_length,agent_script,agent_chat_screen_colors,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist,agent_push_events,agent_push_url,hide_inactive_lists,allow_manage_active_lists,expired_lists_inactive,did_system_filter,anyone_callback_inactive_lists,enable_gdpr_download_deletion,source_id_display,agent_logout_link,manual_dial_validation,mute_recordings,user_admin_redirect,list_status_modification_confirmation,sip_event_logging,call_quota_lead_ranking,enable_second_script,enable_first_webform,recording_buttons,opensips_cid_name,require_password_length,user_account_emails,outbound_cid_any,entries_per_page,browser_call_alerts,queuemetrics_pausereason,inbound_answer_config,enable_international_dncs,web_loader_phone_strip,manual_dial_phone_strip,daily_call_count_limit,allow_shared_dial,agent_search_method,phone_defaults_container,qc_claim_limit,qc_expire_days,two_factor_auth_hours,two_factor_container,agent_hidden_sound,agent_hidden_sound_volume,agent_hidden_sound_seconds,agent_screen_timer,label_lead_id,label_list_id,label_entry_date,label_gmt_offset_now,label_source_id,label_called_since_last_reset,label_status,label_user,label_date_of_birth,label_country_code,label_last_local_call_time,label_called_count,label_rank,label_owner,label_entry_list_id,call_limit_24hour,allowed_sip_stacks,agent_hide_hangup,allow_web_debug,max_logged_in_agents,user_codes_admin,login_kickall,abandon_check_queue from system_settings;"; + $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial,queuemetrics_record_hold,country_code_list_stats,reload_timestamp,queuemetrics_pause_type,frozen_server_call_clear,callback_time_24hour,allow_chats,chat_url,chat_timeout,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,agent_debug_logging,default_language,agent_whisper_enabled,user_hide_realtime_enabled,usacan_phone_dialcode_fix,cache_carrier_stats_realtime,oldest_logs_date,log_recording_access,report_default_format,alt_ivr_logging,default_phone_code,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,rec_prompt_count,agent_soundboards,web_loader_phone_length,agent_script,agent_chat_screen_colors,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist,agent_push_events,agent_push_url,hide_inactive_lists,allow_manage_active_lists,expired_lists_inactive,did_system_filter,anyone_callback_inactive_lists,enable_gdpr_download_deletion,source_id_display,agent_logout_link,manual_dial_validation,mute_recordings,user_admin_redirect,list_status_modification_confirmation,sip_event_logging,call_quota_lead_ranking,enable_second_script,enable_first_webform,recording_buttons,opensips_cid_name,require_password_length,user_account_emails,outbound_cid_any,entries_per_page,browser_call_alerts,queuemetrics_pausereason,inbound_answer_config,enable_international_dncs,web_loader_phone_strip,manual_dial_phone_strip,daily_call_count_limit,allow_shared_dial,agent_search_method,phone_defaults_container,qc_claim_limit,qc_expire_days,two_factor_auth_hours,two_factor_container,agent_hidden_sound,agent_hidden_sound_volume,agent_hidden_sound_seconds,agent_screen_timer,label_lead_id,label_list_id,label_entry_date,label_gmt_offset_now,label_source_id,label_called_since_last_reset,label_status,label_user,label_date_of_birth,label_country_code,label_last_local_call_time,label_called_count,label_rank,label_owner,label_entry_list_id,call_limit_24hour,allowed_sip_stacks,agent_hide_hangup,allow_web_debug,max_logged_in_agents,user_codes_admin,login_kickall,abandon_check_queue,agent_notifications from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $version = $row[0]; @@ -43009,6 +43014,7 @@ if ($ADD==311111111111111) $user_codes_admin = $row[224]; $login_kickall = $row[225]; $abandon_check_queue = $row[226]; + $agent_notifications = $row[227]; if ($pass_hash_enabled > 0) {$pass_hash_enabled = 'ENABLED';} else {$pass_hash_enabled = 'DISABLED';} @@ -43148,6 +43154,8 @@ if ($ADD==311111111111111) echo "\n"; echo "$NWB#settings-vdc_header_phone_format$NWE\n"; echo ""._QXZ("Agent API Active").": $NWB#settings-vdc_agent_api_active$NWE\n"; + + echo ""._QXZ("Allow Agent API Notifications").": $NWB#settings-agent_notifications$NWE\n"; echo ""._QXZ("Allow Hide Customer Hangup Button").": $NWB#settings-agent_hide_hangup$NWE\n"; echo ""._QXZ("Agent Screen Park Xfer Button").": $NWB#settings-agent_xfer_park_3way$NWE\n"; echo ""._QXZ("Agent Screen Logout Link Credentials").": $NWB#settings-agent_logout_link$NWE\n"; diff --git a/agc_2-X/trunk/www/vicidial/help_documentation.txt b/agc_2-X/trunk/www/vicidial/help_documentation.txt index 3bd0b7f4..04d706d8 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: 20230311080601 +# version: 20230412144001 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. @@ -1069,6 +1069,7 @@ settings-frozen_server_call_clear Clear Frozen Calls This option can enable settings-allowed_sip_stacks Allowed SIP Stacks This option will determine which SIP modules in Asterisk will be allowed to be configured on your dialers for Phones and Carriers. The standard up until Asterisk 16 is -SIP- which uses the older chan_sip module. The newer PJSIP can be used with Asterisk 16 and higher, if configured properly. Default is SIP. settings-allow_sipsak_messages Allow SIPSAK Messages If set to 1, this will allow the sipsak phones table setting to work if the phone is set to the SIP protocol. The server will send messages to the SIP phone to display on the phone display when logged into the system. This feature only works with SIP phones and requires sipsak application to be installed on the web server that the agent is logged into. Default is 0. settings-vdc_agent_api_active Agent API Active If set to 1, this will allow the Agent API interface to function. Default is 0. +settings-agent_notifications Allow Agent API Notifications If set to 1, this will allow the Agent API send_notification function to send notifications to agents in their agent screens. Default is 0 for disabled. settings-admin_modify_refresh Admin Modify Auto-Refresh This is the refresh interval in seconds of the modify screens in this admin interface. Setting this to 0 will disable it, setting it below 5 will mostly make the modify screens unusable because they will refresh too quickly to change fields. This option is useful in situations where more than one manager is controlling settings on an active campaign or in-group so that the settings are refreshed frequently. Default is 0. settings-nocache_admin Admin No-Cache Setting this to 1 will set all admin pages to web browser no-cache, so every screen has to be reloaded every time it is viewed, even if clicking back on the browser. Default is 0 for disabled. settings-admin_row_click Admin Row Click Setting this to 1 will allow you to click on a row to go to a record link in addition to being able to go to the record link by clicking on the text link. Default is 1 for enabled.