you can fix your forward caller id number/name

This commit is contained in:
luis daniel lucio quiroz
2015-02-28 04:07:15 +00:00
parent dcbe8b9abf
commit 68886ebf82
3 changed files with 54 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ include "root.php";
public $forward_all_enabled;
private $dial_string;
public $accountcode;
public $forward_caller_id_uuid;
public function set() {
//set the global variable
@@ -69,6 +70,25 @@ include "root.php";
if (strlen($this->accountcode) > 0) {
$dial_string .= ",accountcode=".$this->accountcode;
}
if (strlen($this->forward_caller_id_uuid) > 0){
$sql_caller = "select destination_number, destination_description from v_destinations where domain_uuid = '$this->domain_uuid' and destination_type = 'inbound' and destination_uuid = '$this->forward_caller_id_uuid'";
$prep_statement_caller = $db->prepare($sql_caller);
if ($prep_statement_caller) {
$prep_statement_caller->execute();
$row_caller = $prep_statement_caller->fetch(PDO::FETCH_ASSOC);
if (strlen($row_caller['destination_description']) > 0) {
$dial_string_caller_id_name = $row_caller['destination_description'];
$dial_string .= ",origination_caller_id_name=$dial_string_caller_id_name";
}
if (strlen($row_caller['destination_number']) > 0) {
$dial_string_caller_id_number = $row_caller['destination_number'];
$dial_string .= ",origination_caller_id_number=$dial_string_caller_id_number";
$dial_string .= ",outbound_caller_id_number=$dial_string_caller_id_number";
}
}
}
$dial_string .= "}";
if (extension_exists($this->forward_all_destination)) {
$dial_string .= "user/".$this->forward_all_destination."@".$_SESSION['domain_name'];