From 975f7e4dcef5d5e59bae6bac4a528d3ed38dc013 Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 21 Feb 2017 14:13:12 +0000 Subject: [PATCH] Fix for areacode_filter logging issue git-svn-id: svn://192.168.202.10@2679 3d104415-ff17-0410-8863-d5cf3c621b8a --- agi/agi-VDAD_ALL_inbound.agi | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index d0499949..bc6b5a43 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -206,6 +206,7 @@ # 170114-1405 - Added populate_lead_province in-group option # 170118-0107 - Added OW options to populate_lead_province in-group option # 170220-2134 - Added areacode_filter options +# 170221-0912 - Fix for areacode_filter logging issue # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -4256,22 +4257,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override $NQcomments = $MCcomments; } - $stmtA = "INSERT INTO vicidial_closer_log set status='$NQstatus',start_epoch='$now_date_epoch',end_epoch='$now_date_epoch',length_in_sec='1',queue_seconds='0',lead_id='$insert_lead_id',campaign_id='$channel_group',user='VDCL',list_id='$list_id',call_date='$now_date',phone_code='$phone_code',phone_number='$phone_number',comments='$NQcomments',term_reason='$NQterm',uniqueid='$uniqueid',called_count='$called_count';"; + if ($drop_seconds < 1) {$drop_seconds = $drop_timer;} + + $stmtA = "UPDATE vicidial_closer_log set status='$NQstatus',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds',term_reason='$NQterm',comments='$NQcomments' where lead_id = '$insert_lead_id' order by start_epoch desc limit 1;"; $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='02105'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; - $stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;"; - $sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtB ", $dbhA->errstr; - $sthArows=$sthA->rows; - $dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02017'; $MEL_aff_rows=$sthArows; &mysql_error_logging; - if ($sthArows > 0) - { - @aryA = $sthA->fetchrow_array; - $insert_close_id = $aryA[0]; - $cbc++; - } - $sthA->finish(); - if ($AGILOG) {$agi_string = "-- ACF VDCL vcl insert: |$affected_rows|$insert_lead_id|$insert_close_id|$MCareacode_override|\n|$stmtA|"; &agi_output;} + if ($AGILOG) {$agi_string = "-- ACF VDCL vcl update: |$affected_rows|$insert_lead_id|$insert_close_id|$MCareacode_override|\n|$stmtA|"; &agi_output;} $PADlead_id = sprintf("%010s", $insert_lead_id); while (length($PADlead_id) > 10) {chop($PADlead_id);} $NACqueryCID = "Y$CIDdate$PADlead_id";