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:
@@ -267,7 +267,7 @@ if ($record_call =~ /Y/)
|
|||||||
$AGI->exec("Monitor wav|/var/spool/asterisk/monitor/MIX/$filename");
|
$AGI->exec("Monitor wav|/var/spool/asterisk/monitor/MIX/$filename");
|
||||||
|
|
||||||
### insert record into recording_log table ###
|
### 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);
|
$affected_rowsR = $dbhA->do($stmtA);
|
||||||
if ($affected_rowsR > 0)
|
if ($affected_rowsR > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -665,32 +665,32 @@ sub process_request
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sthA->finish();
|
$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'";
|
$stmtA = "DELETE from live_inbound where uniqueid IN('$unique_id','$CALLunique_id') and server_ip='$VARserver_ip'";
|
||||||
|
|||||||
@@ -431,6 +431,7 @@ $CIDdate = date("mdHis");
|
|||||||
$ENTRYdate = date("YmdHis");
|
$ENTRYdate = date("YmdHis");
|
||||||
$MT[0]='';
|
$MT[0]='';
|
||||||
$agents='@agents';
|
$agents='@agents';
|
||||||
|
$US='_';
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||||
@@ -6243,6 +6244,7 @@ if ($ACTION == 'AGENTSview')
|
|||||||
|
|
||||||
if ($comments=='AgentXferViewSelect')
|
if ($comments=='AgentXferViewSelect')
|
||||||
{
|
{
|
||||||
|
$AXVSuserORDER[$j] = "$full_name$US$j";
|
||||||
$AXVSuser[$j] = $user;
|
$AXVSuser[$j] = $user;
|
||||||
$AXVSfull_name[$j] = $full_name;
|
$AXVSfull_name[$j] = $full_name;
|
||||||
$AXVScall_time[$j] = $call_time;
|
$AXVScall_time[$j] = $call_time;
|
||||||
@@ -6279,6 +6281,7 @@ if ($ACTION == 'AGENTSview')
|
|||||||
|
|
||||||
if ($comments=='AgentXferViewSelect')
|
if ($comments=='AgentXferViewSelect')
|
||||||
{
|
{
|
||||||
|
$AXVSuserORDER[$j] = "$full_name$US$j";
|
||||||
$AXVSuser[$j] = $user;
|
$AXVSuser[$j] = $user;
|
||||||
$AXVSfull_name[$j] = $full_name;
|
$AXVSfull_name[$j] = $full_name;
|
||||||
$AXVScall_time[$j] = '0:00';
|
$AXVScall_time[$j] = '0:00';
|
||||||
@@ -6314,11 +6317,16 @@ if ($ACTION == 'AGENTSview')
|
|||||||
$AXVSrecords = ($j / $AXVScolumns);
|
$AXVSrecords = ($j / $AXVScolumns);
|
||||||
$AXVSrecords = round($AXVSrecords, 0);
|
$AXVSrecords = round($AXVSrecords, 0);
|
||||||
$m=0;
|
$m=0;
|
||||||
|
|
||||||
|
sort($AXVSuserORDER);
|
||||||
while ($j > $k)
|
while ($j > $k)
|
||||||
{
|
{
|
||||||
echo "<TR BGCOLOR=\"$AXVSstatuscolor[$k]\"><TD><font style=\"font-size: $AXVSfontsize; font-family: sans-serif;\"> <a href=\"#\" onclick=\"AgentsXferSelect('$AXVSuser[$k]','AgentXferViewSelect');return false;\">$AXVSuser[$k] - $AXVSfull_name[$k]</a> </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;\"> <a href=\"#\" onclick=\"AgentsXferSelect('$AXVSuser[$i]','AgentXferViewSelect');return false;\">$AXVSuser[$i] - $AXVSfull_name[$i]</a> </font></TD>";
|
||||||
if ($agent_status_view_time > 0)
|
if ($agent_status_view_time > 0)
|
||||||
{echo "<TD><font style=\"font-size: $AXVSfontsize; font-family: sans-serif;\"> $AXVScall_time[$k] </font></TD>";}
|
{echo "<TD><font style=\"font-size: $AXVSfontsize; font-family: sans-serif;\"> $AXVScall_time[$i] </font></TD>";}
|
||||||
echo "</TR>";
|
echo "</TR>";
|
||||||
|
|
||||||
$k++;
|
$k++;
|
||||||
|
|||||||
Reference in New Issue
Block a user