fix for server_updater table for AST_update.pl
addition of db_schema_version and display in admin.php git-svn-id: svn://192.168.202.10@776 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
+26
-3
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# AST_update.pl version 14 *DBI-version*
|
||||
# AST_update.pl version 2.0.5 *DBI-version*
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# uses the Asterisk Manager interface and Net::MySQL to update the live_channels
|
||||
@@ -30,7 +30,7 @@
|
||||
#
|
||||
# It is recommended that you run this program on the local Asterisk machine
|
||||
#
|
||||
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
#
|
||||
# version changes:
|
||||
# 41228-1659 - modified to compensate for manager output response hiccups
|
||||
@@ -55,9 +55,10 @@
|
||||
# 60926-1601 - validate proper binutil locations for performance gathering
|
||||
# 61130-1008 - defaults show_channels_format to 1 for non 1.0 version Asterisk
|
||||
# 61227-1659 - added "core show channels concise" for Asterisk 1.4 compatibility
|
||||
# 80111-1850 - fixed server_updater record missing bug
|
||||
#
|
||||
|
||||
$build = '61227-1659';
|
||||
$build = '80111-1850';
|
||||
|
||||
# constants
|
||||
$SYSPERF=0; # system performance logging to MySQL server_performance table every 5 seconds
|
||||
@@ -146,6 +147,7 @@ if (length($ARGV[0])>1)
|
||||
}
|
||||
if ($args =~ /--debugX/i)
|
||||
{
|
||||
$DB=1;
|
||||
$DBX=1;
|
||||
print "\n----- SUPER-DUPER DEBUGGING -----\nBUILD: $build\n";
|
||||
}
|
||||
@@ -269,6 +271,27 @@ $sthA->finish();
|
||||
if ($AST_ver =~ /^1\.4/i) {$show_channels_format = 2;}
|
||||
print STDERR "SHOW CHANNELS format: $show_channels_format\n";
|
||||
|
||||
|
||||
##### Check for a server_updater record, and if not present, insert one
|
||||
$SUrec=0;
|
||||
$stmtA = "SELECT count(*) FROM $server_updater where server_ip = '$server_ip';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$SUrec = $aryA[0];
|
||||
$sthA->finish();
|
||||
if($DB){print STDERR "\n|$SUrec|$stmtA|\n";}
|
||||
|
||||
if ($SUrec < 1)
|
||||
{
|
||||
&get_time_now;
|
||||
|
||||
$stmtU = "INSERT INTO $server_updater set server_ip='$server_ip', last_update='$now_date';";
|
||||
if($DB){print STDERR "\n|$stmtU|\n";}
|
||||
$affected_rows = $dbhA->do($stmtU);
|
||||
}
|
||||
|
||||
|
||||
##### LOOK FOR ZAP CLIENTS AS DEFINED IN THE phones TABLE SO THEY ARE NOT MISLABELED AS TRUNKS
|
||||
print STDERR "LOOKING FOR Zap clients assigned to this server:\n";
|
||||
$Zap_client_count=0;
|
||||
|
||||
@@ -31,9 +31,6 @@ index (user),
|
||||
index (event_date)
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
ALTER TABLE vicidial_users ADD qc_enabled ENUM('1','0') default '0';
|
||||
ALTER TABLE vicidial_users ADD qc_user_level INT(2) default '1';
|
||||
ALTER TABLE vicidial_users ADD qc_pass ENUM('1','0') default '0';
|
||||
@@ -42,3 +39,12 @@ ALTER TABLE vicidial_users ADD qc_commit ENUM('1','0') default '0';
|
||||
|
||||
ALTER TABLE vicidial_user_groups ADD qc_allowed_campaigns TEXT;
|
||||
ALTER TABLE vicidial_user_groups ADD qc_allowed_inbound_groups TEXT;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ALTER TABLE system_settings ADD db_schema_version INT(8) UNSIGNED default '0';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1074', version='2.0.5b0.5';
|
||||
|
||||
|
||||
@@ -1162,12 +1162,13 @@ $list_mix_container = ereg_replace(";","",$list_mix_container);
|
||||
# 71125-1751 - Added allowable transfer groups to campaign detail screen
|
||||
# 80107-1204 - Started framework for new QC section
|
||||
# 80112-0242 - Added more options for lead order
|
||||
# 80211-1901 - Added DB Schema Version to system settings display
|
||||
#
|
||||
#
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
|
||||
|
||||
$admin_version = '2.0.5-121';
|
||||
$build = '80112-0242';
|
||||
$build = '80211-1901';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -12194,7 +12195,7 @@ if ($ADD==311111111111111)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=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 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 from system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$version = $row[0];
|
||||
@@ -12213,11 +12214,13 @@ if ($ADD==311111111111111)
|
||||
$allow_sipsak_messages = $row[13];
|
||||
$admin_home_url = $row[14];
|
||||
$enable_agc_xfer_log = $row[15];
|
||||
$db_schema_version = $row[16];
|
||||
|
||||
echo "<br>MODIFY VICIDIAL SYSTEM SETTINGS<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=411111111111111>\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Version: </td><td align=left> $version</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>DB Schema Version: </td><td align=left> $db_schema_version</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Install Date: </td><td align=left> $install_date</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Use Non-Latin: </td><td align=left><select size=1 name=use_non_latin><option>1</option><option>0</option><option selected>$use_non_latin</option></select>$NWB#settings-use_non_latin$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Webroot Writable: </td><td align=left><select size=1 name=webroot_writable><option>1</option><option>0</option><option selected>$webroot_writable</option></select>$NWB#settings-webroot_writable$NWE</td></tr>\n";
|
||||
|
||||
Reference in New Issue
Block a user