Add. Support number_alias field as presence id in follow me/call forward (#2075)

This commit is contained in:
Alexey Melnichuk
2016-11-17 11:40:22 -07:00
committed by FusionPBX
parent 659d135802
commit 63ebb355fa
6 changed files with 96 additions and 65 deletions
+9 -3
View File
@@ -43,6 +43,7 @@ include "root.php";
public $outbound_caller_id_name;
public $outbound_caller_id_number;
private $extension;
private $number_alias;
private $toll_allow;
public $destination_data_1;
@@ -248,6 +249,7 @@ include "root.php";
$this->extension = $row["extension"];
$this->accountcode = $row["accountcode"];
$this->toll_allow = $row["toll_allow"];
$this->number_alias = $row["number_alias"];
$this->outbound_caller_id_name = $row["outbound_caller_id_name"];
$this->outbound_caller_id_number = $row["outbound_caller_id_number"];
}
@@ -347,12 +349,15 @@ include "root.php";
if ($x > 0) {
$dial_string .= ",";
}
if (extension_exists($row["follow_me_destination"])) {
if (($presence_id = extension_presence_id($row["follow_me_destination"])) !== false) {
//set the dial string
// using here `sofia_contact` instead of `user/` allows add registered device
// so you can make follow me for extension `100` like `100` and avoid recusion
// but it ignores DND/CallForwad settings
if (strlen($_SESSION['domain']['dial_string']['text']) == 0) {
$dial_string .= "[";
$dial_string .= "outbound_caller_id_number=$dial_string_caller_id_number,";
$dial_string .= "presence_id=".$row["follow_me_destination"]."@".$_SESSION['domain_name'].",";
$dial_string .= "presence_id=".$presence_id."@".$_SESSION['domain_name'].',';
if ($row["follow_me_prompt"] == "1") {
$dial_string .= "group_confirm_key=exec,group_confirm_file=lua confirm.lua,confirm=true,";
}
@@ -374,6 +379,7 @@ include "root.php";
}
}
else {
$presence_id = extension_presence_id($this->extension, $this->number_alias);
$dial_string .= "[";
if ($_SESSION['cdr']['follow_me_fix']['boolean'] == "true"){
$dial_string .= "outbound_caller_id_name=".$this->outbound_caller_id_name;
@@ -384,7 +390,7 @@ include "root.php";
else{
$dial_string .= "outbound_caller_id_number=$dial_string_caller_id_number";
}
$dial_string .= ",presence_id=".$this->extension."@".$_SESSION['domain_name'];
$dial_string .= ",presence_id=".$presence_id."@".$_SESSION['domain_name'];
if ($row["follow_me_prompt"] == "1") {
$dial_string .= ",group_confirm_key=exec,group_confirm_file=lua confirm.lua,confirm=true,";
}