diff --git a/app/calls/resources/classes/switch_call_forward.php b/app/calls/resources/classes/switch_call_forward.php index b353f62071..3b66f13129 100644 --- a/app/calls/resources/classes/switch_call_forward.php +++ b/app/calls/resources/classes/switch_call_forward.php @@ -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 = ''; diff --git a/app/calls/resources/classes/switch_follow_me.php b/app/calls/resources/classes/switch_follow_me.php index a295243534..afafa68847 100644 --- a/app/calls/resources/classes/switch_follow_me.php +++ b/app/calls/resources/classes/switch_follow_me.php @@ -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, ",");