From 9c85ca81efde830c27763393ea7363c3c23155ad Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 6 Mar 2007 16:35:01 +0000 Subject: [PATCH] Another small fix to previous fix: Fixed bug that would not record agent user id right before transfer. git-svn-id: svn://192.168.202.10@549 3d104415-ff17-0410-8863-d5cf3c621b8a --- agi/agi-VDAD_LB_transfer.agi | 23 ++++++++++++++++- agi/agi-VDAD_LO_transfer.agi | 45 ++++++++++++++++++++++++++++++++-- agi/agi-VDADtransfer.agi | 22 ++++++++++++++++- agi/agi-VDADtransferSURVEY.agi | 22 ++++++++++++++++- agi/agi-VDADtransferTEST.agi | 22 ++++++++++++++++- 5 files changed, 128 insertions(+), 6 deletions(-) diff --git a/agi/agi-VDAD_LB_transfer.agi b/agi/agi-VDAD_LB_transfer.agi index e1a17a4d..6c90f226 100644 --- a/agi/agi-VDAD_LB_transfer.agi +++ b/agi/agi-VDAD_LB_transfer.agi @@ -513,7 +513,7 @@ if ($rec_countWAIT < $DBconcurrent_transfers) { $r=0; $VDADuser=''; - while ( (length($VDADuser)<1) && ($r<10) ) + while ( (length($VDADuser)<1) && ($r<3) ) { $stmtA = "SELECT conf_exten,user,extension,server_ip FROM vicidial_live_agents where status IN('QUEUE','INCALL') and campaign_id='$VDADcampaign' and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} @@ -541,6 +541,27 @@ if ($rec_countWAIT < $DBconcurrent_transfers) usleep(1*230*1000); $drop_timer = ($drop_timer + 0.25); } + if ($r > 2) + { + $stmtA = "SELECT conf_exten,user,extension,server_ip FROM vicidial_live_agents where callerid='$callerid' order by last_call_time limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VDADconf_exten = "$aryA[0]"; + $VDADuser = "$aryA[1]"; + $VDADextension = "$aryA[2]"; + $VDADserver_ip = "$aryA[3]"; + $rec_count++; + } + $sthA->finish(); + + if ($AGILOG) {$agi_string = "FFFFFFFFFF vla OR SELECT |$callerid|$VDADuser|"; &agi_output;} + } } $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; diff --git a/agi/agi-VDAD_LO_transfer.agi b/agi/agi-VDAD_LO_transfer.agi index a70938b1..1241409a 100644 --- a/agi/agi-VDAD_LO_transfer.agi +++ b/agi/agi-VDAD_LO_transfer.agi @@ -514,7 +514,7 @@ if ($rec_countWAIT < $concurrent_transfers) { $r=0; $VDADuser=''; - while ( (length($VDADuser)<1) && ($r<10) ) + while ( (length($VDADuser)<1) && ($r<3) ) { $stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} @@ -540,6 +540,26 @@ if ($rec_countWAIT < $concurrent_transfers) usleep(1*230*1000); $drop_timer = ($drop_timer + 0.25); } + if ($r > 2) + { + $stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where callerid='$callerid' order by last_call_time limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VDADconf_exten = "$aryA[0]"; + $VDADuser = "$aryA[1]"; + $VDADextension = "$aryA[2]"; + $rec_count++; + } + $sthA->finish(); + + if ($AGILOG) {$agi_string = "FFFFFFFFFF vla OR SELECT |$callerid|$VDADuser|"; &agi_output;} + } } $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; @@ -643,7 +663,7 @@ if ($rec_countWAITrem < $concurrent_transfers) { $r=0; $VDADuser=''; - while ( (length($VDADuser)<1) && ($r<10) ) + while ( (length($VDADuser)<1) && ($r<3) ) { $stmtA = "SELECT conf_exten,user,extension,server_ip FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip!='$VARserver_ip' and campaign_id='$VDADcampaign' and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} @@ -670,6 +690,27 @@ if ($rec_countWAITrem < $concurrent_transfers) usleep(1*230*1000); $drop_timer = ($drop_timer + 0.25); } + if ($r > 2) + { + $stmtA = "SELECT conf_exten,user,extension,server_ip FROM vicidial_live_agents where callerid='$callerid' order by last_call_time limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VDADconf_exten = "$aryA[0]"; + $VDADuser = "$aryA[1]"; + $VDADextension = "$aryA[2]"; + $VDADserver_ip = "$aryA[3]"; + $rec_count++; + } + $sthA->finish(); + + if ($AGILOG) {$agi_string = "FFFFFFFFFF vla OR SELECT |$callerid|$VDADuser|"; &agi_output;} + } } $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; diff --git a/agi/agi-VDADtransfer.agi b/agi/agi-VDADtransfer.agi index 60e2b331..0138a5c1 100644 --- a/agi/agi-VDADtransfer.agi +++ b/agi/agi-VDADtransfer.agi @@ -504,7 +504,7 @@ if ($rec_countWAIT < $DBconcurrent_transfers) { $r=0; $VDADuser=''; - while ( (length($VDADuser)<1) && ($r<10) ) + while ( (length($VDADuser)<1) && ($r<3) ) { $stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} @@ -530,6 +530,26 @@ if ($rec_countWAIT < $DBconcurrent_transfers) usleep(1*230*1000); $drop_timer = ($drop_timer + 0.25); } + if ($r > 2) + { + $stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where callerid='$callerid' order by last_call_time limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VDADconf_exten = "$aryA[0]"; + $VDADuser = "$aryA[1]"; + $VDADextension = "$aryA[2]"; + $rec_count++; + } + $sthA->finish(); + + if ($AGILOG) {$agi_string = "FFFFFFFFFF vla OR SELECT |$callerid|$VDADuser|"; &agi_output;} + } } $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; diff --git a/agi/agi-VDADtransferSURVEY.agi b/agi/agi-VDADtransferSURVEY.agi index f4628dcc..df5d5d5c 100644 --- a/agi/agi-VDADtransferSURVEY.agi +++ b/agi/agi-VDADtransferSURVEY.agi @@ -540,7 +540,7 @@ if ($rec_countWAIT < $DBconcurrent_transfers) { $r=0; $VDADuser=''; - while ( (length($VDADuser)<1) && ($r<10) ) + while ( (length($VDADuser)<1) && ($r<3) ) { $stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} @@ -566,6 +566,26 @@ if ($rec_countWAIT < $DBconcurrent_transfers) usleep(1*230*1000); $drop_timer = ($drop_timer + 0.25); } + if ($r > 2) + { + $stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where callerid='$callerid' order by last_call_time limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VDADconf_exten = "$aryA[0]"; + $VDADuser = "$aryA[1]"; + $VDADextension = "$aryA[2]"; + $rec_count++; + } + $sthA->finish(); + + if ($AGILOG) {$agi_string = "FFFFFFFFFF vla OR SELECT |$callerid|$VDADuser|"; &agi_output;} + } } $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; diff --git a/agi/agi-VDADtransferTEST.agi b/agi/agi-VDADtransferTEST.agi index c7243aa8..893faba4 100644 --- a/agi/agi-VDADtransferTEST.agi +++ b/agi/agi-VDADtransferTEST.agi @@ -505,7 +505,7 @@ if ($rec_countWAIT < $DBconcurrent_transfers) { $r=0; $VDADuser=''; - while ( (length($VDADuser)<1) && ($r<10) ) + while ( (length($VDADuser)<1) && ($r<3) ) { $stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} @@ -531,6 +531,26 @@ if ($rec_countWAIT < $DBconcurrent_transfers) usleep(1*230*1000); $drop_timer = ($drop_timer + 0.25); } + if ($r > 2) + { + $stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where callerid='$callerid' order by last_call_time limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VDADconf_exten = "$aryA[0]"; + $VDADuser = "$aryA[1]"; + $VDADextension = "$aryA[2]"; + $rec_count++; + } + $sthA->finish(); + + if ($AGILOG) {$agi_string = "FFFFFFFFFF vla OR SELECT |$callerid|$VDADuser|"; &agi_output;} + } } $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';";