remote agent DROP status fix

italian translation build update

git-svn-id: svn://192.168.202.10@990 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2008-10-26 16:57:13 +00:00
parent 4f21b6722a
commit 6e06dcda2d
8 changed files with 260 additions and 62 deletions
+48 -4
View File
@@ -36,6 +36,7 @@
# 70417-1346 - Fixed bug that would add unneeded simulated agent lines
# 80128-0105 - Fixed calls_today bug
# 81007-1746 - Added debugX output for count statements and changed to if from while
# 81026-1246 - Added better logging of calls and fixed the DROP bug
#
### begin parsing run-time options ###
@@ -257,11 +258,54 @@ while($one_day_interval > 0)
$calls_today++;
$sthA->finish();
$stmtA = "UPDATE vicidial_live_agents set status='INCALL', last_call_time='$SQLdate',comments='REMOTE',calls_today='$calls_today' where server_ip='$server_ip' and status IN('QUEUE') and extension LIKE \"R/%\";";
$affected_rows = $dbhA->do($stmtA);
@QHlive_agent_id=@MT;
@QHlead_id=@MT;
@QHuniqueid=@MT;
@QHuser=@MT;
@QHcall_type=@MT;
##### grab number of calls today in this campaign and increment
$stmtA = "SELECT vla.live_agent_id,vla.lead_id,vla.uniqueid,vla.user,vac.call_type FROM vicidial_live_agents vla,vicidial_auto_calls vac where vla.server_ip='$server_ip' and vla.status IN('QUEUE') and vla.extension LIKE \"R/%\" and vla.uniqueid=vac.uniqueid and vla.channel=vac.channel;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$vla_qh_ct=$sthA->rows;
$w=0;
while ($vla_qh_ct > $w)
{
@aryA = $sthA->fetchrow_array;
$QHlive_agent_id[$w] = "$aryA[0]";
$QHlead_id[$w] = "$aryA[1]";
$QHuniqueid[$w] = "$aryA[2]";
$QHuser[$w] = "$aryA[3]";
$QHcall_type[$w] = "$aryA[4]";
$w++;
}
$sthA->finish();
$event_string = "| QUEUEd call listing vla UPDATEd $affected_rows";
&event_logger;
$w=0;
while ($vla_qh_ct > $w)
{
$stmtA = "UPDATE vicidial_live_agents set status='INCALL', last_call_time='$SQLdate',comments='REMOTE',calls_today='$calls_today' where live_agent_id='$QHlive_agent_id[$w]';";
$Aaffected_rows = $dbhA->do($stmtA);
$stmtB = "UPDATE vicidial_list set status='XFER',user='$QHuser[$w]' where lead_id='$QHlead_id[$w]';";
$Baffected_rows = $dbhA->do($stmtB);
if ($QHcall_type[$w] =~ /IN/)
{
$stmtC = "UPDATE vicidial_closer_log set status='XFER',user='$QHuser[$w]',comments='REMOTE' where lead_id='$QHlead_id[$w]' order by call_date desc limit 1;";
$Caffected_rows = $dbhA->do($stmtC);
}
else
{
$stmtC = "UPDATE vicidial_log set status='XFER',user='$QHuser[$w]',comments='REMOTE' where uniqueid='$QHuniqueid[$w]';";
$Caffected_rows = $dbhA->do($stmtC);
}
$event_string = "| QUEUEd listing UPDATEd |$Aaffected_rows|$Baffected_rows|$Caffected_rows| |$QHlive_agent_id[$w]|$QHlead_id[$w]|$QHuniqueid[$w]|$QHuser[$w]|$QHcall_type[$w]|";
&event_logger;
$w++;
}
#@psoutput = `/bin/ps -f --no-headers -A`;
@psoutput = `/bin/ps -o "%p %a" --no-headers -A`;
+7 -4
View File
@@ -42,6 +42,7 @@
# 80830-0035 - Added auto alt dialing for EXTERNAL leads for each lead
# 80909-0843 - Added support for campaign-speccific DNC lists
# 81021-0306 - Added Local channel logging support and while-to-if changes
# 81026-1247 - Changed to allow for better remote agent calling
#
@@ -742,7 +743,7 @@ sub process_request {
if ($calleridname !~ /^Y\d\d\d\d/)
{
########## FIND AND UPDATE vicidial_log ##########
$stmtA = "SELECT start_epoch,status,user,term_reason FROM vicidial_log FORCE INDEX(lead_id) where lead_id = '$VD_lead_id' and uniqueid LIKE \"$Euniqueid%\" limit 1;";
$stmtA = "SELECT start_epoch,status,user,term_reason,comments FROM vicidial_log FORCE INDEX(lead_id) where lead_id = '$VD_lead_id' and uniqueid LIKE \"$Euniqueid%\" 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;
@@ -754,6 +755,7 @@ sub process_request {
$VD_status = "$aryA[1]";
$VD_user = "$aryA[2]";
$VD_term_reason = "$aryA[3]";
$VD_comments = "$aryA[4]";
$epc_countCUSTDATA++;
}
$sthA->finish();
@@ -775,7 +777,7 @@ sub process_request {
if ($Rsec < 10) {$Rsec = "0$Rsec";}
$RSQLdate = "$Ryear-$Rmon-$Rmday $Rhour:$Rmin:$Rsec";
$stmtA = "SELECT start_epoch,status,closecallid,user,term_reason,length_in_sec,queue_seconds FROM vicidial_closer_log where lead_id = '$VD_lead_id' and call_date > \"$RSQLdate\" order by call_date desc limit 1;";
$stmtA = "SELECT start_epoch,status,closecallid,user,term_reason,length_in_sec,queue_seconds,comments FROM vicidial_closer_log where lead_id = '$VD_lead_id' and call_date > \"$RSQLdate\" order by call_date desc 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;
@@ -792,6 +794,7 @@ sub process_request {
$VD_term_reason = "$aryA[4]";
$VD_length_in_sec = "$aryA[5]";
$VD_queue_seconds = "$aryA[6]";
$VD_comments = "$aryA[7]";
$epc_countCUSTDATA++;
}
$sthA->finish();
@@ -805,7 +808,7 @@ sub process_request {
$VD_seconds = ($now_date_epoch - $VD_start_epoch);
$SQL_status='';
if ($VD_status =~ /^NA$|^NEW$|^QUEUE$|^XFER$/)
if ( ($VD_status =~ /^NA$|^NEW$|^QUEUE$|^XFER$/) && ($VD_comments !~ /REMOTE/) )
{
if ( ($VD_term_reason !~ /AGENT|CALLER|QUEUETIMEOUT/) && ( ($VD_user =~ /VDAD|VDCL/) || (length($VD_user) < 1) ) )
{$VDLSQL_term_reason = "term_reason='ABANDON',";}
@@ -847,7 +850,7 @@ sub process_request {
}
else
{
if ($VD_status =~ /^DONE$|^INCALL$|^XFER$/)
if ($VD_status =~ /^DONE$|^INCALL$|^XFER$/)
{$VDCLSQL_update = "term_reason='CALLER',";}
else
{