Follow Me, and Call Forward fix the ringback, and replace loopback with bridge to gateway for external calls.

This commit is contained in:
Mark Crane 2013-01-25 21:57:39 +00:00
parent 930afca847
commit 88bedc301a
2 changed files with 18 additions and 4 deletions

View File

@ -42,12 +42,20 @@ include "root.php";
//set the dial string
if ($this->forward_all_enabled == "true") {
$dial_string = "[presence_id=".$this->forward_all_destination."@".$_SESSION['domain_name'].",instant_ringback=true]";
if (extension_exists($this->forward_all_destination)) {
$this->dial_string = "[presence_id=".$this->forward_all_destination."@".$_SESSION['domain_name']."]\${sofia_contact(".$this->forward_all_destination."@".$_SESSION['domain_name'].")}";
$dial_string .= "\${sofia_contact(".$this->forward_all_destination."@".$_SESSION['domain_name'].")}";
}
else {
$this->dial_string = "[presence_id=".$this->forward_all_destination."@".$_SESSION['domain_name']."]loopback/".$this->forward_all_destination;
$bridge = outbound_route_to_bridge ($_SESSION['domain_uuid'], $this->forward_all_destination);
if (strlen($bridge[0]) > 0) {
$dial_string .= $bridge[0];
}
else {
$dial_string .= "loopback/".$this->forward_all_destination;
}
}
$this->dial_string = $dial_string;
}
else {
$this->dial_string = '';

View File

@ -283,7 +283,7 @@ include "root.php";
$prep_statement_2 = $db->prepare(check_sql($sql));
$prep_statement_2->execute();
$result = $prep_statement_2->fetchAll(PDO::FETCH_NAMED);
$dial_string = "{group_confirm_key=exec,group_confirm_file=lua confirm.lua,sip_invite_domain=".$_SESSION['domain_name'];
$dial_string = "{group_confirm_key=exec,group_confirm_file=lua confirm.lua,instant_ringback=true,ignore_early_media=true,sip_invite_domain=".$_SESSION['domain_name'];
if ($this->call_prompt == "true") {
$dial_string .= ",call_prompt=true";
}
@ -299,7 +299,13 @@ include "root.php";
$dial_string .= "\${sofia_contact(".$row["follow_me_destination"]."@".$_SESSION['domain_name'].")},";
}
else {
$dial_string .= "loopback/".$row["follow_me_destination"].",";
$bridge = outbound_route_to_bridge ($_SESSION['domain_uuid'], $row["follow_me_destination"]);
if (strlen($bridge[0]) > 0) {
$dial_string .= "".$bridge[0].",";
}
else {
$dial_string .= "loopback/".$row["follow_me_destination"].",";
}
}
}
$this->dial_string = trim($dial_string, ",");