Update provision.php

This commit is contained in:
FusionPBX
2017-06-21 10:44:59 -06:00
committed by GitHub
parent b312fbc425
commit 65b37481a8

View File

@@ -845,13 +845,15 @@ include "root.php";
//get the contact_uuid
$uuid = $row['contact_uuid'];
//get the names
if (strlen($row['directory_full_name']) > 0) {
$name_array = explode(" ", $row['directory_full_name']);
if (strlen($row['directory_first_name']) > 0) {
$contact_name_given = $row['directory_first_name'];
$contact_name_family = $row['directory_last_name'];
} else {
$name_array = explode(" ", $row['effective_caller_id_name']);
$contact_name_given = array_shift($name_array);
$contact_name_family = trim(implode(' ', $name_array));
}
$contact_name_given = array_shift($name_array);
$contact_name_family = trim(implode(' ', $name_array));
//get the phone_extension
if (is_numeric($row['extension'])) {
$phone_extension = $row['extension'];