Added send_notification Agent-API function

git-svn-id: svn://192.168.202.10@3704 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2023-04-13 15:57:41 +00:00
parent 607009dd64
commit ebfed832d6
10 changed files with 625 additions and 23 deletions
@@ -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 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 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 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 437 ON -5 Y SSM-FSN Ontario EST America/Toronto
1 CAN 438 QC -5 Y SSM-FSN Quebec 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 1 USA 440 OH -5 Y SSM-FSN Ohio EST America/New_York
+74 -1
View File
@@ -161,9 +161,10 @@
# 230118-1623 - Added Playback audio then hangup extension # 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 # 230309-0926 - Added ara_url for server asterisk reboots, daily rolling of vicidial_abandon_check_queue table
# 230331-2155 - Fix for issue #1458 # 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 $DB=0; # Debug flag
$teodDB=0; # flag to log Timeclock End of Day processes to log file $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";} if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish(); $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 # set past holidays to EXPIRED status
$stmtA = "UPDATE vicidial_call_time_holidays SET holiday_status='EXPIRED' where holiday_date < \"$RMdate\" and holiday_status!='EXPIRED';"; $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";} 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 # 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';"; $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; $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 ##### START scheduled callbacks move old USERONLY triggered to ANYONE
################################################################################ ################################################################################
+53 -1
View File
@@ -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) This document describes the functions of an API(Application Programming Interface)
for the VICIDIAL Agent screen. This functionality will be rather limited at first 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 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_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 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 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&notification_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&notification_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: (<recipient>|<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: Other information:
@@ -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', 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', 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', 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; ) ENGINE=MyISAM;
CREATE TABLE vicidial_campaigns_list_mix ( CREATE TABLE vicidial_campaigns_list_mix (
@@ -4894,6 +4895,34 @@ index(phone_number),
index(lead_id) index(lead_id)
) ENGINE=MyISAM; ) 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; 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; 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; 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@'%';
GRANT RELOAD ON *.* TO cron@localhost; 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 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();
+35
View File
@@ -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; 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; 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;
+220 -4
View File
@@ -1,7 +1,7 @@
<?php <?php
# api.php # api.php
# #
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# This script is designed as an API(Application Programming Interface) to allow # This script is designed as an API(Application Programming Interface) to allow
# other programs to interact with the VICIDIAL Agent screen # other programs to interact with the VICIDIAL Agent screen
@@ -107,10 +107,11 @@
# 210616-2057 - Added optional CORS support, see options.php for details # 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 # 210819-0902 - Updated change_ingroups for changes in vicidial_live_inbound_agents insert/update
# 220220-0847 - Added allow_web_debug system setting # 220220-0847 - Added allow_web_debug system setting
# 230412-0945 - Added send_notification function
# #
$version = '2.14-72'; $version = '2.14-73';
$build = '220220-0847'; $build = '230412-0945';
$php_script = 'api.php'; $php_script = 'api.php';
$startMS = microtime(); $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"];} elseif (isset($_POST["cid_choice"])) {$cid_choice=$_POST["cid_choice"];}
if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];}
elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["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); $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
@@ -277,7 +304,7 @@ $pass = preg_replace("/'|\"|\\\\|;| /","",$pass);
############################################# #############################################
##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP ##### ##### 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); $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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
#if ($DB) {echo "$stmt\n";} #if ($DB) {echo "$stmt\n";}
@@ -291,6 +318,7 @@ if ($qm_conf_ct > 0)
$SSagent_debug_logging = $row[3]; $SSagent_debug_logging = $row[3];
$SSoutbound_cid_any = $row[4]; $SSoutbound_cid_any = $row[4];
$SSallow_web_debug = $row[5]; $SSallow_web_debug = $row[5];
$SSagent_notifications = $row[6];
} }
if ($SSallow_web_debug < 1) {$DB=0;} 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); $close_window_link=preg_replace("/[^-_0-9a-zA-Z]/","",$close_window_link);
$dnc_check=preg_replace("/[^-_0-9a-zA-Z]/","",$dnc_check); $dnc_check=preg_replace("/[^-_0-9a-zA-Z]/","",$dnc_check);
$campaign_dnc_check=preg_replace("/[^-_0-9a-zA-Z]/","",$campaign_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) if ($non_latin < 1)
{ {
@@ -397,6 +426,19 @@ if ($non_latin < 1)
$dial_ingroup = preg_replace("/[^-\_0-9a-zA-Z]/","",$dial_ingroup); $dial_ingroup = preg_replace("/[^-\_0-9a-zA-Z]/","",$dial_ingroup);
$cid_choice = preg_replace("/[^-\_0-9a-zA-Z]/","",$cid_choice); $cid_choice = preg_replace("/[^-\_0-9a-zA-Z]/","",$cid_choice);
$outbound_cid = preg_replace("/[^-\_0-9a-zA-Z]/","",$outbound_cid); $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 else
{ {
@@ -477,6 +519,19 @@ else
$dial_ingroup = preg_replace("/[^-\_0-9\p{L}]/u","",$dial_ingroup); $dial_ingroup = preg_replace("/[^-\_0-9\p{L}]/u","",$dial_ingroup);
$cid_choice = preg_replace("/[^-\_0-9\p{L}]/u","",$cid_choice); $cid_choice = preg_replace("/[^-\_0-9\p{L}]/u","",$cid_choice);
$outbound_cid = preg_replace("/[^-\_0-9\p{L}]/u","",$outbound_cid); $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 ### 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<BR>\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."<BR>\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<count($container_entry); $q++)
{
if (!preg_match('/^\;/', $container_entry[$q]) && preg_match('/\s\=\>\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."<BR>\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
################################################################################
################################################################################ ################################################################################
+78 -3
View File
@@ -93,10 +93,11 @@
# 220219-2328 - Added allow_web_debug system setting # 220219-2328 - Added allow_web_debug system setting
# 220310-0934 - Added more time-sync detailed logging # 220310-0934 - Added more time-sync detailed logging
# 230220-1759 - Fix for In-Group manual dial issue # 230220-1759 - Fix for In-Group manual dial issue
# 230412-1020 - Added code for send_notification API function
# #
$version = '2.14-67'; $version = '2.14-68';
$build = '230220-1759'; $build = '230412-1020';
$php_script = 'conf_exten_check.php'; $php_script = 'conf_exten_check.php';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=51; $mysql_log_count=51;
@@ -184,7 +185,7 @@ $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass);
############################################# #############################################
##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP ##### ##### 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); $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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$user,$server_ip,$session_name,$one_mysql_log);}
#if ($DB) {echo "$stmt\n";} #if ($DB) {echo "$stmt\n";}
@@ -197,6 +198,7 @@ if ($qm_conf_ct > 0)
$SSlanguage_method = $row[2]; $SSlanguage_method = $row[2];
$SSagent_debug_logging = $row[3]; $SSagent_debug_logging = $row[3];
$SSallow_web_debug = $row[4]; $SSallow_web_debug = $row[4];
$SSagent_notifications = $row[5];
} }
if ($SSallow_web_debug < 1) {$DB=0; $format='text';} 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"; 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"; echo "$countecho\n";
$stage = "$Astatus|$Aagent_log_id$DEADlog"; $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);
}
} }
+114 -5
View File
@@ -715,10 +715,11 @@
# 230306-1335 - Added 20Hz_tone browser sound, Issue #1448 # 230306-1335 - Added 20Hz_tone browser sound, Issue #1448
# 230306-2034 - Added setTimeoutAudioLoop agent_screen_timer option, Issue #1448 # 230306-2034 - Added setTimeoutAudioLoop agent_screen_timer option, Issue #1448
# 230407-1839 - Fix for input variable filter issue # 230407-1839 - Fix for input variable filter issue
# 230412-1018 - Added code for send_notification API function
# #
$version = '2.14-683c'; $version = '2.14-684c';
$build = '230407-1839'; $build = '230412-1018';
$php_script = 'vicidial.php'; $php_script = 'vicidial.php';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=98; $mysql_log_count=98;
@@ -818,7 +819,7 @@ $random = (rand(1000000, 9999999) + 10000000);
############################################# #############################################
##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP ##### ##### 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); $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 ($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";} #if ($DB) {echo "$stmt\n";}
@@ -880,6 +881,7 @@ if ($qm_conf_ct > 0)
$SSallow_web_debug = $row[51]; $SSallow_web_debug = $row[51];
$SSmax_logged_in_agents = $row[52]; $SSmax_logged_in_agents = $row[52];
$SSlogin_kickall = $row[53]; $SSlogin_kickall = $row[53];
$SSagent_notifications = $row[54];
if ( ($SSagent_hidden_sound == '---NONE---') or ($SSagent_hidden_sound == '') ) {$SSagent_hidden_sound_seconds=0;} if ( ($SSagent_hidden_sound == '---NONE---') or ($SSagent_hidden_sound == '') ) {$SSagent_hidden_sound_seconds=0;}
} }
else else
@@ -5969,6 +5971,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var agent_hangup_value='<?php echo $agent_hangup_value ?>'; var agent_hangup_value='<?php echo $agent_hangup_value ?>';
var agent_hangup_ig_override='<?php echo $agent_hangup_ig_override ?>'; var agent_hangup_ig_override='<?php echo $agent_hangup_ig_override ?>';
var show_confetti='<?php echo $show_confetti ?>'; var show_confetti='<?php echo $show_confetti ?>';
var agent_notifications='<?php echo $SSagent_notifications ?>';
var DiaLControl_auto_HTML = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready','','','','','','','YES');\"><img src=\"./images/<?php echo _QXZ("vdc_LB_paused.gif") ?>\" border=\"0\" alt=\"You are paused\" /></a>"; var DiaLControl_auto_HTML = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready','','','','','','','YES');\"><img src=\"./images/<?php echo _QXZ("vdc_LB_paused.gif") ?>\" border=\"0\" alt=\"You are paused\" /></a>";
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause','','','','','','','YES');\"><img src=\"./images/<?php echo _QXZ("vdc_LB_active.gif") ?>\" border=\"0\" alt=\"You are active\" /></a>"; var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause','','','','','','','YES');\"><img src=\"./images/<?php echo _QXZ("vdc_LB_active.gif") ?>\" border=\"0\" alt=\"You are active\" /></a>";
var DiaLControl_auto_HTML_OFF = "<img src=\"./images/<?php echo _QXZ("vdc_LB_blank_OFF.gif") ?>\" border=\"0\" alt=\"pause button disabled\" />"; var DiaLControl_auto_HTML_OFF = "<img src=\"./images/<?php echo _QXZ("vdc_LB_blank_OFF.gif") ?>\" 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 // Request number of USERONLY callbacks for this agent
function CalLBacKsCounTCheck() function CalLBacKsCounTCheck()
@@ -9196,7 +9280,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
// ################################################################################ // ################################################################################
// closes callback list screen // 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 ABtop='200px';
var ABleft='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.top = ABtop;
document.getElementById("AlertBox").style.left = ABleft; 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+="<B>";
tag_END="</B>"+tag_END;
}
if (message_weight.match(/italic/))
{
tag_BEGIN+="<I>";
tag_END="</I>"+tag_END;
}
if (message_weight.match(/underline/))
{
tag_BEGIN+="<U>";
tag_END="</U>"+tag_END;
}
temp_message="<p style=\"font-size:"+message_size+"px;font-family:'"+message_font+"';color:"+message_color+"\">"+tag_BEGIN+temp_message+tag_END+"</p>";
}
document.getElementById("AlertBoxContent").innerHTML = temp_message; document.getElementById("AlertBoxContent").innerHTML = temp_message;
showDiv('AlertBox'); showDiv('AlertBox');
@@ -20402,6 +20510,7 @@ function phone_number_format(formatphone) {
else else
{ {
var WaitingForNextStep=0; var WaitingForNextStep=0;
if (agent_notifications > 0) {AlerTDisplaY();}
if ( (CloserSelecting==1) || (TerritorySelecting==1) ) {WaitingForNextStep=1;} if ( (CloserSelecting==1) || (TerritorySelecting==1) ) {WaitingForNextStep=1;}
if (open_dispo_screen==1) if (open_dispo_screen==1)
{ {
@@ -21890,7 +21999,7 @@ function phone_number_format(formatphone) {
$zi=2; $zi=2;
?> ?>
<body onload="begin_all_refresh();" onunload="BrowserCloseLogout();"> <body onload="begin_all_refresh();" onunload="BrowserCloseLogout();"> <!-- alert_box('BIG ALERT', '36', 'Courier', '#FF0', 'bold|italics'); //-->
<!-- <canvas id="confetti-canvas" style="display:block;z-index:999999;pointer-events:none"></canvas> //--> <!-- <canvas id="confetti-canvas" style="display:block;z-index:999999;pointer-events:none"></canvas> //-->
<form name=vicidial_form id=vicidial_form onsubmit="return false;"> <form name=vicidial_form id=vicidial_form onsubmit="return false;">
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
# version: 20230311080601 # version: 20230412144001
users-user User ID <QXZ>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-.</QXZ> users-user User ID <QXZ>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-.</QXZ>
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ> users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ> users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
@@ -1069,6 +1069,7 @@ settings-frozen_server_call_clear Clear Frozen Calls <QXZ>This option can enable
settings-allowed_sip_stacks Allowed SIP Stacks <QXZ>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.</QXZ> settings-allowed_sip_stacks Allowed SIP Stacks <QXZ>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.</QXZ>
settings-allow_sipsak_messages Allow SIPSAK Messages <QXZ>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. </QXZ> settings-allow_sipsak_messages Allow SIPSAK Messages <QXZ>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. </QXZ>
settings-vdc_agent_api_active Agent API Active <QXZ>If set to 1, this will allow the Agent API interface to function. Default is 0. </QXZ> settings-vdc_agent_api_active Agent API Active <QXZ>If set to 1, this will allow the Agent API interface to function. Default is 0. </QXZ>
settings-agent_notifications Allow Agent API Notifications <QXZ>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. </QXZ>
settings-admin_modify_refresh Admin Modify Auto-Refresh <QXZ>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.</QXZ> settings-admin_modify_refresh Admin Modify Auto-Refresh <QXZ>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.</QXZ>
settings-nocache_admin Admin No-Cache <QXZ>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.</QXZ> settings-nocache_admin Admin No-Cache <QXZ>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.</QXZ>
settings-admin_row_click Admin Row Click <QXZ>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.</QXZ> settings-admin_row_click Admin Row Click <QXZ>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.</QXZ>