diff --git a/bin/FastAGI_log.pl b/bin/FastAGI_log.pl index d24414c8..e6727b45 100644 --- a/bin/FastAGI_log.pl +++ b/bin/FastAGI_log.pl @@ -583,7 +583,9 @@ sub process_request } ### get uniqueid and start_epoch from the call_log table - $stmtA = "SELECT uniqueid,start_epoch FROM call_log where uniqueid='$unique_id';"; + $stmtA = "SELECT uniqueid,start_epoch,channel FROM call_log where uniqueid='$unique_id';"; + if ($callerid =~ /^M/) + {$stmtA = "SELECT uniqueid,start_epoch,channel FROM call_log where caller_code='$callerid' and channel NOT LIKE \"Local\/%\";";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -591,7 +593,10 @@ sub process_request while ($sthArows > $rec_count) { @aryA = $sthA->fetchrow_array; - $start_time = "$aryA[1]"; + $unique_id = $aryA[0]; + $uniqueid = $aryA[0]; + $start_time = $aryA[1]; + $channel = $aryA[2]; if ($AGILOG) {$agi_string = "|$aryA[0]|$aryA[1]|"; &agi_output;} $rec_count++; } diff --git a/www/agc/vdc_call_url_test.php b/www/agc/vdc_call_url_test.php index 6b801be1..080d86de 100644 --- a/www/agc/vdc_call_url_test.php +++ b/www/agc/vdc_call_url_test.php @@ -8,10 +8,11 @@ # # CHANGELOG: # 100103-1317 - First build of script +# 100113-2023 - Added dispo_name # -$version = '2.2.0-1'; -$build = '100103-1317'; +$version = '2.2.0-2'; +$build = '100113-2023'; require("dbconnect.php"); @@ -148,7 +149,8 @@ if (isset($_GET["talk_time_min"])) {$talk_time_min=$_GET["talk_time_min"];} elseif (isset($_POST["talk_time_min"])) {$talk_time_min=$_POST["talk_time_min"];} if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} - +if (isset($_GET["dispo_name"])) {$dispo_name=$_GET["dispo_name"];} + elseif (isset($_POST["dispo_name"])) {$dispo_name=$_POST["dispo_name"];} header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -280,6 +282,7 @@ $output .= "$user_custom_five|"; $output .= "$talk_time|"; $output .= "$talk_time_min|"; $output .= "$agent_log_id|"; +$output .= "$dispo_name|"; echo "$output\n$query_string\n"; diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 6aa58e14..5ab415a9 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -2373,30 +2373,28 @@ if ($ACTION == 'manDiaLlookCaLL') $channel = $row[1]; $end_epoch = $row[2]; - ### Local channel hung up, check carrier log for error - if ($end_epoch > 1000) + ### Check carrier log for error + $stmt="SELECT dialstatus,hangup_cause FROM vicidial_carrier_log where uniqueid='$uniqueid' and server_ip='$server_ip' and channel='$channel' and dialstatus IN('BUSY','CHANUNAVAIL','CONGESTION') LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00292',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $CL_mancall_ct = mysql_num_rows($rslt); + if ($CL_mancall_ct > 0) { - $stmt="SELECT dialstatus,hangup_cause FROM vicidial_carrier_log where uniqueid='$uniqueid' and server_ip='$server_ip' and channel='$channel' and dialstatus IN('BUSY','CHANUNAVAIL','CONGESTION') LIMIT 1;"; + $row=mysql_fetch_row($rslt); + $dialstatus =$row[0]; + $hangup_cause =$row[1]; + + $channel = $dialstatus . "-" . $hangup_cause; + + $call_output = "$uniqueid\n$channel\nERROR"; + $call_good++; + + ### Delete call record + $stmt="DELETE from vicidial_auto_calls where callerid='$MDnextCID';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00292',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $CL_mancall_ct = mysql_num_rows($rslt); - if ($CL_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dialstatus =$row[0]; - $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; - - $call_output = "$uniqueid\n$channel\nERROR"; - $call_good++; - - ### Delete call record - $stmt="DELETE from vicidial_auto_calls where callerid='$MDnextCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00293',$user,$server_ip,$session_name,$one_mysql_log);} - } + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00293',$user,$server_ip,$session_name,$one_mysql_log);} } } } @@ -2429,6 +2427,11 @@ if ($ACTION == 'manDiaLlookCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00055',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt="UPDATE call_log set uniqueid='$uniqueid',channel='$channel' where caller_code='$MDnextCID';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + echo "$call_output"; } else