Call Summary fix voicemails name and extra row

This commit is contained in:
FusionPBX 2023-10-13 01:52:09 -06:00 committed by GitHub
parent d5f39cf0b2
commit a35de4aba3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 10 deletions

View File

@ -34,7 +34,7 @@
$apps[$x]['destinations'][$y]['type'] = "sql";
$apps[$x]['destinations'][$y]['label'] = "voicemails";
$apps[$x]['destinations'][$y]['name'] = "voicemails";
$apps[$x]['destinations'][$y]['sql'] = "select voicemail_uuid, voicemail_uuid as uuid, voicemail_id as destination, '*99' || voicemail_id as extension, voicemail_description as description from v_voicemails";
$apps[$x]['destinations'][$y]['sql'] = "select voicemail_uuid, voicemail_uuid as uuid, voicemail_id as destination, '*99' || voicemail_id as extension, voicemail_description as description, voicemail_description as name from v_voicemails";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and voicemail_enabled = 'true' ";
$apps[$x]['destinations'][$y]['order_by'] = "voicemail_id asc ";
$apps[$x]['destinations'][$y]['field']['uuid'] = "voicemail_uuid";

View File

@ -243,9 +243,16 @@
$array["callflow"] = array_reverse($array["callflow"]);
//add the final call flow destination to the call flow array
if ($call_direction == 'inbound' || $call_direction == 'local') {
//when call_direction is inbound
//when destination_number is not same as the last row
//when last destination is not voicemail *99ext
//count the array $i-1 finds the last record
//count the array $i is the next record
if ($call_direction == 'inbound') {
$i = count($array["callflow"]);
if (!empty($array["callflow"]) && $array["callflow"][$i-1]["destination_number"] != $destination_number) {
if (!empty($array["callflow"])
&& $array["callflow"][$i-1]["destination_number"] != $destination_number
&& substr($array["callflow"][$i-1]["caller_profile"]["destination_number"], 0, 3) != '*99') {
$array["callflow"][$i]["caller_profile"]["destination_number"] = $destination_number;
$array["callflow"][$i]["caller_profile"]["network_addr"] = $network_address;
$array["callflow"][$i]["caller_profile"]["caller_id_name"] = $caller_id_name;