Fix duration if null set to 0
If gmdate gets a null it uses the system time. This affected canceled calls.
This commit is contained in:
parent
102d973f11
commit
cdc11c5d16
|
|
@ -751,8 +751,8 @@
|
||||||
$hangup_cause = strtolower($hangup_cause);
|
$hangup_cause = strtolower($hangup_cause);
|
||||||
$hangup_cause = ucwords($hangup_cause);
|
$hangup_cause = ucwords($hangup_cause);
|
||||||
|
|
||||||
//if call cancelled, show the ring time, not the bill time.
|
//get the duration if null use 0
|
||||||
$seconds = $row['hangup_cause'] == "ORIGINATOR_CANCEL" ? $row['duration'] : round(($row['billmsec'] / 1000), 0, PHP_ROUND_HALF_UP);
|
$duration = $row['duration'] ?? 0;
|
||||||
|
|
||||||
//determine recording properties
|
//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'))) {
|
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
|
//duration
|
||||||
if (permission_exists('xml_cdr_duration')) {
|
if (permission_exists('xml_cdr_duration')) {
|
||||||
$content .= " <td class='middle center hide-sm-dn'>".gmdate("G:i:s", $seconds)."</td>\n";
|
$content .= " <td class='middle center hide-sm-dn'>".gmdate("G:i:s", $duration)."</td>\n";
|
||||||
}
|
}
|
||||||
//call result/status
|
//call result/status
|
||||||
if (permission_exists("xml_cdr_status")) {
|
if (permission_exists("xml_cdr_status")) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue