From 8bc123fb4325b3bda33d018ac45624d782ce949d Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 1 Aug 2006 20:39:09 +0000 Subject: [PATCH] fixed bug 000008, problem with multiplt CALLBK entries going LIVE in vicidial_callbacks git-svn-id: svn://192.168.202.10@104 3d104415-ff17-0410-8863-d5cf3c621b8a --- AST_VDhopper.pl | 3 ++- DBI-scripts/AST_VDhopper.pl | 3 ++- agc/vdc_db_query.php | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AST_VDhopper.pl b/AST_VDhopper.pl index ab55395..467e238 100644 --- a/AST_VDhopper.pl +++ b/AST_VDhopper.pl @@ -36,6 +36,7 @@ # 60511-1150 - Added inserts into vicidial_campaign_stats table # 60609-1451 - Added ability to filter by DNC list vicidial_dnc # 60614-1159 - Added campaign lead recycling ability +# 60801-1634 - Fixed Callback activation bug 000008 # # constants @@ -268,7 +269,7 @@ if ($CBHOLD_count > 0) $event_string = "|CALLBACKS LISTACT|$affected_rows|"; &event_logger; - $stmtA = "UPDATE vicidial_callbacks set status='LIVE' where lead_id IN($update_leads);"; + $stmtA = "UPDATE vicidial_callbacks set status='LIVE' where lead_id IN($update_leads) and status NOT IN('INACTIVE','DEAD','ARCHIVE');"; $dbhA->query("$stmtA"); my $affected_rows = $dbhA->get_affected_rows_length; if ($DB) {print "Scheduled Callbacks Activated: $affected_rows\n";} diff --git a/DBI-scripts/AST_VDhopper.pl b/DBI-scripts/AST_VDhopper.pl index 414bdde..6188d77 100644 --- a/DBI-scripts/AST_VDhopper.pl +++ b/DBI-scripts/AST_VDhopper.pl @@ -37,6 +37,7 @@ # 60511-1150 - Added inserts into vicidial_campaign_stats table # 60609-1451 - Added ability to filter by DNC list vicidial_dnc # 60614-1159 - Added campaign lead recycling ability +# 60801-1634 - Fixed Callback activation bug 000008 # # constants @@ -249,7 +250,7 @@ if ($CBHOLD_count > 0) $event_string = "|CALLBACKS LISTACT|$affected_rows|"; &event_logger; - $stmtA = "UPDATE vicidial_callbacks set status='LIVE' where lead_id IN($update_leads);"; + $stmtA = "UPDATE vicidial_callbacks set status='LIVE' where lead_id IN($update_leads) and status NOT IN('INACTIVE','DEAD','ARCHIVE');;"; $affected_rows = $dbhA->do($stmtA); if ($DB) {print "Scheduled Callbacks Activated: $affected_rows\n";} $event_string = "|CALLBACKS CB ACT |$affected_rows|"; diff --git a/agc/vdc_db_query.php b/agc/vdc_db_query.php index ef28798..6809e11 100644 --- a/agc/vdc_db_query.php +++ b/agc/vdc_db_query.php @@ -372,7 +372,7 @@ if ($ACTION == 'manDiaLnextCaLL') $affected_rows=1; $CBleadIDset=1; - $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; + $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1181,9 +1181,9 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); ### If CALLBK, change vicidial_callback record to INACTIVE - if ($dispo == 'CALLBK') + if (eregi("CALLBK|CBHOLD", $dispo)) { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; + $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); }