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
This commit is contained in:
mattf
2007-03-06 16:35:01 +00:00
parent a4b3d984c1
commit 93ae0a4ac2
5 changed files with 128 additions and 6 deletions
+22 -1
View File
@@ -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';";
+43 -2
View File
@@ -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';";
+21 -1
View File
@@ -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';";
+21 -1
View File
@@ -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';";
+21 -1
View File
@@ -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';";