From dcc9d88d52bdc7799e9603e940253ee3f77ffb1f Mon Sep 17 00:00:00 2001 From: mattf Date: Sun, 26 Oct 2025 12:39:52 +0000 Subject: [PATCH] Added crashed DB table display to admin web screens Added --vicidial-dial-log-only flag to log archive script git-svn-id: svn://192.168.202.10@3950 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 4 + bin/ADMIN_archive_log_tables.pl | 88 ++++++++++++- bin/ADMIN_keepalive_ALL.pl | 71 ++++++++++- bin/AST_table_status.pl | 191 ++++++++++++++++++++++++++++ extras/MySQL_AST_CREATE_tables.sql | 11 +- extras/upgrade_2.14.sql | 10 ++ www/vicidial/admin.php | 67 +++++++++- www/vicidial/admin_header.php | 19 ++- www/vicidial/help_documentation.txt | 3 +- 9 files changed, 448 insertions(+), 16 deletions(-) create mode 100644 bin/AST_table_status.pl diff --git a/UPGRADE b/UPGRADE index e3b25676..4df56648 100644 --- a/UPGRADE +++ b/UPGRADE @@ -890,6 +890,10 @@ OTHER CHANGES: for X seconds if any DTMF signal is detected on the call. Configurable in Campaigns, In-Groups and system-wide. +254. Added Database crashed table auto-check, with display on Admin Web screens + for level 9 users if crashed tables are found. Enabled by default, + configurable in the System Settings. + diff --git a/bin/ADMIN_archive_log_tables.pl b/bin/ADMIN_archive_log_tables.pl index 8b60414b..83c71ae0 100644 --- a/bin/ADMIN_archive_log_tables.pl +++ b/bin/ADMIN_archive_log_tables.pl @@ -75,6 +75,7 @@ # 240924-2041 - Added --vicidial-log-only # 250914-1537 - Added archiving of recording_log_stereo and recording_log_parallel tables # 251011-2048 - Added archiving of recording_live_log table +# 251024-1518 - Added --vicidial-dial-log-only flag # $CALC_TEST=0; @@ -122,6 +123,8 @@ if (length($ARGV[0])>1) print " [--api-log-days=XX] = REQUIRED FOR --api-only, number of days to archive vicidial_api_log table only past\n"; print " [--vicidial-log-only] = OPTIONAL, only archive vicidial_log table then exit\n"; print " [--vicidial-log-days=XX] = REQUIRED FOR --vicidial-log-only, number of days to archive vicidial_log table only past\n"; + print " [--vicidial-dial-log-only] = OPTIONAL, only archive vicidial_dial_log table then exit\n"; + print " [--vicidial-dial-log-days=XX] = REQUIRED FOR --vicidial-dial-log-only, number of days to archive vicidial_dial_log table only past\n"; print " [--extended-log-only] = OPTIONAL, only archive vicidial_log_extended table then exit\n"; print " [--extended-log-days=XX] = REQUIRED FOR --extended-log-only, number of days to archive vicidial_log_extended table only past\n"; print " [--api-archive-only] = OPTIONAL, only purge vicidial_api_log_archive table then exit\n"; @@ -294,7 +297,6 @@ if (length($ARGV[0])>1) if ($Q < 1) {print "\n----- VICIDIAL LOG ARCHIVE ONLY $vicidial_log_only -----\n\n";} } - if ($args =~ /--vicidial-log-days=/i) { $vicidial_log_only++; @@ -308,13 +310,31 @@ if (length($ARGV[0])>1) {print "\n----- VICIDIAL LOG ARCHIVE ACTIVE, DAYS: $extendeddays -----\n\n";} } + if ($args =~ /--vicidial-dial-log-only/i) + { + $vicidial_dial_log_only++; + if ($Q < 1) + {print "\n----- VICIDIAL DIAL LOG ARCHIVE ONLY $vicidial_dial_log_only -----\n\n";} + } + if ($args =~ /--vicidial-dial-log-days=/i) + { + $vicidial_dial_log_only++; + @data_in = split(/--vicidial-dial-log-days=/,$args); + $extendeddays = $data_in[1]; + $extendeddays =~ s/ .*$//gi; + $extendeddays =~ s/\D//gi; + if ($extendeddays > 999999) + {$extendeddays=1825;} + if ($Q < 1) + {print "\n----- VICIDIAL DIAL LOG ARCHIVE ACTIVE, DAYS: $extendeddays -----\n\n";} + } + if ($args =~ /--extended-log-only/i) { $extended_log_only++; if ($Q < 1) {print "\n----- EXTENDED LOG ARCHIVE ONLY $extended_log_only -----\n\n";} } - if ($args =~ /--extended-log-days=/i) { $extended_log_only++; @@ -334,7 +354,6 @@ if (length($ARGV[0])>1) if ($Q < 1) {print "\n----- API ARCHIVE PURGE ONLY -----\n\n";} } - if ($args =~ /--api-archive-days=/i) { $api_log_archive_purge++; @@ -354,7 +373,6 @@ if (length($ARGV[0])>1) if ($Q < 1) {print "\n----- URL LOG PURGE ONLY -----\n\n";} } - if ($args =~ /--url-log-days=/i) { $url_log_only++; @@ -505,7 +523,7 @@ if ($url_log_only > 0) if ($URLsec < 10) {$URLsec = "0$URLsec";} $URLdel_time = "$URLyear-$URLmon-$URLmday $URLhour:$URLmin:$URLsec"; } -if ( ($extended_log_only > 0) || ($vicidial_log_only > 0) ) +if ( ($extended_log_only > 0) || ($vicidial_log_only > 0) || ($vicidial_dial_log_only > 0) ) { $EXTENDEDdel_epoch = ($secX - (86400 * $extendeddays)); # X days ago ($EXTENDEDsec,$EXTENDEDmin,$EXTENDEDhour,$EXTENDEDmday,$EXTENDEDmon,$EXTENDEDyear,$EXTENDEDwday,$EXTENDEDyday,$EXTENDEDisdst) = localtime($EXTENDEDdel_epoch); @@ -2083,6 +2101,66 @@ if (!$T) ########## END --vicidial-log-only flag processing ########## + + + ########## BEGIN --vicidial-dial-log-only flag processing ########## + if ($vicidial_dial_log_only > 0) + { + ##### vicidial_dial_log + $stmtA = "SELECT count(*) from vicidial_dial_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vicidial_dial_log_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from vicidial_dial_log_archive;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vicidial_dial_log_archive_count = $aryA[0]; + } + $sthA->finish(); + + if (!$Q) {print "\nProcessing vicidial_dial_log table... ($vicidial_dial_log_count|$vicidial_dial_log_archive_count)\n";} + $stmtA = "INSERT IGNORE INTO vicidial_dial_log_archive SELECT * from vicidial_dial_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $sthArows = $sthA->rows; + if (!$Q) {print "$sthArows rows inserted into vicidial_dial_log_archive table \n";} + + $rv = $sthA->err(); + if (!$rv) + { + if ($wipe_all > 0) + {$stmtA = "DELETE FROM vicidial_dial_log;";} + else + {$stmtA = "DELETE FROM vicidial_dial_log WHERE call_date < '$EXTENDEDdel_time';";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows = $sthA->rows; + if (!$Q) {print "$sthArows rows deleted from vicidial_dial_log table \n";} + + $stmtA = "optimize table vicidial_dial_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + } + + if (!$Q) {print "\nProcessing vicidial_dial_log table finished: ($sthArows rows deleted) \n";} + + exit; + } + ########## END --vicidial-dial-log-only flag processing ########## + + if ($queue_log > 0) { ############################################# diff --git a/bin/ADMIN_keepalive_ALL.pl b/bin/ADMIN_keepalive_ALL.pl index b97a8b3e..6bb8d324 100644 --- a/bin/ADMIN_keepalive_ALL.pl +++ b/bin/ADMIN_keepalive_ALL.pl @@ -177,9 +177,10 @@ # 250924-2212 - Added code for deprecation of "Monitor" application after Asterisk 20 # 251006-0832 - Added truncating of vicidial_dtmf_log older than 24 hours & If recording_dtmf_muting enabled, force use of MixMonitor for recording # 251011-1000 - Added archiving of recording_dtmf_muting_log, disabled purging of recording_live_log after 7 days +# 251024-2222 - Added crashed table detection # -$build = '251011-1000'; +$build = '251024-2222'; $DB=0; # Debug flag $teodDB=0; # flag to log Timeclock End of Day processes to log file @@ -502,7 +503,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA ##### Get the settings from system_settings ##### -$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports,enable_drop_lists,expired_lists_inactive,sip_event_logging,call_quota_lead_ranking,inbound_answer_config,log_latency_gaps,demographic_quotas,weekday_resets,highest_lead_id,hopper_hold_inserts,stereo_recording,stereo_parallel_recording,recording_dtmf_muting FROM system_settings;"; +$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports,enable_drop_lists,expired_lists_inactive,sip_event_logging,call_quota_lead_ranking,inbound_answer_config,log_latency_gaps,demographic_quotas,weekday_resets,highest_lead_id,hopper_hold_inserts,stereo_recording,stereo_parallel_recording,recording_dtmf_muting,db_crashed_tables_check FROM system_settings;"; # print "$stmtA\n"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -537,6 +538,7 @@ if ($sthArows > 0) $SSstereo_recording = $aryA[24]; $SSstereo_parallel_recording = $aryA[25]; $SSrecording_dtmf_muting = $aryA[26]; + $SSdb_crashed_tables_check = $aryA[27]; } $sthA->finish(); if ($DBXXX > 0) {print "SYSTEM SETTINGS: $sounds_central_control_active|$active_voicemail_server|$SScustom_dialplan_entry|$SSdefault_codecs\n";} @@ -604,6 +606,7 @@ else $runningASTERISK=0; $runningsip_logger=0; $runningconf_updater=0; + $runningcrash_test=0; $AST_conf_3way=0; $AST_rec_monitor=0; @@ -780,6 +783,11 @@ else $runningAST_rec_monitor++; if ($DB) {print "AST_rec_monitor RUNNING: |$psline[1]|\n";} } + if ($psline[1] =~ /$REGhome\/AST_table_status\.pl/) + { + $runningcrash_test++; + if ($DB) {print "AST_table_status RUNNING: |$psline[1]|\n";} + } $i++; } @@ -953,6 +961,11 @@ else $runningAST_rec_monitor++; if ($DB) {print "AST_rec_monitor RUNNING: |$psline[1]|\n";} } + if ($psline[1] =~ /$REGhome\/AST_table_status\.pl/) + { + $runningcrash_test++; + if ($DB) {print "AST_table_status RUNNING: |$psline[1]|\n";} + } $i++; } @@ -1522,6 +1535,15 @@ if ($timeclock_end_of_day_NOW > 0) if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} $sthA->finish(); + $stmtA = "optimize table crashed_tables;"; + 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(); + if ($agents_calls_reset > 0) { $stmtA = "delete from vicidial_live_inbound_agents where last_call_finish < \"$TDSQLdate\";"; @@ -2318,7 +2340,7 @@ if ($timeclock_end_of_day_NOW > 0) ##### BEGIN vicidial_dtmf_log end of day process removing records older than 24 hours ##### - $stmtA = "DELETE from vicidial_dtmf_log where vicidial_dtmf_log < \"$RMSQLdate\";"; + $stmtA = "DELETE from vicidial_dtmf_log where dtmf_time < \"$RMSQLdate\";"; if($DBX){print STDERR "\n|$stmtA|\n";} $affected_rows = $dbhA->do($stmtA); if($DB){print STDERR "\n|$affected_rows vicidial_dtmf_log records older than 1 day purged|\n";} @@ -6812,6 +6834,49 @@ if ($AST_VDadapt > 0) +################################################################################ +##### BEGIN check for crashed tables +################################################################################ +if ( ($THISserver_voicemail > 0) && ($SSdb_crashed_tables_check > 0) ) + { + if ($DB) {print "Begin check for crashed table... |db_crashed_tables_check setting: $SSdb_crashed_tables_check| \n";} + + if ($runningcrash_test > 0) + { + if ($DB) {print "Previous crash test already running, do not start another one.\n";} + } + else + { + $start_crash_check_now=0; + if ($SSdb_crashed_tables_check >= 4) + {$start_crash_check_now++;} + if ( ($SSdb_crashed_tables_check >= 3) && ($reset_test =~ /0$/) ) + {$start_crash_check_now++;} + if ( ($SSdb_crashed_tables_check >= 2) && ($reset_test =~ /00$/) ) + {$start_crash_check_now++;} + if ( ($SSdb_crashed_tables_check >= 1) && ($timeclock_end_of_day_NOW > 0) ) + {$start_crash_check_now++;} + + if ($start_crash_check_now > 0) + { + if ($DB) {print "starting AST_table_status... |$start_crash_check_now| \n";} + # add a '-L' to the command below to activate logging + `/usr/bin/screen -d -m -S ASTcrash $PATHhome/AST_table_status.pl --debugX`; + if ($megaDB) + { + `/usr/bin/screen -S ASTcrash -X logfile $PATHlogs/ASTcrash-screenlog.0`; + `/usr/bin/screen -S ASTcrash -X log`; + } + } + } + } +################################################################################ +##### END check for crashed tables +################################################################################ + + + + if ($DB) {print "DONE\n";} diff --git a/bin/AST_table_status.pl b/bin/AST_table_status.pl new file mode 100644 index 00000000..b1ddc35d --- /dev/null +++ b/bin/AST_table_status.pl @@ -0,0 +1,191 @@ +#!/usr/bin/perl +# +# AST_table_status.pl version 2.12 +# +# DESCRIPTION: +# - gathers MySQL "SHOW TABLE STATUS" info to check for crashed tables +# +# +# Copyright (C) 2025 Matt Florell LICENSE: AGPLv2 +# +# CHANGES +# 251025-1618 - First build +# + +### begin parsing run-time options ### +if (length($ARGV[0])>1) + { + $i=0; + while ($#ARGV >= $i) + { + $args = "$args $ARGV[$i]"; + $i++; + } + + if ($args =~ /--help/i) + { + print "allowed run time options:\n"; + print " [-q] = quiet\n"; + print " [-t] = test\n"; + print " [--debug] = debugging messages\n"; + print " [--debugX] = Extra debugging messages\n"; + print "\n"; + + exit; + } + else + { + if ($args =~ /-q/i) + { + $q=1; $Q=1; + } + if ($args =~ /--debug/i) + { + $DB=1; + print "\n----- DEBUGGING -----\n\n"; + } + if ($args =~ /--debugX/i) + { + $DBX=1; + print "\n----- EXTRA DEBUGGING -----\n\n"; + } + if ($args =~ /-t|--test/i) + { + $T=1; $TEST=1; + print "\n----- TESTING -----\n\n"; + } + } + } +else + { + print "no command line options set Exiting...\n"; + } +### end parsing run-time options ### + +$secX = time(); +($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +$year = ($year + 1900); +$yy = $year; $yy =~ s/^..//gi; +$mon++; +if ($mon < 10) {$mon = "0$mon";} +if ($mday < 10) {$mday = "0$mday";} +if ($hour < 10) {$hour = "0$hour";} +if ($min < 10) {$min = "0$min";} +if ($sec < 10) {$sec = "0$sec";} +$now_date="$year-$mon-$mday $hour:$min:$sec"; + +if (!$Q) {print "NOW DATETIME: $now_date \n";} + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = ; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) + {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) + {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} + if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) + {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + +if (!$VARDB_port) {$VARDB_port='3306';} + +use DBI; + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + +if ($DB) {print "Begin check for crashed table...\n";} +# gather crashed table records +$stmtA = "SHOW TABLE STATUS WHERE Comment LIKE \"%crash%\";"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArowsCRASH=$sthA->rows; +$i=0; +while ($sthArowsCRASH > $i) + { + @aryA = $sthA->fetchrow_array; + $CRASHEDtables[$i] = $aryA[0]; + + if($DBX){print STDERR "\nCRASHED TABLE: |$i|$CRASHEDtables[$i]| \n";} + + $i++; + } +$sthA->finish(); + +if ($i > 0) + { + $keep_tables="''"; + $i=0; + while ($sthArowsCRASH > $i) + { + $keep_tables .= ",'$CRASHEDtables[$i]'"; + $stmtA = "INSERT INTO crashed_tables SET table_name='$CRASHEDtables[$i]',crashed_datetime='$now_date',last_check_datetime='$now_date' ON DUPLICATE KEY UPDATE last_check_datetime='$now_date';"; + $Iaffected_rows = $dbhA->do($stmtA); + if ($DB) {print "Crashed table update: |$Iaffected_rows|$stmtA";} + $i++; + } + $stmtA = "DELETE FROM crashed_tables where table_name NOT IN($keep_tables);"; + $Iaffected_rows = $dbhA->do($stmtA); + if ($DB) {print "Crashed table old entries cleared: |$Iaffected_rows|$stmtA";} + } +else + { + if($DBX){print STDERR "\nNO CRASHED TABLES FOUND.\n";} + $CRASHEDtable_ct=0; + # gather crashed table records count + $stmtA = "SELECT count(*) FROM crashed_tables;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArowsCRASHct=$sthA->rows; + if ($sthArowsCRASHct > 0) + { + @aryA = $sthA->fetchrow_array; + $CRASHEDtable_ct = $aryA[0]; + } + $sthA->finish(); + + if ($CRASHEDtable_ct > 0) + { + $stmtA = "DELETE FROM crashed_tables;"; + $Iaffected_rows = $dbhA->do($stmtA); + if ($DB) {print "Crashed table cleared: |$Iaffected_rows|$stmtA";} + } + } + + +$dbhA->disconnect(); + +if (!$Q) {print "Script exiting\n";} + +exit; diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index e01bf07a..1629139b 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -2074,7 +2074,8 @@ agent_man_dial_filter VARCHAR(20) default '', agent_3way_dial_filter VARCHAR(20) default '', recording_dtmf_detection TINYINT(3) UNSIGNED default '0', recording_dtmf_muting TINYINT(3) UNSIGNED default '0', -stereo_parallel_recording ENUM('0','1','2','3','4','5','6') default '0' +stereo_parallel_recording ENUM('0','1','2','3','4','5','6') default '0', +db_crashed_tables_check ENUM('0','1','2','3','4','5','6') default '1' ) ENGINE=MyISAM; CREATE TABLE vicidial_campaigns_list_mix ( @@ -5449,6 +5450,12 @@ index(recording_id), index(dtmf_muting_end_time) ) ENGINE=MyISAM; +CREATE TABLE crashed_tables ( +table_name VARCHAR(100) PRIMARY KEY NOT NULL, +crashed_datetime DATETIME, +last_check_datetime DATETIME +) ENGINE=MyISAM; + ALTER TABLE vicidial_email_list MODIFY message text character set utf8; @@ -5867,4 +5874,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='1732',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1733',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/extras/upgrade_2.14.sql b/extras/upgrade_2.14.sql index 2a24e177..9247a88b 100644 --- a/extras/upgrade_2.14.sql +++ b/extras/upgrade_2.14.sql @@ -3030,3 +3030,13 @@ CREATE INDEX rllst on recording_live_log(start_time); CREATE TABLE recording_live_log_archive LIKE recording_live_log; UPDATE system_settings SET db_schema_version='1732',db_schema_update_date=NOW() where db_schema_version < 1732; + +CREATE TABLE crashed_tables ( +table_name VARCHAR(100) PRIMARY KEY NOT NULL, +crashed_datetime DATETIME, +last_check_datetime DATETIME +) ENGINE=MyISAM; + +ALTER TABLE system_settings ADD db_crashed_tables_check ENUM('0','1','2','3','4','5','6') default '1'; + +UPDATE system_settings SET db_schema_version='1733',db_schema_update_date=NOW() where db_schema_version < 1733; diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 398d131c..c5c6c039 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -2870,6 +2870,8 @@ if (isset($_GET["parallel_rec_fr_filename"])) {$parallel_rec_fr_filename=$_GET elseif (isset($_POST["parallel_rec_fr_filename"])) {$parallel_rec_fr_filename=$_POST["parallel_rec_fr_filename"];} if (isset($_GET["call_count_limit_restrict"])) {$call_count_limit_restrict=$_GET["call_count_limit_restrict"];} elseif (isset($_POST["call_count_limit_restrict"])) {$call_count_limit_restrict=$_POST["call_count_limit_restrict"];} +if (isset($_GET["db_crashed_tables_check"])) {$db_crashed_tables_check=$_GET["db_crashed_tables_check"];} + elseif (isset($_POST["db_crashed_tables_check"])) {$db_crashed_tables_check=$_POST["db_crashed_tables_check"];} $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); @@ -3416,6 +3418,7 @@ $enhanced_agent_monitoring = preg_replace('/[^0-9]/','',$enhanced_agent_monitori $agent_hide_dial_fail = preg_replace('/[^0-9]/','',$agent_hide_dial_fail); $recording_dtmf_detection = preg_replace('/[^0-9]/','',$recording_dtmf_detection); $recording_dtmf_muting = preg_replace('/[^0-9]/','',$recording_dtmf_muting); +$db_crashed_tables_check = preg_replace('/[^0-9]/','',$db_crashed_tables_check); $user_new_lead_limit = preg_replace('/[^-0-9]/','',$user_new_lead_limit); $drop_call_seconds = preg_replace('/[^-0-9]/','',$drop_call_seconds); @@ -6291,12 +6294,13 @@ if ($SSscript_remove_js > 0) # 250922-0841 - Added Talk Seconds URL links to multi-url admin page in campaigns and in-groups # 251002-1428 - Added call_count_limit_restrict campaign setting # 251019-2024 - Added Recording DTMF Muting +# 251025-1924 - Added CRASHED DATABASE TABLES display page, db_crashed_tables_check system settings option # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-946a'; -$build = '251019-2024'; +$admin_version = '2.14-947a'; +$build = '251025-1924'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -7372,6 +7376,7 @@ if ($ADD==999988) {$hh='reports'; echo _QXZ("AVAILABLE TIMEZONES");} if ($ADD==999987) {$hh='reports'; echo _QXZ("PHONE CODES");} if ($ADD==999986) {$hh='reports'; echo _QXZ("POSTAL CODES");} if ($ADD==999985) {$hh='reports'; echo _QXZ("POSTAL CODES CITIES");} +if ($ADD==999984) {$hh='reports'; echo _QXZ("CRASHED DATABASE TABLES");} echo "\n"; @@ -21413,7 +21418,7 @@ if ($ADD==411111111111111) $update_apinewlead_rows=mysqli_affected_rows($link); # update the system settings - $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='" . mysqli_real_escape_string($link, $queuemetrics_url) . "',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='" . mysqli_real_escape_string($link, $admin_home_url) . "',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='" . mysqli_real_escape_string($link, $vtiger_url) . "',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysqli_real_escape_string($link, $webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',label_lead_id='$label_lead_id',label_list_id='$label_list_id',label_entry_date='$label_entry_date',label_gmt_offset_now='$label_gmt_offset_now',label_source_id='$label_source_id',label_called_since_last_reset='$label_called_since_last_reset',label_status='$label_status',label_user='$label_user',label_date_of_birth='$label_date_of_birth',label_country_code='$label_country_code',label_last_local_call_time='$label_last_local_call_time',label_called_count='$label_called_count',label_rank='$label_rank',label_owner='$label_owner',label_entry_list_id='$label_entry_list_id',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db'$custom_reports_slave_SQL,webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add',queuemetrics_record_hold='$queuemetrics_record_hold',country_code_list_stats='$country_code_list_stats',queuemetrics_pause_type='$queuemetrics_pause_type',frozen_server_call_clear='$frozen_server_call_clear',callback_time_24hour='$callback_time_24hour',enable_languages='$enable_languages',language_method='$language_method',meetme_enter_login_filename='$meetme_enter_login_filename',meetme_enter_leave3way_filename='$meetme_enter_leave3way_filename',enable_did_entry_list_id='$enable_did_entry_list_id',enable_third_webform='$enable_third_webform',allow_chats='$allow_chats',chat_url='" . mysqli_real_escape_string($link, $chat_url) . "',chat_timeout='$chat_timeout',agent_debug_logging='$agent_debug_logging',default_language='$default_language',agent_whisper_enabled='$agent_whisper_enabled',user_hide_realtime_enabled='$user_hide_realtime_enabled',usacan_phone_dialcode_fix='$usacan_phone_dialcode_fix',cache_carrier_stats_realtime='$cache_carrier_stats_realtime',log_recording_access='$log_recording_access',report_default_format='$report_default_format',alt_ivr_logging='$alt_ivr_logging',default_phone_code='$default_phone_code',admin_row_click='$admin_row_click',admin_screen_colors='$admin_screen_colors',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',agent_screen_colors='$agent_screen_colors',script_remove_js='$script_remove_js',manual_auto_next='$manual_auto_next',user_new_lead_limit='$user_new_lead_limit',agent_xfer_park_3way='$agent_xfer_park_3way',agent_soundboards='$agent_soundboards',web_loader_phone_length='$web_loader_phone_length',agent_script='$agent_script',agent_chat_screen_colors='$agent_chat_screen_colors',enable_auto_reports='$enable_auto_reports',enable_pause_code_limits='$enable_pause_code_limits',enable_drop_lists='$enable_drop_lists',allow_ip_lists='$allow_ip_lists',system_ip_blacklist='$system_ip_blacklist',agent_push_events='$agent_push_events',agent_push_url='$agent_push_url',hide_inactive_lists='$hide_inactive_lists',allow_manage_active_lists='$allow_manage_active_lists',expired_lists_inactive='$expired_lists_inactive',did_system_filter='$did_system_filter',anyone_callback_inactive_lists='$anyone_callback_inactive_lists',enable_gdpr_download_deletion='$enable_gdpr_download_deletion',source_id_display='$source_id_display',agent_logout_link='$agent_logout_link',manual_dial_validation='$manual_dial_validation',mute_recordings='$mute_recordings',user_admin_redirect='$user_admin_redirect',list_status_modification_confirmation='$list_status_modification_confirmation',sip_event_logging='$sip_event_logging',call_quota_lead_ranking='$call_quota_lead_ranking',enable_second_script='$enable_second_script',enable_first_webform='$enable_first_webform',recording_buttons='$recording_buttons',opensips_cid_name='$opensips_cid_name',require_password_length='$require_password_length',user_account_emails='$user_account_emails',outbound_cid_any='$outbound_cid_any',entries_per_page='$entries_per_page',browser_call_alerts='$browser_call_alerts',queuemetrics_pausereason='$queuemetrics_pausereason',inbound_answer_config='$inbound_answer_config',enable_international_dncs='$enable_international_dncs',web_loader_phone_strip='$web_loader_phone_strip',manual_dial_phone_strip='$manual_dial_phone_strip',daily_call_count_limit='$daily_call_count_limit',allow_shared_dial='$allow_shared_dial',agent_search_method='$agent_search_method',phone_defaults_container='$phone_defaults_container',qc_claim_limit='$qc_claim_limit',qc_expire_days='$qc_expire_days',two_factor_auth_hours='$two_factor_auth_hours',two_factor_container='$two_factor_container',agent_hidden_sound='$agent_hidden_sound',agent_hidden_sound_volume='$agent_hidden_sound_volume',agent_hidden_sound_seconds='$agent_hidden_sound_seconds',agent_screen_timer='$agent_screen_timer',call_limit_24hour='$call_limit_24hour',allowed_sip_stacks='$allowed_sip_stacks',agent_hide_hangup='$agent_hide_hangup',allow_web_debug='$allow_web_debug',max_logged_in_agents='$max_logged_in_agents',user_codes_admin='$user_codes_admin',login_kickall='$login_kickall',abandon_check_queue='$abandon_check_queue',agent_notifications='$agent_notifications',demographic_quotas='$demographic_quotas',log_latency_gaps='$log_latency_gaps',inbound_credits='$inbound_credits',weekday_resets='$weekday_resets',two_factor_auth_agent_hours='$two_factor_auth_agent_hours',hopper_hold_inserts='$hopper_hold_inserts',coldstorage_server_ip='$coldstorage_server_ip',coldstorage_dbname='$coldstorage_dbname',coldstorage_login='$coldstorage_login',coldstorage_pass='$coldstorage_pass',coldstorage_port='$coldstorage_port',enhanced_agent_monitoring='$enhanced_agent_monitoring',agent_hide_dial_fail='$agent_hide_dial_fail',agent_man_dial_filter='$agent_man_dial_filter',agent_3way_dial_filter='$agent_3way_dial_filter',stereo_recording='$stereo_recording',recording_dtmf_detection='$recording_dtmf_detection',recording_dtmf_muting='$recording_dtmf_muting',stereo_parallel_recording='$stereo_parallel_recording'$custom_dialplanSQL;"; + $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='" . mysqli_real_escape_string($link, $queuemetrics_url) . "',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='" . mysqli_real_escape_string($link, $admin_home_url) . "',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='" . mysqli_real_escape_string($link, $vtiger_url) . "',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysqli_real_escape_string($link, $webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',label_lead_id='$label_lead_id',label_list_id='$label_list_id',label_entry_date='$label_entry_date',label_gmt_offset_now='$label_gmt_offset_now',label_source_id='$label_source_id',label_called_since_last_reset='$label_called_since_last_reset',label_status='$label_status',label_user='$label_user',label_date_of_birth='$label_date_of_birth',label_country_code='$label_country_code',label_last_local_call_time='$label_last_local_call_time',label_called_count='$label_called_count',label_rank='$label_rank',label_owner='$label_owner',label_entry_list_id='$label_entry_list_id',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db'$custom_reports_slave_SQL,webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add',queuemetrics_record_hold='$queuemetrics_record_hold',country_code_list_stats='$country_code_list_stats',queuemetrics_pause_type='$queuemetrics_pause_type',frozen_server_call_clear='$frozen_server_call_clear',callback_time_24hour='$callback_time_24hour',enable_languages='$enable_languages',language_method='$language_method',meetme_enter_login_filename='$meetme_enter_login_filename',meetme_enter_leave3way_filename='$meetme_enter_leave3way_filename',enable_did_entry_list_id='$enable_did_entry_list_id',enable_third_webform='$enable_third_webform',allow_chats='$allow_chats',chat_url='" . mysqli_real_escape_string($link, $chat_url) . "',chat_timeout='$chat_timeout',agent_debug_logging='$agent_debug_logging',default_language='$default_language',agent_whisper_enabled='$agent_whisper_enabled',user_hide_realtime_enabled='$user_hide_realtime_enabled',usacan_phone_dialcode_fix='$usacan_phone_dialcode_fix',cache_carrier_stats_realtime='$cache_carrier_stats_realtime',log_recording_access='$log_recording_access',report_default_format='$report_default_format',alt_ivr_logging='$alt_ivr_logging',default_phone_code='$default_phone_code',admin_row_click='$admin_row_click',admin_screen_colors='$admin_screen_colors',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',agent_screen_colors='$agent_screen_colors',script_remove_js='$script_remove_js',manual_auto_next='$manual_auto_next',user_new_lead_limit='$user_new_lead_limit',agent_xfer_park_3way='$agent_xfer_park_3way',agent_soundboards='$agent_soundboards',web_loader_phone_length='$web_loader_phone_length',agent_script='$agent_script',agent_chat_screen_colors='$agent_chat_screen_colors',enable_auto_reports='$enable_auto_reports',enable_pause_code_limits='$enable_pause_code_limits',enable_drop_lists='$enable_drop_lists',allow_ip_lists='$allow_ip_lists',system_ip_blacklist='$system_ip_blacklist',agent_push_events='$agent_push_events',agent_push_url='$agent_push_url',hide_inactive_lists='$hide_inactive_lists',allow_manage_active_lists='$allow_manage_active_lists',expired_lists_inactive='$expired_lists_inactive',did_system_filter='$did_system_filter',anyone_callback_inactive_lists='$anyone_callback_inactive_lists',enable_gdpr_download_deletion='$enable_gdpr_download_deletion',source_id_display='$source_id_display',agent_logout_link='$agent_logout_link',manual_dial_validation='$manual_dial_validation',mute_recordings='$mute_recordings',user_admin_redirect='$user_admin_redirect',list_status_modification_confirmation='$list_status_modification_confirmation',sip_event_logging='$sip_event_logging',call_quota_lead_ranking='$call_quota_lead_ranking',enable_second_script='$enable_second_script',enable_first_webform='$enable_first_webform',recording_buttons='$recording_buttons',opensips_cid_name='$opensips_cid_name',require_password_length='$require_password_length',user_account_emails='$user_account_emails',outbound_cid_any='$outbound_cid_any',entries_per_page='$entries_per_page',browser_call_alerts='$browser_call_alerts',queuemetrics_pausereason='$queuemetrics_pausereason',inbound_answer_config='$inbound_answer_config',enable_international_dncs='$enable_international_dncs',web_loader_phone_strip='$web_loader_phone_strip',manual_dial_phone_strip='$manual_dial_phone_strip',daily_call_count_limit='$daily_call_count_limit',allow_shared_dial='$allow_shared_dial',agent_search_method='$agent_search_method',phone_defaults_container='$phone_defaults_container',qc_claim_limit='$qc_claim_limit',qc_expire_days='$qc_expire_days',two_factor_auth_hours='$two_factor_auth_hours',two_factor_container='$two_factor_container',agent_hidden_sound='$agent_hidden_sound',agent_hidden_sound_volume='$agent_hidden_sound_volume',agent_hidden_sound_seconds='$agent_hidden_sound_seconds',agent_screen_timer='$agent_screen_timer',call_limit_24hour='$call_limit_24hour',allowed_sip_stacks='$allowed_sip_stacks',agent_hide_hangup='$agent_hide_hangup',allow_web_debug='$allow_web_debug',max_logged_in_agents='$max_logged_in_agents',user_codes_admin='$user_codes_admin',login_kickall='$login_kickall',abandon_check_queue='$abandon_check_queue',agent_notifications='$agent_notifications',demographic_quotas='$demographic_quotas',log_latency_gaps='$log_latency_gaps',inbound_credits='$inbound_credits',weekday_resets='$weekday_resets',two_factor_auth_agent_hours='$two_factor_auth_agent_hours',hopper_hold_inserts='$hopper_hold_inserts',coldstorage_server_ip='$coldstorage_server_ip',coldstorage_dbname='$coldstorage_dbname',coldstorage_login='$coldstorage_login',coldstorage_pass='$coldstorage_pass',coldstorage_port='$coldstorage_port',enhanced_agent_monitoring='$enhanced_agent_monitoring',agent_hide_dial_fail='$agent_hide_dial_fail',agent_man_dial_filter='$agent_man_dial_filter',agent_3way_dial_filter='$agent_3way_dial_filter',stereo_recording='$stereo_recording',recording_dtmf_detection='$recording_dtmf_detection',recording_dtmf_muting='$recording_dtmf_muting',stereo_parallel_recording='$stereo_parallel_recording',db_crashed_tables_check='$db_crashed_tables_check'$custom_dialplanSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $update_main_rows=mysqli_affected_rows($link); if ($DB) {echo "$update_main_rows|$stmt|\n";} @@ -44478,7 +44483,7 @@ if ($ADD==311111111111111) $ALLagent_count = $rowx[2]; } - $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial,queuemetrics_record_hold,country_code_list_stats,reload_timestamp,queuemetrics_pause_type,frozen_server_call_clear,callback_time_24hour,allow_chats,chat_url,chat_timeout,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,agent_debug_logging,default_language,agent_whisper_enabled,user_hide_realtime_enabled,usacan_phone_dialcode_fix,cache_carrier_stats_realtime,oldest_logs_date,log_recording_access,report_default_format,alt_ivr_logging,default_phone_code,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,rec_prompt_count,agent_soundboards,web_loader_phone_length,agent_script,agent_chat_screen_colors,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist,agent_push_events,agent_push_url,hide_inactive_lists,allow_manage_active_lists,expired_lists_inactive,did_system_filter,anyone_callback_inactive_lists,enable_gdpr_download_deletion,source_id_display,agent_logout_link,manual_dial_validation,mute_recordings,user_admin_redirect,list_status_modification_confirmation,sip_event_logging,call_quota_lead_ranking,enable_second_script,enable_first_webform,recording_buttons,opensips_cid_name,require_password_length,user_account_emails,outbound_cid_any,entries_per_page,browser_call_alerts,queuemetrics_pausereason,inbound_answer_config,enable_international_dncs,web_loader_phone_strip,manual_dial_phone_strip,daily_call_count_limit,allow_shared_dial,agent_search_method,phone_defaults_container,qc_claim_limit,qc_expire_days,two_factor_auth_hours,two_factor_container,agent_hidden_sound,agent_hidden_sound_volume,agent_hidden_sound_seconds,agent_screen_timer,label_lead_id,label_list_id,label_entry_date,label_gmt_offset_now,label_source_id,label_called_since_last_reset,label_status,label_user,label_date_of_birth,label_country_code,label_last_local_call_time,label_called_count,label_rank,label_owner,label_entry_list_id,call_limit_24hour,allowed_sip_stacks,agent_hide_hangup,allow_web_debug,max_logged_in_agents,user_codes_admin,login_kickall,abandon_check_queue,agent_notifications,demographic_quotas,log_latency_gaps,inbound_credits,weekday_resets,two_factor_auth_agent_hours,highest_lead_id,hopper_hold_inserts,coldstorage_server_ip,coldstorage_dbname,coldstorage_login,coldstorage_pass,coldstorage_port,enhanced_agent_monitoring,agent_hide_dial_fail,agent_man_dial_filter,agent_3way_dial_filter,stereo_recording,recording_dtmf_detection,recording_dtmf_muting,stereo_parallel_recording from system_settings;"; + $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial,queuemetrics_record_hold,country_code_list_stats,reload_timestamp,queuemetrics_pause_type,frozen_server_call_clear,callback_time_24hour,allow_chats,chat_url,chat_timeout,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,agent_debug_logging,default_language,agent_whisper_enabled,user_hide_realtime_enabled,usacan_phone_dialcode_fix,cache_carrier_stats_realtime,oldest_logs_date,log_recording_access,report_default_format,alt_ivr_logging,default_phone_code,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,rec_prompt_count,agent_soundboards,web_loader_phone_length,agent_script,agent_chat_screen_colors,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist,agent_push_events,agent_push_url,hide_inactive_lists,allow_manage_active_lists,expired_lists_inactive,did_system_filter,anyone_callback_inactive_lists,enable_gdpr_download_deletion,source_id_display,agent_logout_link,manual_dial_validation,mute_recordings,user_admin_redirect,list_status_modification_confirmation,sip_event_logging,call_quota_lead_ranking,enable_second_script,enable_first_webform,recording_buttons,opensips_cid_name,require_password_length,user_account_emails,outbound_cid_any,entries_per_page,browser_call_alerts,queuemetrics_pausereason,inbound_answer_config,enable_international_dncs,web_loader_phone_strip,manual_dial_phone_strip,daily_call_count_limit,allow_shared_dial,agent_search_method,phone_defaults_container,qc_claim_limit,qc_expire_days,two_factor_auth_hours,two_factor_container,agent_hidden_sound,agent_hidden_sound_volume,agent_hidden_sound_seconds,agent_screen_timer,label_lead_id,label_list_id,label_entry_date,label_gmt_offset_now,label_source_id,label_called_since_last_reset,label_status,label_user,label_date_of_birth,label_country_code,label_last_local_call_time,label_called_count,label_rank,label_owner,label_entry_list_id,call_limit_24hour,allowed_sip_stacks,agent_hide_hangup,allow_web_debug,max_logged_in_agents,user_codes_admin,login_kickall,abandon_check_queue,agent_notifications,demographic_quotas,log_latency_gaps,inbound_credits,weekday_resets,two_factor_auth_agent_hours,highest_lead_id,hopper_hold_inserts,coldstorage_server_ip,coldstorage_dbname,coldstorage_login,coldstorage_pass,coldstorage_port,enhanced_agent_monitoring,agent_hide_dial_fail,agent_man_dial_filter,agent_3way_dial_filter,stereo_recording,recording_dtmf_detection,recording_dtmf_muting,stereo_parallel_recording,db_crashed_tables_check from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $version = $row[0]; @@ -44729,6 +44734,7 @@ if ($ADD==311111111111111) $recording_dtmf_detection = $row[245]; $recording_dtmf_muting = $row[246]; $stereo_parallel_recording = $row[247]; + $db_crashed_tables_check = $row[248]; if ($pass_hash_enabled > 0) {$pass_hash_enabled = 'ENABLED';} else {$pass_hash_enabled = 'DISABLED';} @@ -44797,6 +44803,7 @@ if ($ADD==311111111111111) echo "\n"; echo "$NWB#settings-agent_disable$NWE\n"; echo ""._QXZ("Clear Frozen Calls").": $NWB#settings-frozen_server_call_clear$NWE\n"; + echo ""._QXZ("Auto Check DB Crashed Tables").": $NWB#settings-db_crashed_tables_check$NWE\n"; echo ""._QXZ("Allowed SIP Stacks").":