Small bug fix for ABANDON queue_log current position

git-svn-id: svn://192.168.202.10@1278 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-12-14 15:36:19 +00:00
parent 7148cbce47
commit bef7c3b3ef
2 changed files with 9 additions and 6 deletions
+6 -4
View File
@@ -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;
+3 -2
View File
@@ -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;