diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index b63f8ffbf7..f59dcaba48 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -751,8 +751,8 @@ $hangup_cause = strtolower($hangup_cause); $hangup_cause = ucwords($hangup_cause); - //if call cancelled, show the ring time, not the bill time. - $seconds = $row['hangup_cause'] == "ORIGINATOR_CANCEL" ? $row['duration'] : round(($row['billmsec'] / 1000), 0, PHP_ROUND_HALF_UP); + //get the duration if null use 0 + $duration = $row['duration'] ?? 0; //determine recording properties if (!empty($row['record_path']) && !empty($row['record_name']) && permission_exists('xml_cdr_recording') && (permission_exists('xml_cdr_recording_play') || permission_exists('xml_cdr_recording_download'))) { @@ -914,7 +914,7 @@ } //duration if (permission_exists('xml_cdr_duration')) { - $content .= " ".gmdate("G:i:s", $seconds)."\n"; + $content .= " ".gmdate("G:i:s", $duration)."\n"; } //call result/status if (permission_exists("xml_cdr_status")) {