Fix TTA display bug in Export CDR PDF

Same thing as in the xml_cdr.php page display. If the call is answered instantly, less than a second, then the difference is 0s, and the 0s is a visual indicator that the call was answered, it just took less than a second. Calls that didn't get answered have a large negative number stored in the TTA field, 0 is an answered call.
This commit is contained in:
demonspork
2021-02-20 01:02:03 -06:00
parent d150f16b9d
commit 92dc62a7b4

View File

@@ -192,7 +192,7 @@
$data_body[$p] .= '<td>'.format_phone($fields['destination_number']).'</td>';
$data_body[$p] .= '<td>'.$fields['start_stamp'].'</td>';
$total['tta'] += ($fields['tta'] > 0) ? $fields['tta'] : 0;
$data_body[$p] .= '<td align="right">'.(($fields['tta'] > 0) ? $fields['tta'].'s' : null).'</td>';
$data_body[$p] .= '<td align="right">'.(($fields['tta'] >= 0) ? $fields['tta'].'s' : null).'</td>';
$seconds = ($fields['hangup_cause'] == "ORIGINATOR_CANCEL") ? $fields['duration'] : round(($fields['billmsec'] / 1000), 0, PHP_ROUND_HALF_UP);
$total['duration'] += $seconds;
$data_body[$p] .= '<td align="right">'.gmdate("G:i:s", $seconds).'</td>';