Added archived-log cold-storage options and scripts

git-svn-id: svn://192.168.202.10@3844 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2024-07-05 04:37:22 +00:00
parent ad3ca0ade7
commit 1f360994d9
11 changed files with 3589 additions and 20 deletions
+3
View File
@@ -864,6 +864,9 @@ OTHER CHANGES:
246. Added ALT option for "Start Call URL" to allow for multiple URLs to be
requested at the agent-start of a call.
247. Added archived-log cold-storage options and scripts.
See LOG_ARCHIVING_AND_COLD_STORAGE.txt document for more infomation.
File diff suppressed because it is too large Load Diff
@@ -18,6 +18,7 @@
# 180928-1958 - Added update of report_server, active_twin_server_ip and active_voicemail_server, issue #1109
# 190530-1517 - Added mising commented-out keepalives in conf file
# 240420-2247 - Added ConfBridge code
# 240704-1737 - Added CS server variables
#
# default path to astguiclient configuration file:
@@ -43,6 +44,16 @@ foreach(@conf)
{$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_server/) && ($CLICS_server < 1) )
{$VARCS_server = $line; $VARCS_server =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_database/) && ($CLICS_database < 1) )
{$VARCS_database = $line; $VARCS_database =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_user/) && ($CLICS_user < 1) )
{$VARCS_user = $line; $VARCS_user =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_pass/) && ($CLICS_pass < 1) )
{$VARCS_pass = $line; $VARCS_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_port/) && ($CLICS_port < 1) )
{$VARCS_port = $line; $VARCS_port =~ s/.*=//gi;}
$i++;
}
@@ -167,6 +178,16 @@ if (-e "$PATHconf")
{$VARDB_custom_pass = $line; $VARDB_custom_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_server/) && ($CLICS_server < 1) )
{$VARCS_server = $line; $VARCS_server =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_database/) && ($CLICS_database < 1) )
{$VARCS_database = $line; $VARCS_database =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_user/) && ($CLICS_user < 1) )
{$VARCS_user = $line; $VARCS_user =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_pass/) && ($CLICS_pass < 1) )
{$VARCS_pass = $line; $VARCS_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_port/) && ($CLICS_port < 1) )
{$VARCS_port = $line; $VARCS_port =~ s/.*=//gi;}
if ( ($line =~ /^VARactive_keepalives/) && ($CLIactive_keepalives < 1) )
{$VARactive_keepalives = $line; $VARactive_keepalives =~ s/.*=//gi;}
if ( ($line =~ /^VARasterisk_version/) && ($CLIasterisk_version < 1) )
@@ -344,6 +365,11 @@ print conf "VARDB_pass => $VARDB_pass\n";
print conf "VARDB_custom_user => $VARDB_custom_user\n";
print conf "VARDB_custom_pass => $VARDB_custom_pass\n";
print conf "VARDB_port => $VARDB_port\n";
print conf "VARCS_server => $VARCS_server\n";
print conf "VARCS_database => $VARCS_database\n";
print conf "VARCS_user => $VARCS_user\n";
print conf "VARCS_pass => $VARCS_pass\n";
print conf "VARCS_port => $VARCS_port\n";
print conf "\n";
print conf "# Alpha-Numeric list of the astGUIclient processes to be kept running\n";
print conf "# (value should be listing of characters with no spaces: 123456)\n";
@@ -0,0 +1,145 @@
LOG ARCHIVING AND COLD STORAGE DOC Started: 2024-07-04 Updated: 2024-07-04
This document covers the options for archiving of specific log tables and the new "Cold Storage" features
--------------------------------------------------------------------------------
LOG ARCHIVING:
On a high-volume VICIdial system, some log tables can grow very large, resulting in performance issues on the database server. To help mitigate this, we created a log archiving script back in 2009("ADMIN_archive_log_tables.pl") to move log records from specific database log tables to their associated "_archive" log tables. This archive script has grown over the years to add archiving of more log tables and even optional purging(deleting rows from) specific archive and log tables if desired.
NOTE: the "ADMIN_archive_log_tables.pl" script can take hours to run depending on the settings used, the number of log records in your system and the speed of your database server. As such, you should only run this script during non-production hours.
For reference, here are the optional commands for the log archiving script:
# /usr/share/astguiclient/ADMIN_archive_log_tables.pl --help
allowed run time options:
[--daily] = only archives call_log, vicidial_log_extended, vicidial_dial_log and vicidial_drop_log tables, only last 24 hours kept
[--carrier-daily] = will also archive the vicidial_carrier_log table when --daily is run
[--vlog-daily] = will also archive the vicidial_log table when --daily is run
[--days=XX] = number of days to archive past, default is 732(2 years)
[--months=XX] = number of months to archive past, default is 24(2 years) If 'days' used then 'months' ignored
[--queue-log] = archive QM queue_log records
[--only-trim-archive-level-one] = will not perform normal archive process, instead this will only delete records
that are older than XX months from least important log archive tables:
call_log_archive, vicidial_log_extended_archive, vicidial_dial_log_archive, vicidial_drop_log
[--only-trim-archive-level-two] = same as --only-trim-archive-level-one, except includes tables:
vicidial_carrier_log_archive, vicidial_api_log_archive, vicidial_rt_monitor_log_archive
[--only-trim-archive-level-three] = same as --only-trim-archive-level-two, except includes tables:
vicidial_log_archive, vicidial_agent_log_archive, vicidial_closer_log_archive, vicidial_xfer_log_archive
[--recording-log-days=XX] = OPTIONAL, number of days to archive recording_log table only past
[--did-log-days=XX] = OPTIONAL, number of days to archive vicidial_did_log table only past
[--park-log-days=XX] = OPTIONAL, number of days to archive park_log table only past
[--api-only] = OPTIONAL, only archive vicidial_api_log table then exit
[--api-log-days=XX] = REQUIRED FOR --api-only, number of days to archive vicidial_api_log table only past
[--api-archive-only] = OPTIONAL, only purge vicidial_api_log_archive table then exit
[--api-archive-days=XX] = REQUIRED FOR --api-archive-only, number of days to purge vicidial_api_log_archive table only past
[--url-log-only] = OPTIONAL, only purge vicidial_url_log table then exit
[--url-log-days=XX] = REQUIRED FOR --url-log-only, number of days to purge vicidial_url_log table only past
[--cpd-log-purge-days=XX] = OPTIONAL, number of days to purge vicidial_cpd_log table only past
[--wipe-closer-log] = OPTIONAL, deletes all records from vicidial_closer_log after archiving
[--wipe-all-being-archived] = OPTIONAL, deletes all records from most tables after archiving
[--quiet] = quiet
[--calc-test] = date calculation test only
[--test] = test
[--debug] = debug output for some options
Here are some example crorntab entries for this script to perform certain log archiving and purging:
(these should only be active on a single server on your VICIdial cluster)
### archive logs weekly on Saturday morning at 1am, keep only 2 years of logs in the active log tables, archive older log records
20 1 * * 6 /usr/share/astguiclient/ADMIN_archive_log_tables.pl --months=24
### archive api log entries older than 1 day, do this every night at 12:10 AM
10 0 * * * /usr/share/astguiclient/ADMIN_archive_log_tables.pl --api-only --api-log-days=1
### delete api log entries older than 7 days, do this on Sunday morning at 1:15AM
15 1 * * 0 /usr/share/astguiclient/ADMIN_archive_log_tables.pl --api-archive-only --api-archive-days=7
### delete url log entries older than 7 days, do this on Sunday morning at 1:05AM
5 1 * * 6 /usr/share/astguiclient/ADMIN_archive_log_tables.pl --url-log-only --url-log-days=7 --debugX
### for a very high-volume inbound cluster, archive logs older than 1 day, including recording log, clear the closer log table and archive did log entries past 31 days
3 1 * * 0,1,2,3,4,5,6 /usr/share/astguiclient/ADMIN_archive_log_tables.pl --days=1 --recording-log-days=1 --wipe-closer-log --wipe-all-being-archived --did-log-days=31
### purge(delete) level-three archive log table records older than 92 days
15 21 * * 5 /usr/share/astguiclient/ADMIN_archive_log_tables.pl --debug --only-trim-archive-level-three --days=92
--------------------------------------------------------------------------------
ARCHIVED LOG COLD STORAGE:
In July 2024, we added some basic options to allow for the moving of already archived log records from the primary database server to a separate database server to allow for more efficient use of the primary database server while still having limited access to very old log records without losing them entirely by deleting them.
Admin access to cold-storage logs is currently available through the following pages:
- Admin Lead Search Page
- Admin Modify Lead Page
The "ADMIN_cold_storage_log_tables.pl" script was added to move archived log records from the primary database to a separate "cold storage" database server. This "cold storage" database server should have the standard vicidial log tables loaded on it, BUT it should NEVER have any live agents or calls running through it, the purpose of this "cold storage" database server is ONLY for storage of old log records. The archived log records on the "cold storage" database server will be stored in the same "_archive" log tables that they were on the primary database server, the reasons for this are: to make programming these features easier, to allow for easier integration of cold-storage logs into existing reporting and admin utilities, and to possibly allow for multiple-level cold-storage in the future.
We added new settings to the /etc/astguiclient.conf file that will run the "ADMIN_cold_storage_log_tables.pl" script, these credentials should allow for read-write access(see example "GRANT" statement below):
# default cold storage logs database server variables:
$VARCS_server = '';
$VARCS_database = 'asterisk_coldstorage';
$VARCS_user = 'coldstorage';
$VARCS_pass = 'cs1234';
$VARCS_port = '3306';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk_coldstorage.* TO coldstorage@'%' IDENTIFIED BY 'cs1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk_coldstorage.* TO coldstorage@localhost IDENTIFIED BY 'cs1234';
flush privileges;
We also added system_settings fields for read-only access to the cold-storage database server:
NOTE: You should use a separate database read-only user for the below credentials(see example "GRANT" statement below)
ALTER TABLE system_settings ADD coldstorage_server_ip VARCHAR(50) default '';
ALTER TABLE system_settings ADD coldstorage_dbname VARCHAR(50) default '';
ALTER TABLE system_settings ADD coldstorage_login VARCHAR(50) default '';
ALTER TABLE system_settings ADD coldstorage_pass VARCHAR(50) default '';
ALTER TABLE system_settings ADD coldstorage_port VARCHAR(10) default '';
GRANT SELECT,LOCK TABLES on asterisk_coldstorage.* TO csread@'%' IDENTIFIED BY 'csr1234';
GRANT SELECT,LOCK TABLES on asterisk_coldstorage.* TO csread@localhost IDENTIFIED BY 'csr1234';
flush privileges;
The "ADMIN_cold_storage_log_tables.pl" script has a reduced set of options, with the "--days=X" option being the most important one:
# /usr/share/astguiclient/ADMIN_cold_storage_log_tables.pl --help
allowed run time options:
[--days=XX] = number of days to archive past, default is 1461(4 years)
[--quiet] = quiet
[--calc-test] = date calculation test only
[--test] = test
[--debug] = debug output for some options
[--debugX] = extra debug output for some options
Here is a list of the archive tables that are currently moved by the "ADMIN_cold_storage_log_tables.pl" script:
call_log_archive
vicidial_agent_log_archive
vicidial_agent_visibility_log_archive
vicidial_amd_log_archive
vicidial_api_log_archive
vicidial_api_urls_archive
vicidial_carrier_log_archive
vicidial_dial_cid_log_archive
vicidial_dial_log_archive
vicidial_log_archive
vicidial_log_extended_archive
vicidial_log_extended_sip_archive
@@ -2031,7 +2031,12 @@ inbound_credits ENUM('0','1','2','3','4','5','6','7') default '0',
weekday_resets ENUM('0','1','2','3','4','5','6','7') default '0',
two_factor_auth_agent_hours SMALLINT(5) default '0',
highest_lead_id VARCHAR(20) default '0',
hopper_hold_inserts ENUM('0','1','2','3','4','5','6','7') default '0'
hopper_hold_inserts ENUM('0','1','2','3','4','5','6','7') default '0',
coldstorage_server_ip VARCHAR(50) default '',
coldstorage_dbname VARCHAR(50) default '',
coldstorage_login VARCHAR(50) default '',
coldstorage_pass VARCHAR(50) default '',
coldstorage_port VARCHAR(10) default ''
) ENGINE=MyISAM;
CREATE TABLE vicidial_campaigns_list_mix (
@@ -5677,4 +5682,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='1715',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1716',db_schema_update_date=NOW(),reload_timestamp=NOW();
+8
View File
@@ -2728,3 +2728,11 @@ UPDATE system_settings SET db_schema_version='1714',db_schema_update_date=NOW()
ALTER TABLE vicidial_campaigns ADD leave_3way_stop_recording ENUM('DISABLED','ALL_CALLS') default 'DISABLED';
UPDATE system_settings SET db_schema_version='1715',db_schema_update_date=NOW() where db_schema_version < 1715;
ALTER TABLE system_settings ADD coldstorage_server_ip VARCHAR(50) default '';
ALTER TABLE system_settings ADD coldstorage_dbname VARCHAR(50) default '';
ALTER TABLE system_settings ADD coldstorage_login VARCHAR(50) default '';
ALTER TABLE system_settings ADD coldstorage_pass VARCHAR(50) default '';
ALTER TABLE system_settings ADD coldstorage_port VARCHAR(10) default '';
UPDATE system_settings SET db_schema_version='1716',db_schema_update_date=NOW() where db_schema_version < 1716;
+235 -1
View File
@@ -2,7 +2,7 @@
# install.pl version 2.14
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
@@ -51,6 +51,7 @@
# 221228-2049 - Added KhompEnabled option
# 230117-2220 - Added --khomp-enable CLI flag
# 230508-0809 - Added Asterisk 18 compatibility
# 240704-0830 - Added coldstorage DB entries
#
############################################
@@ -85,6 +86,12 @@ $VARDB_pass = '1234';
$VARDB_custom_user = 'custom';
$VARDB_custom_pass = 'custom1234';
$VARDB_port = '3306';
# default cold storage logs database server variables:
$VARCS_server = '';
$VARCS_database = 'asterisk_coldstorage';
$VARCS_user = 'coldstorage';
$VARCS_pass = 'cs1234';
$VARCS_port = '3306';
# default keepalive processes:
$VARactive_keepalives = '1234568';
# default Asterisk version:
@@ -129,6 +136,11 @@ $CLIDB_pass=0;
$CLIDB_custom_user=0;
$CLIDB_custom_pass=0;
$CLIDB_port=0;
$CLICS_server=0;
$CLICS_database=0;
$CLICS_user=0;
$CLICS_pass=0;
$CLICS_port=0;
$CLIVARactive_keepalives=0;
$CLIVARasterisk_version=0;
$CLIFTP_host=0;
@@ -204,6 +216,11 @@ if (length($ARGV[0])>1)
print " [--DB_custom_user=custom] = define database custom user login at runtime\n";
print " [--DB_custom_pass=custom1234] = define database custom user password at runtime\n";
print " [--DB_port=3306] = define database connection port at runtime\n";
print " [--CS_server=x] = define cold-storage database server IP address at runtime\n";
print " [--CS_database=asterisk_coldstorage] = define cold-storage database name at runtime\n";
print " [--CS_user=cron] = define cold-storage database user login at runtime\n";
print " [--CS_pass=1234] = define cold-storage database user password at runtime\n";
print " [--CS_port=3306] = define cold-storage database connection port at runtime\n";
print " [--active_keepalives=123456] = define processes to keepalive\n";
print " X - NO KEEPALIVE PROCESSES (use only if you want none to be keepalive)\n";
print " 1 - AST_update\n";
@@ -452,6 +469,66 @@ if (length($ARGV[0])>1)
print " CLI defined DB port: $VARDB_port\n";
}
}
if ($args =~ /--CS_server=/i) # CLI defined Cosl Storage Database server address
{
@CLICS_serverARY = split(/--CS_server=/,$args);
@CLICS_serverARX = split(/ /,$CLICS_serverARY[1]);
if (length($CLICS_serverARX[0])>2)
{
$VARCS_server = $CLICS_serverARX[0];
$VARCS_server =~ s/\/$| |\r|\n|\t//gi;
$CLICS_server=1;
print " CLI defined CS server: $VARCS_server\n";
}
}
if ($args =~ /--CS_database=/i) # CLI defined CS Database name
{
@CLICS_databaseARY = split(/--CS_database=/,$args);
@CLICS_databaseARX = split(/ /,$CLICS_databaseARY[1]);
if (length($CLICS_databaseARX[0])>1)
{
$VARCS_database = $CLICS_databaseARX[0];
$VARCS_database =~ s/ |\r|\n|\t//gi;
$CLICS_database=1;
print " CLI defined CS database: $VARCS_database\n";
}
}
if ($args =~ /--CS_user=/i) # CLI defined CS Database user login
{
@CLICS_userARY = split(/--CS_user=/,$args);
@CLICS_userARX = split(/ /,$CLICS_userARY[1]);
if (length($CLICS_userARX[0])>1)
{
$VARCS_user = $CLICS_userARX[0];
$VARCS_user =~ s/ |\r|\n|\t//gi;
$CLICS_user=1;
print " CLI defined CS user: $VARCS_user\n";
}
}
if ($args =~ /--CS_pass=/i) # CLI defined CS Database user password
{
@CLICS_passARY = split(/--CS_pass=/,$args);
@CLICS_passARX = split(/ /,$CLICS_passARY[1]);
if (length($CLICS_passARX[0])>1)
{
$VARCS_pass = $CLICS_passARX[0];
$VARCS_pass =~ s/ |\r|\n|\t//gi;
$CLICS_pass=1;
print " CLI defined CS password: $VARCS_pass\n";
}
}
if ($args =~ /--CS_port=/i) # CLI defined CS Database connection port
{
@CLICS_portARY = split(/--CS_port=/,$args);
@CLICS_portARX = split(/ /,$CLICS_portARY[1]);
if (length($CLICS_portARX[0])>1)
{
$VARCS_port = $CLICS_portARX[0];
$VARCS_port =~ s/ |\r|\n|\t//gi;
$CLICS_port=1;
print " CLI defined CS port: $VARCS_port\n";
}
}
if ($args =~ /--active_keepalives=/i) # CLI defined keepalive processes
{
@CLIkeepaliveARY = split(/--active_keepalives=/,$args);
@@ -755,6 +832,16 @@ if (length($ARGV[0])>1)
{$VARDB_custom_pass = $line; $VARDB_custom_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_server/) && ($CLICS_server < 1) )
{$VARCS_server = $line; $VARCS_server =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_database/) && ($CLICS_database < 1) )
{$VARCS_database = $line; $VARCS_database =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_user/) && ($CLICS_user < 1) )
{$VARCS_user = $line; $VARCS_user =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_pass/) && ($CLICS_pass < 1) )
{$VARCS_pass = $line; $VARCS_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_port/) && ($CLICS_port < 1) )
{$VARCS_port = $line; $VARCS_port =~ s/.*=//gi;}
$i++;
}
@@ -921,6 +1008,16 @@ if (length($ARGV[0])>1)
{$VARDB_custom_pass = $line; $VARDB_custom_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_server/) && ($CLICS_server < 1) )
{$VARCS_server = $line; $VARCS_server =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_database/) && ($CLICS_database < 1) )
{$VARCS_database = $line; $VARCS_database =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_user/) && ($CLICS_user < 1) )
{$VARCS_user = $line; $VARCS_user =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_pass/) && ($CLICS_pass < 1) )
{$VARCS_pass = $line; $VARCS_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_port/) && ($CLICS_port < 1) )
{$VARCS_port = $line; $VARCS_port =~ s/.*=//gi;}
$i++;
}
@@ -1066,6 +1163,16 @@ if (-e "$PATHconf")
{$VARDB_custom_pass = $line; $VARDB_custom_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_server/) && ($CLICS_server < 1) )
{$VARCS_server = $line; $VARCS_server =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_database/) && ($CLICS_database < 1) )
{$VARCS_database = $line; $VARCS_database =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_user/) && ($CLICS_user < 1) )
{$VARCS_user = $line; $VARCS_user =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_pass/) && ($CLICS_pass < 1) )
{$VARCS_pass = $line; $VARCS_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_port/) && ($CLICS_port < 1) )
{$VARCS_port = $line; $VARCS_port =~ s/.*=//gi;}
if ( ($line =~ /^VARactive_keepalives/) && ($CLIactive_keepalives < 1) )
{$VARactive_keepalives = $line; $VARactive_keepalives =~ s/.*=//gi;}
if ( ($line =~ /^VARasterisk_version/) && ($CLIasterisk_version < 1) )
@@ -1188,6 +1295,16 @@ else
{$VARDB_custom_pass = $line; $VARDB_custom_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_server/) && ($CLICS_server < 1) )
{$VARCS_server = $line; $VARCS_server =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_database/) && ($CLICS_database < 1) )
{$VARCS_database = $line; $VARCS_database =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_user/) && ($CLICS_user < 1) )
{$VARCS_user = $line; $VARCS_user =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_pass/) && ($CLICS_pass < 1) )
{$VARCS_pass = $line; $VARCS_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARCS_port/) && ($CLICS_port < 1) )
{$VARCS_port = $line; $VARCS_port =~ s/.*=//gi;}
if ( ($line =~ /^VARactive_keepalives/) && ($CLIactive_keepalives < 1) )
{$VARactive_keepalives = $line; $VARactive_keepalives =~ s/.*=//gi;}
if ( ($line =~ /^VARasterisk_version/) && ($CLIasterisk_version < 1) )
@@ -1828,6 +1945,111 @@ else
}
##### END DB_port prompting and check #####
##### BEGIN CS_server prompting and check #####
if (length($VARCS_server)<7)
{
$VARCS_server = '';
}
$continue='NO';
while ($continue =~/NO/)
{
print("\nCS server address or press enter for default(optional): [$VARCS_server] ");
$PROMPTCS_server = <STDIN>;
chomp($PROMPTCS_server);
if (length($PROMPTCS_server)>6)
{
$PROMPTCS_server =~ s/ |\n|\r|\t|\/$//gi;
$VARCS_server=$PROMPTCS_server;
$continue='YES';
}
else
{
$continue='YES';
}
}
##### END CS_server prompting and check #####
##### BEGIN CS_database prompting and check #####
$continue='NO';
while ($continue =~/NO/)
{
print("\nCS database name or press enter for default(optional): [$VARCS_database] ");
$PROMPTCS_database = <STDIN>;
chomp($PROMPTCS_database);
if (length($PROMPTCS_database)>1)
{
$PROMPTCS_database =~ s/ |\n|\r|\t|\/$//gi;
$VARCS_database=$PROMPTCS_database;
$continue='YES';
}
else
{
$continue='YES';
}
}
##### END CS_database prompting and check #####
##### BEGIN CS_user prompting and check #####
$continue='NO';
while ($continue =~/NO/)
{
print("\nCS user login or press enter for default(optional): [$VARCS_user] ");
$PROMPTCS_user = <STDIN>;
chomp($PROMPTCS_user);
if (length($PROMPTCS_user)>1)
{
$PROMPTCS_user =~ s/ |\n|\r|\t|\/$//gi;
$VARCS_user=$PROMPTCS_user;
$continue='YES';
}
else
{
$continue='YES';
}
}
##### END CS_user prompting and check #####
##### BEGIN CS_pass prompting and check #####
$continue='NO';
while ($continue =~/NO/)
{
print("\nCS user password or press enter for default(optional): [$VARCS_pass] ");
$PROMPTCS_pass = <STDIN>;
chomp($PROMPTCS_pass);
if (length($PROMPTCS_pass)>1)
{
$PROMPTCS_pass =~ s/ |\n|\r|\t|\/$//gi;
$VARCS_pass=$PROMPTCS_pass;
$continue='YES';
}
else
{
$continue='YES';
}
}
##### END CS_pass prompting and check #####
##### BEGIN CS_port prompting and check #####
$continue='NO';
while ($continue =~/NO/)
{
print("\nCS connection port or press enter for default(optional): [$VARCS_port] ");
$PROMPTCS_port = <STDIN>;
chomp($PROMPTCS_port);
if (length($PROMPTCS_port)>1)
{
$PROMPTCS_port =~ s/ |\n|\r|\t|\/$//gi;
$VARCS_port=$PROMPTCS_port;
$continue='YES';
}
else
{
$continue='YES';
}
}
##### END CS_port prompting and check #####
##### BEGIN active_keepalives prompting and check #####
$continue='NO';
while ($continue =~/NO/)
@@ -2374,6 +2596,11 @@ else
print " defined DB_custom_user: $VARDB_custom_user\n";
print " defined DB_custom_pass: $VARDB_custom_pass\n";
print " defined DB_port: $VARDB_port\n";
print " defined CS_server: $VARCS_server\n";
print " defined CS_database: $VARCS_database\n";
print " defined CS_user: $VARCS_user\n";
print " defined CS_pass: $VARCS_pass\n";
print " defined CS_port: $VARCS_port\n";
print " defined active_keepalives: $VARactive_keepalives\n";
print " defined asterisk_version: $VARasterisk_version\n";
print " defined copying conf files: $PROMPTcopy_conf_files\n";
@@ -2460,6 +2687,13 @@ print conf "VARDB_custom_user => $VARDB_custom_user\n";
print conf "VARDB_custom_pass => $VARDB_custom_pass\n";
print conf "VARDB_port => $VARDB_port\n";
print conf "\n";
print conf "# Cold-Storage Database connection information (optional)\n";
print conf "VARCS_server => $VARCS_server\n";
print conf "VARCS_database => $VARCS_database\n";
print conf "VARCS_user => $VARCS_user\n";
print conf "VARCS_pass => $VARCS_pass\n";
print conf "VARCS_port => $VARCS_port\n";
print conf "\n";
print conf "# Alpha-Numeric list of the astGUIclient processes to be kept running\n";
print conf "# (value should be listing of characters with no spaces: 1234568)\n";
print conf "# X - NO KEEPALIVE PROCESSES (use only if you want none to be keepalive)\n";
File diff suppressed because one or more lines are too long
@@ -8,7 +8,7 @@
# just needs to enter the leadID and then they can view and modify the
# information in the record for that lead
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -117,6 +117,7 @@
# 230309-1444 - Added Inbound Call Menu Log display as part of IVR Log section
# 231117-1920 - Added vicidial_3way_press_log display
# 231126-2218 - Added vicidial_hci_log display
# 240704-2329 - Added coldstorage log view option
#
require("dbconnect_mysqli.php");
@@ -278,7 +279,7 @@ if ($nonselectable_statuses > 0)
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable,allow_emails,enable_languages,language_method,active_modules,log_recording_access,admin_screen_colors,enable_gdpr_download_deletion,source_id_display,mute_recordings,sip_event_logging,allow_web_debug,hopper_hold_inserts FROM system_settings;";
$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable,allow_emails,enable_languages,language_method,active_modules,log_recording_access,admin_screen_colors,enable_gdpr_download_deletion,source_id_display,mute_recordings,sip_event_logging,allow_web_debug,hopper_hold_inserts,coldstorage_server_ip,coldstorage_dbname,coldstorage_login,coldstorage_pass,coldstorage_port FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
#if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysqli_num_rows($rslt);
@@ -300,6 +301,11 @@ if ($qm_conf_ct > 0)
$SSsip_event_logging = $row[12];
$SSallow_web_debug = $row[13];
$SShopper_hold_inserts = $row[14];
$SScoldstorage_server_ip = $row[15];
$SScoldstorage_dbname = $row[16];
$SScoldstorage_login = $row[17];
$SScoldstorage_pass = $row[18];
$SScoldstorage_port = $row[19];
}
if ($SSallow_web_debug < 1) {$DB=0;}
##### END SETTINGS LOOKUP #####
@@ -2345,6 +2351,241 @@ else
$campaign_id = $row[3];
$uniqueidLIST .= ",'$row[18]'";
}
// BEGIN cold-storage log queries
if ( (strlen($SScoldstorage_server_ip) > 1) and (strlen($SScoldstorage_login) > 0) and (strlen($SScoldstorage_pass) > 0) )
{
$linkCS = mysqli_connect("$SScoldstorage_server_ip", "$SScoldstorage_login", "$SScoldstorage_pass", "$SScoldstorage_dbname", $SScoldstorage_port);
if (!$linkCS) {echo "MySQL Cold-Storage connect ERROR: " . mysqli_connect_error();}
##### grab vicidial_log_archive records #####
$stmt="SELECT uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log_archive where lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' order by uniqueid desc limit 500;";
$rslt=mysql_to_mysqli($stmt, $linkCS);
$logs_to_print = mysqli_num_rows($rslt);
if ($DB) {echo "$logs_to_print|$stmt\n";}
$u=0;
# $call_log = '';
# $log_campaign = '';
while ($logs_to_print > $u)
{
$row=mysqli_fetch_row($rslt);
if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor="bgcolor=\"#$SSstd_row2_background\"";}
else
{$bgcolor="bgcolor=\"#$SSstd_row1_background\"";}
$u++;
$call_log .= "<tr $bgcolor>";
$call_log .= "<td><font size=1>$u</td>";
$call_log .= "<td><font size=2><font color='#FF0000'>$row[4]</font></td>";
$call_log .= "<td align=left><font size=2> $row[7]</td>\n";
if ( ($LOGmodify_leads == '3') or ($LOGmodify_leads == '4') )
{
$call_log .= "<td align=left><font size=2><font color=blue><u><span id=\"vicidial_log_archive_status_$u\" onClick=\"ModifyLogDisplayShow(event, $u,'vicidial_log_archive','$row[0]','$row[1]','$row[4]','$row[8]','$row[11]')\">$row[8]</span></u></font></td>\n";
$HTML_inline_script .= "vicidial_log_archive_mod[$u] = \"Call Date: $row[4]<br>$label_lead_id: $row[1]<br>Current Status: $row[8]<br>\";\n";
}
else
{$call_log .= "<td align=left><font size=2> $row[8]</td>\n";}
$call_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
$call_log .= "<td align=right><font size=2> $row[3] </td>\n";
$call_log .= "<td align=right><font size=2> $row[2] </td>\n";
$call_log .= "<td align=right><font size=2> $row[1] </td>\n";
$call_log .= "<td align=center><font size=2> $row[15] </td>\n";
$call_log .= "<td align=right><font size=2>&nbsp; $row[10] </font><font size=1>$row[16] </td>\n";
if ($CIDdisplay=="Yes")
{
$caller_code='';
$stmtA="SELECT caller_code,server_ip FROM vicidial_log_extended_archive WHERE lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' and uniqueid='$row[0]';";
$rsltA=mysql_to_mysqli($stmtA, $linkCS);
$cc_to_print = mysqli_num_rows($rsltA);
if ($cc_to_print > 0)
{
$rowA=mysqli_fetch_row($rsltA);
$caller_code = $rowA[0];
$VLEserver_ip = $rowA[1];
}
$outbound_cid=''; $VDLcall_date='0';
$stmtA="SELECT outbound_cid,server_ip,call_date FROM vicidial_dial_log_archive WHERE lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' and caller_code='$caller_code' limit 1;";
$rsltA=mysql_to_mysqli($stmtA, $linkCS);
$cid_to_print = mysqli_num_rows($rsltA);
if ($cid_to_print > 0)
{
$rowA=mysqli_fetch_row($rsltA);
$outbound_cid = $rowA[0];
$outbound_cid = preg_replace("/\".*\" /",'',$outbound_cid);
$VDLserver_ip = $rowA[1];
$VDLcall_date = $rowA[2];
}
$outbound_cid_num=''; $outbound_cid_type='';
$stmtA="SELECT outbound_cid,outbound_cid_type FROM vicidial_dial_cid_log_archive WHERE call_date='$VDLcall_date' and caller_code='$caller_code' limit 1;";
$rsltA=mysql_to_mysqli($stmtA, $linkCS);
$vdl_to_print = mysqli_num_rows($rsltA);
if ($vdl_to_print > 0)
{
$rowA=mysqli_fetch_row($rsltA);
$outbound_cid_num = $rowA[0];
$outbound_cid_num = preg_replace("/\".*\" /",'',$outbound_cid_num);
$outbound_cid_type = $rowA[1];
}
if ($SSsip_event_logging > 0)
{
$call_log .= "<td align=right nowrap><font size=2>&nbsp; $outbound_cid <span onClick=\"ShowCallDetail(event,'$caller_code','$SSframe_background')\"><font color=blue><u>$caller_code</u></font></span> <font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $row[0]</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n";
}
else
{
$call_log .= "<td align=right nowrap><font size=2>&nbsp; $outbound_cid $caller_code </font><font size=1>$outbound_cid_type</td><td align=right><font size=2>&nbsp; $row[0]</td><td align=right><font size=2>&nbsp; $VDLserver_ip</td>\n";
}
}
$call_log .= "</tr>\n";
$stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' and vicidial_id='$row[0]';";
$rsltA=mysql_to_mysqli($stmtA, $link);
$out_notes_to_print = mysqli_num_rows($rslt);
if ($out_notes_to_print > 0)
{
$rowA=mysqli_fetch_row($rsltA);
if (strlen($rowA[0]) > 0)
{
$call_log .= "<TR>";
$call_log .= "<td></td>";
$call_log .= "<TD $bgcolor COLSPAN=9><font style=\"font-size:11px;font-family:sans-serif;\"> "._QXZ("NOTES").": &nbsp; $rowA[0] </font></TD>";
$call_log .= "</TR>";
}
}
$campaign_id = $row[3];
$uniqueidLIST .= ",'$row[0]'";
}
##### grab vicidial_agent_log_archive records #####
$stmt="SELECT agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log_archive where lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' order by agent_log_id desc limit 500;";
$rslt=mysql_to_mysqli($stmt, $linkCS);
$Alogs_to_print = mysqli_num_rows($rslt);
if ($DB) {echo "$Alogs_to_print|$stmt\n";}
$y=0;
# $agent_log = '';
# $Alog_campaign = '';
while ($Alogs_to_print > $y)
{
$row=mysqli_fetch_row($rslt);
if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];}
if (preg_match("/1$|3$|5$|7$|9$/i", $y))
{$bgcolor="bgcolor=\"#$SSstd_row2_background\"";}
else
{$bgcolor="bgcolor=\"#$SSstd_row1_background\"";}
$y++;
$agent_log .= "<tr $bgcolor>";
$agent_log .= "<td><font size=1>$y</td>";
$agent_log .= "<td><font size=2><font color='#FF0000'>$row[3]</font></td>";
$agent_log .= "<td align=left><font size=2> $row[5]</td>\n";
$agent_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n";
$agent_log .= "<td align=right><font size=2> $row[7]</td>\n";
$agent_log .= "<td align=right><font size=2> $row[9] </td>\n";
$agent_log .= "<td align=right><font size=2> $row[11] </td>\n";
$agent_log .= "<td align=right><font size=2> $row[13] </td>\n";
if ( ($LOGmodify_leads == '3') or ($LOGmodify_leads == '4') )
{
$agent_log .= "<td align=left><font size=2> &nbsp; <font color=blue><u><span id=\"vicidial_agent_log_archive_status_$y\" onClick=\"ModifyLogDisplayShow(event, $y,'vicidial_agent_log_archive','$row[0]','$row[4]','$row[3]','$row[14]','$row[1]')\">$row[14]</span></u></font></td>\n";
$HTML_inline_script .= "vicidial_agent_log_archive_mod[$y] = \"Event Date: $row[3]<br>$label_lead_id: $row[4]<br>Current Status: $row[14]<br>\";\n";
}
else
{$agent_log .= "<td align=left><font size=2> $row[14]</td>\n";}
$agent_log .= "<td align=right><font size=2> &nbsp; $row[15] </td>\n";
$agent_log .= "<td align=right><font size=2> &nbsp; $row[17] </td></tr>\n";
$campaign_id = $row[5];
}
##### grab vicidial_closer_log_archive records #####
$stmt="SELECT closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log_archive where lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' order by closecallid desc limit 500;";
$rslt=mysql_to_mysqli($stmt, $linkCS);
$Clogs_to_print = mysqli_num_rows($rslt);
if ($DB) {echo "$Clogs_to_print|$stmt\n";}
$y=0;
# $closer_log = '';
# $Clog_campaign = '';
while ($Clogs_to_print > $y)
{
$row=mysqli_fetch_row($rslt);
if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];}
if (preg_match("/1$|3$|5$|7$|9$/i", $y))
{$bgcolor="bgcolor=\"#$SSstd_row2_background\"";}
else
{$bgcolor="bgcolor=\"#$SSstd_row1_background\"";}
$y++;
$closer_log .= "<tr $bgcolor>";
$closer_log .= "<td><font size=1>$y</td>";
$closer_log .= "<td><font size=2><font color='#FF0000'>$row[4]</font></td>";
$closer_log .= "<td align=left><font size=2> $row[7]</td>\n";
if ( ($LOGmodify_leads == '3') or ($LOGmodify_leads == '4') )
{
$closer_log .= "<td align=left><font size=2><font color=blue><u><span id=\"vicidial_closer_log_archive_status_$y\" onClick=\"ModifyLogDisplayShow(event, $y,'vicidial_closer_log_archive','$row[0]','$row[1]','$row[4]','$row[8]','$row[11]')\">$row[8]</span></u></font></td>\n";
$HTML_inline_script .= "vicidial_closer_log_archive_mod[$y] = \"Call Date: $row[4]<br>$label_lead_id: $row[1]<br>Current Status: $row[8]<br>\";\n";
}
else
{$closer_log .= "<td align=left><font size=2> $row[8]</td>\n";}
$closer_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
$closer_log .= "<td align=right><font size=2> $row[3] </td>\n";
$closer_log .= "<td align=right><font size=2> $row[2] </td>\n";
$closer_log .= "<td align=right><font size=2> $row[1] </td>\n";
$closer_log .= "<td align=right><font size=2> &nbsp; $row[14] </td>\n";
$closer_log .= "<td align=right><font size=2> &nbsp; $row[17] </td>\n";
if ($CIDdisplay=="Yes")
{
$extension='';
$stmtA="SELECT extension,server_ip FROM vicidial_did_log_archive WHERE uniqueid='$row[18]' and call_date <= \"$row[4]\" order by call_date desc;";
$rsltA=mysql_to_mysqli($stmtA, $linkCS);
$cid_to_print = mysqli_num_rows($rsltA);
if ($cid_to_print > 0)
{
$rowA=mysqli_fetch_row($rsltA);
$extension = $rowA[0];
$VDLserver_ip = $rowA[1];
}
$caller_code='';
$stmtA="SELECT caller_code,server_ip FROM vicidial_inbound_caller_codes_archive WHERE lead_id='" . mysqli_real_escape_string($linkCS, $lead_id) . "' and uniqueid='$row[18]' and group_id='$row[3]';";
$rsltA=mysql_to_mysqli($stmtA, $linkCS);
$cc_to_print = mysqli_num_rows($rsltA);
if ($cc_to_print > 0)
{
$rowA=mysqli_fetch_row($rsltA);
$caller_code = $rowA[0];
$VLEserver_ip = $rowA[1];
}
$closer_log .= "<td align=right nowrap><font size=2>&nbsp; $caller_code</td><td align=right nowrap><font size=2>&nbsp; <a href=\"admin.php?ADD=3311&did_pattern=$extension\">$extension</a></td><td align=right><font size=2>&nbsp; $row[18]</td><td align=right><font size=2>&nbsp; $rowA[1]</td>\n";
}
$closer_log .= "</tr>\n";
$stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and vicidial_id IN('$row[0]','$row[18]');";
$rsltA=mysql_to_mysqli($stmtA, $link);
$in_notes_to_print = mysqli_num_rows($rslt);
if ($in_notes_to_print > 0)
{
$rowA=mysqli_fetch_row($rsltA);
if (strlen($rowA[0]) > 0)
{
$closer_log .= "<TR>";
$closer_log .= "<td></td>";
$closer_log .= "<TD $bgcolor COLSPAN=9><font style=\"font-size:11px;font-family:sans-serif;\"> "._QXZ("NOTES").": &nbsp; $rowA[0] </font></TD>";
$closer_log .= "</TR>";
}
}
$campaign_id = $row[3];
$uniqueidLIST .= ",'$row[18]'";
}
}
// END cold-storage log queries
}
########## END ARCHIVE LOG SEARCH ##########
@@ -1,7 +1,7 @@
<?php
# admin_search_lead.php version 2.14
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# AST GUI database administration search for lead info
# admin_modify_lead.php
@@ -55,6 +55,7 @@
# 220222-1947 - Added allow_web_debug system setting
# 220303-0124 - Fix for Issue #1353
# 220331-0926 - Small fix for $phone variable filtering
# 240704-2358 - Added cold-storage archive logs search option
#
require("dbconnect_mysqli.php");
@@ -123,7 +124,7 @@ $log_archive_link=0;
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,slave_db_server,reports_use_slave_db,enable_languages,language_method,qc_features_active,allow_web_debug FROM system_settings;";
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,slave_db_server,reports_use_slave_db,enable_languages,language_method,qc_features_active,allow_web_debug,coldstorage_server_ip,coldstorage_dbname,coldstorage_login,coldstorage_pass,coldstorage_port FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
#if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysqli_num_rows($rslt);
@@ -140,6 +141,11 @@ if ($qm_conf_ct > 0)
$SSlanguage_method = $row[7];
$SSqc_features_active = $row[8];
$SSallow_web_debug = $row[9];
$SScoldstorage_server_ip = $row[10];
$SScoldstorage_dbname = $row[11];
$SScoldstorage_login = $row[12];
$SScoldstorage_pass = $row[13];
$SScoldstorage_port = $row[14];
}
if ($SSallow_web_debug < 1) {$DB=0;}
##### END SETTINGS LOOKUP #####
@@ -730,6 +736,11 @@ else
##### BEGIN Log archive search #####
if ( (strlen($log_lead_id_archive)>0) or (strlen($log_phone_archive)>0) )
{
if ( (strlen($SScoldstorage_server_ip) > 1) and (strlen($SScoldstorage_login) > 0) and (strlen($SScoldstorage_pass) > 0) )
{
$linkCS = mysqli_connect("$SScoldstorage_server_ip", "$SScoldstorage_login", "$SScoldstorage_pass", "$SScoldstorage_dbname", $SScoldstorage_port);
if (!$linkCS) {echo "MySQL Cold-Storage connect ERROR: " . mysqli_connect_error();}
}
if (strlen($log_lead_id_archive)>0)
{
$stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log_archive where lead_id='" . mysqli_real_escape_string($link, $log_lead_id_archive) . "' $LOGallowed_listsSQL";
@@ -758,12 +769,12 @@ else
if ( ($results_to_print < 1) and ($results_to_printX < 1) )
{
echo "\n<br><br><center>\n";
echo "<b>"._QXZ("There are no outbound calls matching your search criteria")."</b><br><br>\n";
echo "<b>"._QXZ("There are no archived outbound calls matching your search criteria")."</b><br><br>\n";
echo "</center>\n";
}
else
{
echo "<BR><b>"._QXZ("OUTBOUND LOG RESULTS").": $results_to_print</b><BR>\n";
echo "<BR><b>"._QXZ("OUTBOUND ARCHIVED LOG RESULTS").": $results_to_print</b><BR>\n";
echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0 WIDTH=770>\n";
echo "<TR BGCOLOR=BLACK>\n";
echo "<TD ALIGN=LEFT VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n";
@@ -824,12 +835,12 @@ else
if ( ($results_to_print < 1) and ($results_to_printX < 1) )
{
echo "\n<br><br><center>\n";
echo "<b>"._QXZ("There are no inbound calls matching your search criteria")."</b><br><br>\n";
echo "<b>"._QXZ("There are no archived inbound calls matching your search criteria")."</b><br><br>\n";
echo "</center>\n";
}
else
{
echo "<BR><b>"._QXZ("INBOUND LOG RESULTS").": $results_to_print</b><BR>\n";
echo "<BR><b>"._QXZ("INBOUND ARCHIVED LOG RESULTS").": $results_to_print</b><BR>\n";
echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0 WIDTH=770>\n";
echo "<TR BGCOLOR=BLACK>\n";
echo "<TD ALIGN=LEFT VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n";
@@ -890,12 +901,12 @@ else
if ( ($results_to_print < 1) and ($results_to_printX < 1) )
{
echo "\n<br><br><center>\n";
echo "<b>"._QXZ("There are no inbound did calls matching your search criteria")."</b><br><br>\n";
echo "<b>"._QXZ("There are no archived inbound did calls matching your search criteria")."</b><br><br>\n";
echo "</center>\n";
}
else
{
echo "<BR><b>"._QXZ("INBOUND DID LOG RESULTS").": $results_to_print</b><BR>\n";
echo "<BR><b>"._QXZ("INBOUND DID ARCHIVED LOG RESULTS").": $results_to_print</b><BR>\n";
echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0 WIDTH=770>\n";
echo "<TR BGCOLOR=BLACK>\n";
echo "<TD ALIGN=LEFT VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n";
@@ -942,6 +953,199 @@ else
}
}
// Search through cold-storage archive logs
if ($linkCS)
{
$rslt=mysql_to_mysqli("$stmtA", $linkCS);
$results_to_print = mysqli_num_rows($rslt);
if ( ($results_to_print < 1) and ($results_to_printX < 1) )
{
echo "\n<br><br><center>\n";
echo "<b>"._QXZ("There are no cold-storage outbound calls matching your search criteria")."</b><br><br>\n";
echo "</center>\n";
}
else
{
echo "<BR><b>"._QXZ("OUTBOUND COLD-STORAGE LOG RESULTS").": $results_to_print</b><BR>\n";
echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0 WIDTH=770>\n";
echo "<TR BGCOLOR=BLACK>\n";
echo "<TD ALIGN=LEFT VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("LEAD ID")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("PHONE")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("CAMPAIGN")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("CALL DATE")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("STATUS")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("USER")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("LIST ID")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("LENGTH")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("DIAL")."</B></FONT></TD>\n";
echo "</TR>\n";
$o=0;
while ($results_to_print > $o)
{
$row=mysqli_fetch_row($rslt);
if ($LOGadmin_hide_phone_data != '0')
{
if ($DB > 0) {echo "HIDEPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";}
$phone_temp = $row[1];
if (strlen($phone_temp) > 0)
{
if ($LOGadmin_hide_phone_data == '4_DIGITS')
{$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);}
elseif ($LOGadmin_hide_phone_data == '3_DIGITS')
{$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);}
elseif ($LOGadmin_hide_phone_data == '2_DIGITS')
{$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);}
else
{$row[1] = preg_replace("/./",'X',$phone_temp);}
}
}
$o++;
$search_lead = $row[0];
if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';}
else
{$bgcolor='bgcolor="#'. $SSstd_row1_background .'"';}
echo "<TR $bgcolor>\n";
echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><A HREF=\"admin_modify_lead.php?lead_id=$row[0]&archive_search=$archive_search&archive_log=$log_archive_link\" onclick=\"javascript:window.open('admin_modify_lead.php?lead_id=$row[0]&archive_search=$archive_search&archive_log=$log_archive_link', '_blank');return false;\">$row[0]</A></FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[1]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[4]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[5]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[6]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[7]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[8]</FONT></TD>\n";
echo "</TR>\n";
}
echo "</TABLE>\n";
}
$rslt=mysql_to_mysqli("$stmtB", $linkCS);
$results_to_print = mysqli_num_rows($rslt);
if ( ($results_to_print < 1) and ($results_to_printX < 1) )
{
echo "\n<br><br><center>\n";
echo "<b>"._QXZ("There are no cold-storage inbound calls matching your search criteria")."</b><br><br>\n";
echo "</center>\n";
}
else
{
echo "<BR><b>"._QXZ("INBOUND COLD-STORAGE LOG RESULTS").": $results_to_print</b><BR>\n";
echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0 WIDTH=770>\n";
echo "<TR BGCOLOR=BLACK>\n";
echo "<TD ALIGN=LEFT VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("LEAD ID")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("PHONE")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("INGROUP")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("CALL DATE")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("STATUS")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("USER")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("LIST ID")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("LENGTH")."</B> &nbsp;</FONT></TD>\n";
echo "</TR>\n";
$o=0;
while ($results_to_print > $o)
{
$row=mysqli_fetch_row($rslt);
if ($LOGadmin_hide_phone_data != '0')
{
if ($DB > 0) {echo "HIDEPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";}
$phone_temp = $row[1];
if (strlen($phone_temp) > 0)
{
if ($LOGadmin_hide_phone_data == '4_DIGITS')
{$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);}
elseif ($LOGadmin_hide_phone_data == '3_DIGITS')
{$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);}
elseif ($LOGadmin_hide_phone_data == '2_DIGITS')
{$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);}
else
{$row[1] = preg_replace("/./",'X',$phone_temp);}
}
}
$o++;
$search_lead = $row[0];
if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';}
else
{$bgcolor='bgcolor="#'. $SSstd_row1_background .'"';}
echo "<TR $bgcolor>\n";
echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><A HREF=\"admin_modify_lead.php?lead_id=$row[0]&archive_search=$archive_search&archive_log=$log_archive_link\" onclick=\"javascript:window.open('admin_modify_lead.php?lead_id=$row[0]&archive_search=$archive_search&archive_log=$log_archive_link', '_blank');return false;\">$row[0]</A></FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[1]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[4]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[5]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[6]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[7]</FONT></TD>\n";
echo "</TR>\n";
}
echo "</TABLE>\n";
}
if (strlen($stmtC) > 10)
{
$rslt=mysql_to_mysqli("$stmtC", $linkCS);
$results_to_print = mysqli_num_rows($rslt);
if ( ($results_to_print < 1) and ($results_to_printX < 1) )
{
echo "\n<br><br><center>\n";
echo "<b>"._QXZ("There are no cold-storage inbound did calls matching your search criteria")."</b><br><br>\n";
echo "</center>\n";
}
else
{
echo "<BR><b>"._QXZ("INBOUND DID COLD-STORAGE LOG RESULTS").": $results_to_print</b><BR>\n";
echo "<TABLE BGCOLOR=WHITE CELLPADDING=1 CELLSPACING=0 WIDTH=770>\n";
echo "<TR BGCOLOR=BLACK>\n";
echo "<TD ALIGN=LEFT VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>#</B></FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("DID")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("PHONE")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("DID ID")."</B> &nbsp;</FONT></TD>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=WHITE><B>"._QXZ("CALL DATE")."</B> &nbsp;</FONT></TD>\n";
echo "</TR>\n";
$o=0;
while ($results_to_print > $o)
{
$row=mysqli_fetch_row($rslt);
if ($LOGadmin_hide_phone_data != '0')
{
if ($DB > 0) {echo "HIDEPHONEDATA|$row[1]|$LOGadmin_hide_phone_data|\n";}
$phone_temp = $row[1];
if (strlen($phone_temp) > 0)
{
if ($LOGadmin_hide_phone_data == '4_DIGITS')
{$row[1] = str_repeat("X", (strlen($phone_temp) - 4)) . substr($phone_temp,-4,4);}
elseif ($LOGadmin_hide_phone_data == '3_DIGITS')
{$row[1] = str_repeat("X", (strlen($phone_temp) - 3)) . substr($phone_temp,-3,3);}
elseif ($LOGadmin_hide_phone_data == '2_DIGITS')
{$row[1] = str_repeat("X", (strlen($phone_temp) - 2)) . substr($phone_temp,-2,2);}
else
{$row[1] = preg_replace("/./",'X',$phone_temp);}
}
}
$o++;
$search_lead = $row[0];
if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';}
else
{$bgcolor='bgcolor="#'. $SSstd_row1_background .'"';}
echo "<TR $bgcolor>\n";
echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[0]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[1]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n";
echo "</TR>\n";
}
echo "</TABLE>\n";
}
}
}
if ($db_source == 'S')
{
mysqli_close($link);
@@ -972,7 +1176,7 @@ else
exit;
}
##### END Log search #####
##### END Log archive search #####
##### BEGIN Lead search #####
@@ -1,4 +1,4 @@
# version: 20240627195501
# version: 20240704093501
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, unless the User Password Minimum Length system setting is enabled, which will require a longer password. 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>
@@ -1258,6 +1258,11 @@ settings-alt_log_dbname Alt-Log DB Name <QXZ>The database name for the Alt-Log d
settings-alt_log_login Alt-Log DB Login <QXZ>The login user for the Alt-Log database. Default is empty.</QXZ>
settings-alt_log_pass Alt-Log DB Password <QXZ>The password for the Alt-Log database. Default is empty.</QXZ>
settings-tables_use_alt_log_db Alt-Log Tables <QXZ>These are the tables that are available for logging on the alternate log database server. Default is blank.</QXZ>
settings-coldstorage_server_ip Cold-Storage DB Server <QXZ>This is the Cold-Storage log database server. This is optional, and if enabled by your systems administrator, allows some old log archives to be accessed from a separate database server. For more information on this process, read the LOG_ARCHIVING_AND_COLD_STORAGE.txt document. Default is empty.</QXZ>
settings-coldstorage_dbname Cold-Storage DB Name <QXZ>The database name for the Cold-Storage Log database. Default is empty.</QXZ>
settings-coldstorage_login Cold-Storage DB Login <QXZ>The read-only login user for the Cold-Storage Log database. Default is empty.</QXZ>
settings-coldstorage_pass Cold-Storage DB Password <QXZ>The password for the read-only login user for the Cold-Storage Log database. Default is empty.</QXZ>
settings-coldstorage_port Cold-Storage DB Password <QXZ>The connection port for the Cold-Storage Log database. Default is empty.</QXZ>
settings-enable_queuemetrics_logging Enable QueueMetrics Logging <QXZ>This setting allows you to define whether the system will insert log entries into the queue_log database table as Asterisk Queues activity does. QueueMetrics is a standalone, closed-source statistical analysis program. You must have QueueMetrics already installed and configured before enabling this feature. Default is 0.</QXZ>
settings-queuemetrics_server_ip QueueMetrics Server IP <QXZ>This is the IP address of the database for your QueueMetrics installation.</QXZ>
settings-queuemetrics_dbname QueueMetrics Database Name <QXZ>This is the database name for your QueueMetrics database.</QXZ>