From 002939d80e097c2636e3be2beb8c1993600fccda Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 14 Dec 2009 15:36:19 +0000 Subject: [PATCH] Small bug fix for ABANDON queue_log current position git-svn-id: svn://192.168.202.10@1278 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/bin/AST_VDauto_dial.pl | 10 ++++++---- agc_2-X/trunk/bin/FastAGI_log.pl | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial.pl b/agc_2-X/trunk/bin/AST_VDauto_dial.pl index e4220f17..d53d0ec2 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial.pl @@ -1388,7 +1388,7 @@ while($one_day_interval > 0) ### find original queue position of the call $queue_position=1; - $stmtA = "SELECT queue_position FROM vicidial_closer_log where lead_id='$CLlead_id' and campaign_id='$CLcampaign_id' and call_date > \"$RSQLdate\" order by closecallid desc limit 1;"; + $stmtA = "SELECT queue_position,call_date FROM vicidial_closer_log where lead_id='$CLlead_id' and campaign_id='$CLcampaign_id' and call_date > \"$RSQLdate\" order by closecallid desc limit 1;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -1396,12 +1396,13 @@ while($one_day_interval > 0) { @aryA = $sthA->fetchrow_array; $queue_position = $aryA[0]; + $VCLcall_date = $aryA[1]; } $sthA->finish(); ### find current number of calls in this queue to find position when channel hung up $current_position=1; - $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and campaign_id='$CLcampaign_id';"; + $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and campaign_id='$CLcampaign_id' and call_time < '$VCLcall_date';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -2012,7 +2013,7 @@ while($one_day_interval > 0) ### find original queue position of the call $queue_position=1; - $stmtA = "SELECT queue_position FROM vicidial_closer_log where lead_id='$CLlead_id' and campaign_id='$CLcampaign_id' and call_date > \"$RSQLdate\" order by closecallid desc limit 1;"; + $stmtA = "SELECT queue_position,call_date FROM vicidial_closer_log where lead_id='$CLlead_id' and campaign_id='$CLcampaign_id' and call_date > \"$RSQLdate\" order by closecallid desc limit 1;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -2020,12 +2021,13 @@ while($one_day_interval > 0) { @aryA = $sthA->fetchrow_array; $queue_position = $aryA[0]; + $VCLcall_date = $aryA[1]; } $sthA->finish(); ### find current number of calls in this queue to find position when channel hung up $current_position=1; - $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and campaign_id='$CLcampaign_id';"; + $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and campaign_id='$CLcampaign_id' and call_time < '$VCLcall_date';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; diff --git a/agc_2-X/trunk/bin/FastAGI_log.pl b/agc_2-X/trunk/bin/FastAGI_log.pl index 7fa40ae9..6b7807b9 100644 --- a/agc_2-X/trunk/bin/FastAGI_log.pl +++ b/agc_2-X/trunk/bin/FastAGI_log.pl @@ -844,7 +844,7 @@ sub process_request ### find original queue position of the call $queue_position=1; - $stmtA = "SELECT queue_position FROM vicidial_closer_log where uniqueid='$unique_id' and lead_id='$CIDlead_id' and campaign_id='$VD_campaign_id' and call_date > \"$RSQLdate\" order by closecallid desc limit 1;"; + $stmtA = "SELECT queue_position,call_date FROM vicidial_closer_log where uniqueid='$unique_id' and lead_id='$CIDlead_id' and campaign_id='$VD_campaign_id' and call_date > \"$RSQLdate\" order by closecallid desc limit 1;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -852,6 +852,7 @@ sub process_request { @aryA = $sthA->fetchrow_array; $queue_position = $aryA[0]; + $VCLcall_date = $aryA[1]; } $sthA->finish(); @@ -859,7 +860,7 @@ sub process_request { ### find current number of calls in this queue to find position when channel hung up $current_position=1; - $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and campaign_id='$VD_campaign_id';"; + $stmtA = "SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and campaign_id='$VD_campaign_id' and call_time < '$VCLcall_date';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows;