From 40e891284aeaff27e1c22c1ec6e315c046f8b776 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 5 Oct 2009 13:36:38 +0000 Subject: [PATCH] Fixed queue_log issue with consultative transfers git-svn-id: svn://192.168.202.10@1239 3d104415-ff17-0410-8863-d5cf3c621b8a --- agi/agi-VDAD_ALL_inbound.agi | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index 38cad4ad..76e7023b 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -101,6 +101,7 @@ # 90720-0023 - Added checks for filename validity before streaming, changed initial heavy search from 3 to 2 seconds # 90726-0114 - Fixed bug on some calls for agent grab # 90808-0307 - Added longest_wait_time as agent routing option +# 91004-0959 - Fix for queue_log consultative transfers # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -1463,6 +1464,26 @@ if ( ($agent_search_method =~ /^SO|^LO/) && ($skipLOSO < 1) ) $Baffected_rows = $dbhB->do($stmtB); $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02045'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + $QLabandon=0; + $stmtB="SELECT count(*) from queue_log where call_id='$YqueryCID' and verb='ABANDON';"; + if ($AGILOG) {$agi_string = "|$stmtB|"; &agi_output;} + $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; + $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; + $sthBrowsQLA=$sthB->rows; + if ($sthBrowsQLA > 0) + { + @aryB = $sthB->fetchrow_array; + $QLabandon = "$aryB[0]"; + } + $sthB->finish(); + if ( ($QLabandon > 0) && (length($callerid) > 15) ) + { + $stmtB = "DELETE FROM queue_log where call_id='$YqueryCID' and verb='ABANDON';"; + if ($AGILOG) {$agi_string = "Removing ABANDON queue_log entries for call $QLabandon|$YqueryCID"; &agi_output;} + $Baffected_rows = $dbhB->do($stmtB); + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + } + $dbhB->disconnect(); } @@ -1815,6 +1836,26 @@ if ($agent_search_method =~ /^LO|^LB/) $Baffected_rows = $dbhB->do($stmtB); $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02065'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + $QLabandon=0; + $stmtB="SELECT count(*) from queue_log where call_id='$YqueryCID' and verb='ABANDON';"; + if ($AGILOG) {$agi_string = "|$stmtB|"; &agi_output;} + $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; + $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; + $sthBrowsQLA=$sthB->rows; + if ($sthBrowsQLA > 0) + { + @aryB = $sthB->fetchrow_array; + $QLabandon = "$aryB[0]"; + } + $sthB->finish(); + if ( ($QLabandon > 0) && (length($callerid) > 15) ) + { + $stmtB = "DELETE FROM queue_log where call_id='$YqueryCID' and verb='ABANDON';"; + if ($AGILOG) {$agi_string = "Removing ABANDON queue_log entries for call $QLabandon|$YqueryCID"; &agi_output;} + $Baffected_rows = $dbhB->do($stmtB); + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + } + $dbhB->disconnect(); }