From e5004d2c0124843b1817f2686874a37c1dc1035f Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 31 Mar 2009 01:33:20 +0000 Subject: [PATCH] fixed cleanup agent log issues prepared 2.0.5rc4 for release git-svn-id: svn://192.168.202.10@1090 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../branches/agc_2.0.5/bin/AST_cleanup_agent_log.pl | 11 +++++------ .../agc_2.0.5/extras/MySQL_AST_CREATE_tables.sql | 2 +- agc_2-X/branches/agc_2.0.5/version | 2 +- agc_2-X/trunk/bin/AST_cleanup_agent_log.pl | 11 +++++------ 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/agc_2-X/branches/agc_2.0.5/bin/AST_cleanup_agent_log.pl b/agc_2-X/branches/agc_2.0.5/bin/AST_cleanup_agent_log.pl index c81dc524..cf735700 100644 --- a/agc_2-X/branches/agc_2.0.5/bin/AST_cleanup_agent_log.pl +++ b/agc_2-X/branches/agc_2.0.5/bin/AST_cleanup_agent_log.pl @@ -10,7 +10,7 @@ # # This program only needs to be run by one server # -# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60711-0945 - Changed to DBI by Marin Blu @@ -18,6 +18,7 @@ # 81029-0124 - Added portion to clean up queue_log entries if QM enabled # 81114-0155 - Added portion to remove queue_log COMPLETE duplicates # 81208-0133 - Added portion to check for more missing queue_log entries +# 90330-2128 - minor code fixes and restricted queue_log actions to VICIDIAL-defined serverid records # # constants @@ -401,7 +402,7 @@ if ($enable_queuemetrics_logging > 0) $noCOMPLETEinsert=0; ############################################################## ##### grab all queue_log entries for ENTERQUEUE verb to validate - $stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid FROM queue_log where verb='ENTERQUEUE' $QM_SQL_time order by time_id;"; + $stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid FROM queue_log where verb='ENTERQUEUE' and serverid='$queuemetrics_log_id' $QM_SQL_time order by time_id;"; $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; $EQ_records=$sthB->rows; @@ -569,8 +570,6 @@ if ($enable_queuemetrics_logging > 0) $VALtalk = "$aryA[2]"; $VALdispo = "$aryA[3]"; $VALstatus ="$aryA[4]"; - $queuemetrics_log_id = "$aryA[5]"; - $queuemetrics_eq_prepend = "$aryA[6]"; $rec_count++; } $sthA->finish(); @@ -646,7 +645,7 @@ if ($enable_queuemetrics_logging > 0) ####################################################################### ##### grab all queue_log entries with more than one COMPLETE verb to clean up - $stmtB = "SELECT call_id, count(*) FROM queue_log WHERE verb IN('COMPLETEAGENT','COMPLETECALLER','TRANSFER') GROUP BY call_id HAVING count(*)>1 ORDER BY count(*) DESC;"; + $stmtB = "SELECT call_id, count(*) FROM queue_log WHERE verb IN('COMPLETEAGENT','COMPLETECALLER','TRANSFER') and serverid='$queuemetrics_log_id' GROUP BY call_id HAVING count(*)>1 ORDER BY count(*) DESC;"; $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; $XC_records=$sthB->rows; @@ -674,7 +673,7 @@ if ($enable_queuemetrics_logging > 0) ########################################################################## ##### grab all queue_log COMPLETEAGENT entries with negative call time to clean up - $stmtB = "SELECT call_id, time_id FROM queue_log WHERE verb IN('COMPLETEAGENT') and data2 < '0';"; + $stmtB = "SELECT call_id, time_id FROM queue_log WHERE verb IN('COMPLETEAGENT') and data2 < '0' and serverid='$queuemetrics_log_id';"; $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; $XN_records=$sthB->rows; diff --git a/agc_2-X/branches/agc_2.0.5/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/branches/agc_2.0.5/extras/MySQL_AST_CREATE_tables.sql index b8e0d430..0f243d03 100644 --- a/agc_2-X/branches/agc_2.0.5/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/branches/agc_2.0.5/extras/MySQL_AST_CREATE_tables.sql @@ -1456,7 +1456,7 @@ INSERT INTO vicidial_inbound_groups(group_id,group_name,group_color,active,queue INSERT INTO vicidial_lists SET list_id='999',list_name='Default inbound list',campaign_id='TESTCAMP',active='N'; INSERT INTO vicidial_lists SET list_id='998',list_name='Default Manual list',campaign_id='TESTCAMP',active='N'; -INSERT INTO system_settings (version,install_date) values('2.0.5rc3', CURDATE()); +INSERT INTO system_settings (version,install_date) values('2.0.5rc4', CURDATE()); INSERT INTO vicidial_status_categories (vsc_id,vsc_name) values('UNDEFINED','Default Category'); diff --git a/agc_2-X/branches/agc_2.0.5/version b/agc_2-X/branches/agc_2.0.5/version index 4ab7f7a6..eedf8a13 100644 --- a/agc_2-X/branches/agc_2.0.5/version +++ b/agc_2-X/branches/agc_2.0.5/version @@ -1 +1 @@ -2.0.5rc3 +2.0.5rc4 diff --git a/agc_2-X/trunk/bin/AST_cleanup_agent_log.pl b/agc_2-X/trunk/bin/AST_cleanup_agent_log.pl index c81dc524..cf735700 100644 --- a/agc_2-X/trunk/bin/AST_cleanup_agent_log.pl +++ b/agc_2-X/trunk/bin/AST_cleanup_agent_log.pl @@ -10,7 +10,7 @@ # # This program only needs to be run by one server # -# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60711-0945 - Changed to DBI by Marin Blu @@ -18,6 +18,7 @@ # 81029-0124 - Added portion to clean up queue_log entries if QM enabled # 81114-0155 - Added portion to remove queue_log COMPLETE duplicates # 81208-0133 - Added portion to check for more missing queue_log entries +# 90330-2128 - minor code fixes and restricted queue_log actions to VICIDIAL-defined serverid records # # constants @@ -401,7 +402,7 @@ if ($enable_queuemetrics_logging > 0) $noCOMPLETEinsert=0; ############################################################## ##### grab all queue_log entries for ENTERQUEUE verb to validate - $stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid FROM queue_log where verb='ENTERQUEUE' $QM_SQL_time order by time_id;"; + $stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid FROM queue_log where verb='ENTERQUEUE' and serverid='$queuemetrics_log_id' $QM_SQL_time order by time_id;"; $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; $EQ_records=$sthB->rows; @@ -569,8 +570,6 @@ if ($enable_queuemetrics_logging > 0) $VALtalk = "$aryA[2]"; $VALdispo = "$aryA[3]"; $VALstatus ="$aryA[4]"; - $queuemetrics_log_id = "$aryA[5]"; - $queuemetrics_eq_prepend = "$aryA[6]"; $rec_count++; } $sthA->finish(); @@ -646,7 +645,7 @@ if ($enable_queuemetrics_logging > 0) ####################################################################### ##### grab all queue_log entries with more than one COMPLETE verb to clean up - $stmtB = "SELECT call_id, count(*) FROM queue_log WHERE verb IN('COMPLETEAGENT','COMPLETECALLER','TRANSFER') GROUP BY call_id HAVING count(*)>1 ORDER BY count(*) DESC;"; + $stmtB = "SELECT call_id, count(*) FROM queue_log WHERE verb IN('COMPLETEAGENT','COMPLETECALLER','TRANSFER') and serverid='$queuemetrics_log_id' GROUP BY call_id HAVING count(*)>1 ORDER BY count(*) DESC;"; $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; $XC_records=$sthB->rows; @@ -674,7 +673,7 @@ if ($enable_queuemetrics_logging > 0) ########################################################################## ##### grab all queue_log COMPLETEAGENT entries with negative call time to clean up - $stmtB = "SELECT call_id, time_id FROM queue_log WHERE verb IN('COMPLETEAGENT') and data2 < '0';"; + $stmtB = "SELECT call_id, time_id FROM queue_log WHERE verb IN('COMPLETEAGENT') and data2 < '0' and serverid='$queuemetrics_log_id';"; $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; $XN_records=$sthB->rows;