Small fixes for logging and agentdirect display

git-svn-id: svn://192.168.202.10@1317 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2010-01-26 12:10:45 +00:00
parent 35b61ea1a0
commit 96e0488a61
3 changed files with 36 additions and 28 deletions
+1 -1
View File
@@ -267,7 +267,7 @@ if ($record_call =~ /Y/)
$AGI->exec("Monitor wav|/var/spool/asterisk/monitor/MIX/$filename");
### insert record into recording_log table ###
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,length_in_sec,filename,lead_id,user,location,vicidial_id) values('$channel','$VARserver_ip','$extension','$SQLdate','$now_date_epoch','0','$filename','0','$callerid','$filename','$unique_id');";
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,length_in_sec,filename,lead_id,user,location,vicidial_id) values('$channel','$VARserver_ip','$callerid','$SQLdate','$now_date_epoch','0','$filename','0','$extension','$filename','$unique_id');";
$affected_rowsR = $dbhA->do($stmtA);
if ($affected_rowsR > 0)
{
+25 -25
View File
@@ -665,32 +665,32 @@ sub process_request
}
}
$sthA->finish();
### BEGIN Double-log end logging ###
$DOUBLEunique_id = $unique_id . "99";
$stmtA = "SELECT start_epoch FROM call_log where uniqueid='$DOUBLEunique_id' and channel_group='DOUBLE_LOG' order by start_time desc limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$DOUBLEstart_epoch = $aryA[0];
$DOUBLElength_in_sec = ($now_date_epoch - $DOUBLEstart_epoch);
$DOUBLElength_in_min = ($DOUBLElength_in_sec / 60);
$DOUBLElength_in_min = sprintf("%8.2f", $DOUBLElength_in_min);
$stmtA = "UPDATE call_log set end_time='$now_date',end_epoch='$now_date_epoch',length_in_sec=$DOUBLElength_in_sec,length_in_min='$DOUBLElength_in_min' where uniqueid='$DOUBLEunique_id' and channel_group='DOUBLE_LOG' order by start_time desc limit 1";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rowsDB = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "DOUBLE QUERY done: start time = $DOUBLEstart_epoch | sec: $DOUBLElength_in_sec | min: $DOUBLElength_in_min |$affected_rowsDB"; &agi_output;}
}
$sthA->finish();
### END Double-log end logging ###
}
### BEGIN Double-log end logging ###
$DOUBLEunique_id = $unique_id . "99";
$stmtA = "SELECT start_epoch FROM call_log where uniqueid='$DOUBLEunique_id' and channel_group='DOUBLE_LOG' order by start_time desc limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$DOUBLEstart_epoch = $aryA[0];
$DOUBLElength_in_sec = ($now_date_epoch - $DOUBLEstart_epoch);
$DOUBLElength_in_min = ($DOUBLElength_in_sec / 60);
$DOUBLElength_in_min = sprintf("%8.2f", $DOUBLElength_in_min);
$stmtA = "UPDATE call_log set end_time='$now_date',end_epoch='$now_date_epoch',length_in_sec=$DOUBLElength_in_sec,length_in_min='$DOUBLElength_in_min' where uniqueid='$DOUBLEunique_id' and channel_group='DOUBLE_LOG' order by start_time desc limit 1";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rowsDB = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "DOUBLE QUERY done: start time = $DOUBLEstart_epoch | sec: $DOUBLElength_in_sec | min: $DOUBLElength_in_min |$affected_rowsDB"; &agi_output;}
}
$sthA->finish();
### END Double-log end logging ###
}
$stmtA = "DELETE from live_inbound where uniqueid IN('$unique_id','$CALLunique_id') and server_ip='$VARserver_ip'";
+10 -2
View File
@@ -431,6 +431,7 @@ $CIDdate = date("mdHis");
$ENTRYdate = date("YmdHis");
$MT[0]='';
$agents='@agents';
$US='_';
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
@@ -6243,6 +6244,7 @@ if ($ACTION == 'AGENTSview')
if ($comments=='AgentXferViewSelect')
{
$AXVSuserORDER[$j] = "$full_name$US$j";
$AXVSuser[$j] = $user;
$AXVSfull_name[$j] = $full_name;
$AXVScall_time[$j] = $call_time;
@@ -6279,6 +6281,7 @@ if ($ACTION == 'AGENTSview')
if ($comments=='AgentXferViewSelect')
{
$AXVSuserORDER[$j] = "$full_name$US$j";
$AXVSuser[$j] = $user;
$AXVSfull_name[$j] = $full_name;
$AXVScall_time[$j] = '0:00';
@@ -6314,11 +6317,16 @@ if ($ACTION == 'AGENTSview')
$AXVSrecords = ($j / $AXVScolumns);
$AXVSrecords = round($AXVSrecords, 0);
$m=0;
sort($AXVSuserORDER);
while ($j > $k)
{
echo "<TR BGCOLOR=\"$AXVSstatuscolor[$k]\"><TD><font style=\"font-size: $AXVSfontsize; font-family: sans-serif;\"> &nbsp; <a href=\"#\" onclick=\"AgentsXferSelect('$AXVSuser[$k]','AgentXferViewSelect');return false;\">$AXVSuser[$k] - $AXVSfull_name[$k]</a>&nbsp;</font></TD>";
$order_split = explode("_",$AXVSuserORDER[$k]);
$i = $order_split[1];
echo "<TR BGCOLOR=\"$AXVSstatuscolor[$i]\"><TD><font style=\"font-size: $AXVSfontsize; font-family: sans-serif;\"> &nbsp; <a href=\"#\" onclick=\"AgentsXferSelect('$AXVSuser[$i]','AgentXferViewSelect');return false;\">$AXVSuser[$i] - $AXVSfull_name[$i]</a>&nbsp;</font></TD>";
if ($agent_status_view_time > 0)
{echo "<TD><font style=\"font-size: $AXVSfontsize; font-family: sans-serif;\">&nbsp; $AXVScall_time[$k] &nbsp;</font></TD>";}
{echo "<TD><font style=\"font-size: $AXVSfontsize; font-family: sans-serif;\">&nbsp; $AXVScall_time[$i] &nbsp;</font></TD>";}
echo "</TR>";
$k++;