Changed admin logging to log to a database and display logs in the admin report

Fixed rare auto dialing short bug
added second conf file reload after change first after reboot

git-svn-id: svn://192.168.202.10@1069 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-03-10 03:00:18 +00:00
parent 19d31fe064
commit 6122895b88
10 changed files with 1850 additions and 1331 deletions
+7
View File
@@ -268,6 +268,13 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
63. Added Server vital statistics(load/CPU/disk) to the reports screen and the
server modification screen
64. Removed the admin_changes flat text log file and now put all administrative
actions into the vicidial_admin_log table in MySQL. These logs are displayed
to user_level 9 users in admin.php through a link on the REPORTS screen, and
at the bottom of the other screens (USERS, CAMPAIGNS, LISTS, etc...)you can
click on the "Click here to see Admin chages to this record" link to find out
the most recent changes to that record.
+5 -2
View File
@@ -506,8 +506,11 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
{
if ($DB) {print "generating new auto-gen conf files\n";}
$stmtA="UPDATE servers SET rebuild_conf_files='N' where server_ip='$server_ip';";
$affected_rows = $dbhA->do($stmtA);
if (-e "/root/asterisk_command_reload_iax2")
{
$stmtA="UPDATE servers SET rebuild_conf_files='N' where server_ip='$server_ip';";
$affected_rows = $dbhA->do($stmtA);
}
### format the new server_ip dialstring for example to use with extensions.conf
$S='*';
+1 -1
View File
@@ -717,7 +717,7 @@ while($one_day_interval > 0)
&event_logger;
$DBIPtrunk_shortage[$user_CIPct] = 0;
}
$stmtA = "UPDATE vicidial_campaign_server_stats SET local_trunk_shortage='$DBIPtrunk_shortage[$user_CIPct]' where server_ip='$server_ip' and campaign_id='$DBIPcampaign[$user_CIPct]';";
$stmtA = "UPDATE vicidial_campaign_server_stats SET local_trunk_shortage='$DBIPtrunk_shortage[$user_CIPct]',update_time='$now_date' where server_ip='$server_ip' and campaign_id='$DBIPcampaign[$user_CIPct]';";
$affected_rows = $dbhA->do($stmtA);
}
+27 -1
View File
@@ -2,11 +2,12 @@
#
# start_asterisk_boot.pl version 2.0.5
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
# 60814-1658 - added option to start without logging through servers table setting
# 90309-0905 - Added deleting of asterisk command files
#
# default path to astguiclient configuration file:
@@ -60,6 +61,31 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
}
$sthA->finish();
if (-e "/root/asterisk_command_reload_iax2")
{
### find the find binary
$findbin = '';
if ( -e ('/bin/find')) {$findbin = '/bin/find';}
else
{
if ( -e ('/sbin/find')) {$findbin = '/sbin/find';}
else
{
if ( -e ('/usr/bin/find')) {$findbin = '/usr/bin/find';}
else
{
if ( -e ('/usr/local/bin/find')) {$findbin = '/usr/local/bin/find';}
else
{
print "Can't find find binary! Exiting...\n";
}
}
}
}
`$findbin /root/ -maxdepth 1 -name "asterisk_command*" -print | xargs rm -f`;
}
if ($SYSLOG)
{
print "\nStarting Asterisk... screen logging on\n";
@@ -523,6 +523,32 @@ Disk Usage||
These two statistics show the loadavg of a system times 100 and the CPU usage percentage of the server and is updated every minute. The loadavg should on average be below 100 multiplied by the number of CPU cores your system has, for optimal performance. The CPU usage percentage should stay below 50 for optimal performance.||
This field shows the current number of Asterisk channels that are live on the system right now. It is important to note that the number of Asterisk channels is usually much higher than the number of actual calls on a system. This field is updated once every minute.||
This field will show the disk usage for every partition on this server. This field is updated once every minute.||
ADMIN CHANGE LOG||
USER ADMIN CHANGE LOG||
SECTION ADMIN CHANGE LOG||
DETAIL ADMIN CHANGE LOG||
Last 10000 records||
Changes made by||
Record Detail||
Section Records||
Click here to see Admin chages to this record||
Click here to see Admin chages to this campaign||
Click here to see Admin chages to this list||
Click here to see Admin chages to this In-Group||
Click here to see Admin chages to this DID||
Click here to see Admin chages to this remote agent||
Click here to see Admin chages to this user group||
Click here to see Admin chages to this script||
Click here to see Admin chages to this filter||
Click here to see Admin chages to this call time||
Click here to see Admin chages to this shift||
Click here to see Admin chages to this phone alias||
Click here to see Admin chages to this group alias||
Click here to see Admin chages to this server||
Click here to see Admin chages to this conf template||
Click here to see Admin chages to this carrier||
Click here to see Admin chages to the system settings||
############################################################ CLIENT
+1735 -1321
View File
File diff suppressed because it is too large Load Diff
+10 -1
View File
@@ -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) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -28,6 +28,7 @@
# 80701-0832 - Changed to allow for altering of main phone number
# 80805-2106 - Changed comments to TEXTAREA
# 81210-1529 - Added server recording display options
# 90309-1829 - Added admin_log logging
#
require("dbconnect.php");
@@ -223,6 +224,14 @@ if ($end_call > 0)
echo "information modified<BR><BR>\n";
echo "<form><input type=button value=\"Close This Window\" onClick=\"javascript:window.close();\"></form>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='MODIFY', record_id='$lead_id', event_code='ADMIN MODIFY LEAD', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ( ($dispo != $status) and ($dispo == 'CBHOLD') )
{
### inactivate vicidial_callbacks record for this lead
+11 -1
View File
@@ -16,6 +16,7 @@
# - Changed results to multi-record
# 80710-0023 - Added searching by list, user, status
# 90121-0500 - Added filter for phone to remove non-digits
# 90309-1828 - Added admin_log logging
#
require("dbconnect.php");
@@ -220,6 +221,7 @@ else
{
$row=mysql_fetch_row($rslt);
$o++;
$search_lead = $row[0];
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
@@ -239,7 +241,15 @@ else
echo "</TR>\n";
}
echo "</TABLE>\n";
}
}
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN MODIFY LEAD', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
+10 -3
View File
@@ -1,7 +1,7 @@
<?
# new_listloader_superL.php
#
# Copyright (C) 2008 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
#
# AST GUI lead loader from formatted file
#
@@ -23,11 +23,12 @@
# 80514-1030 - removed filesize limit and raised number of errors to be displayed
# 80713-0023 - added last_local_call_time field default of 2008-01-01
# 81011-2009 - a few bug fixes
# 90309-1831 - Added admin_log logging
#
# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time.
$version = '2.0.5-27';
$build = '81011-2009';
$version = '2.0.5-28';
$build = '90309-1831';
require("dbconnect.php");
@@ -793,6 +794,12 @@ function ParseFileName() {
if ($leadfile) {
$total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list='';
### LOG INSERTION Admin Log Table ###
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($file_layout=="standard") {
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script>";
+18 -1
View File
@@ -1,10 +1,11 @@
<?
# user_group_bulk_change.php
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 81119-0918 - First build
# 90309-1830 - Added admin_log logging
#
header ("Content-type: text/html; charset=utf-8");
@@ -142,6 +143,14 @@ if ($stage == "one_user_group_change")
echo "All User Group $old_group Users changed to the $group User Group<BR>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$group', event_code='ADMIN BULK USER GROUP CHANGE', event_sql=\"$SQL_log\", event_notes='Old Group: $old_group';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
exit;
}
@@ -153,6 +162,14 @@ if ($stage == "all_user_group_change")
echo "All non-Admin Users changed to the $group User Group<BR>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERGROUPS', event_type='MODIFY', record_id='$group', event_code='ADMIN BULK USER GROUP CHANGE', event_sql=\"$SQL_log\", event_notes='ALL NON-ADMIN;";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
exit;
}