Change. Use destination_caller_id_number as call forward caller id.

This is same value which uses by `Outbound CallerID Number` for extension.
This commit is contained in:
Alexey Melnichuk
2015-10-23 14:40:29 +03:00
parent 6f5adff669
commit 0d72051acc
2 changed files with 25 additions and 7 deletions

View File

@@ -536,7 +536,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if (permission_exists('follow_me_cid_set')) {
echo "   ";
$sql_forward = "select destination_uuid, destination_number, destination_description from v_destinations where domain_uuid = '$domain_uuid' and destination_type = 'inbound' order by destination_number asc ";
$sql_forward = "select destination_uuid, destination_number, destination_description, destination_caller_id_number, destination_caller_id_name from v_destinations where domain_uuid = '$domain_uuid' and destination_type = 'inbound' order by destination_number asc ";
$prep_statement_forward = $db->prepare(check_sql($sql_forward));
$prep_statement_forward->execute();
$result_forward = $prep_statement_forward->fetchAll(PDO::FETCH_ASSOC);
@@ -546,7 +546,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <option value='' disabled='disabled'></option>\n";
foreach ($result_forward as &$row_forward) {
$selected = $row_forward["destination_uuid"] == $forward_caller_id_uuid ? "selected='selected' " : '';
echo "<option value='".$row_forward["destination_uuid"]."' ".$selected.">".format_phone($row_forward["destination_number"])." : ".$row_forward["destination_description"]."</option>\n";
$caller_id_number = $row_forward['destination_caller_id_number'];
if(strlen($caller_id_number) == 0){
$caller_id_number = $row_forward['destination_number'];
}
$caller_id_name = $row_forward['destination_caller_id_name'];
if(strlen($caller_id_name) == 0){
$caller_id_name = $row_forward['destination_description'];
}
echo "<option value='".$row_forward["destination_uuid"]."' ".$selected.">".format_phone($caller_id_number)." : ".$caller_id_name."</option>\n";
}
echo "</select>\n";
}