another fix for manual dial call progress

git-svn-id: svn://192.168.202.10@1305 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2010-01-15 04:16:23 +00:00
parent 3141ce113b
commit d0b2b64731
3 changed files with 38 additions and 27 deletions
+7 -2
View File
@@ -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++;
}
+6 -3
View File
@@ -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";
+25 -22
View File
@@ -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<!-- $stmt -->";}
$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<!-- $stmt -->";}
$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<!-- $stmt -->";}
$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