diff --git a/agi/agi-DID_route.agi b/agi/agi-DID_route.agi index 656cfef2..a1755952 100644 --- a/agi/agi-DID_route.agi +++ b/agi/agi-DID_route.agi @@ -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) { diff --git a/bin/FastAGI_log.pl b/bin/FastAGI_log.pl index 9cf66ab9..a499c34a 100644 --- a/bin/FastAGI_log.pl +++ b/bin/FastAGI_log.pl @@ -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'"; diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index b92f34f3..7e047a30 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -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 "   $AXVSuser[$k] - $AXVSfull_name[$k] "; + $order_split = explode("_",$AXVSuserORDER[$k]); + $i = $order_split[1]; + + echo "   $AXVSuser[$i] - $AXVSfull_name[$i] "; if ($agent_status_view_time > 0) - {echo "  $AXVScall_time[$k]  ";} + {echo "  $AXVScall_time[$i]  ";} echo ""; $k++;