From 2d4dbf15d8e5a1b3ffa85ee57f6452a0d4f7e02e Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 28 Mar 2014 10:12:08 +0000 Subject: [PATCH] Allow dialing bridge statements on follow me for advanced users. Remove unnecessary line feeds. --- app/calls/call_edit.php | 12 ++++----- app/calls/resources/classes/follow_me.php | 33 +++++++++++------------ 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/app/calls/call_edit.php b/app/calls/call_edit.php index b501cc328c..648d52936a 100644 --- a/app/calls/call_edit.php +++ b/app/calls/call_edit.php @@ -146,22 +146,22 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $dnd_enabled = check_str($_POST["dnd_enabled"]); if (strlen($forward_all_destination) > 0) { - $forward_all_destination = preg_replace("~[^0-9]~", "",$forward_all_destination); + // $forward_all_destination = preg_replace("~[^0-9]~", "",$forward_all_destination); } if (strlen($destination_data_1) > 0) { - $destination_data_1 = preg_replace("~[^0-9]~", "",$destination_data_1); + // $destination_data_1 = preg_replace("~[^0-9]~", "",$destination_data_1); } if (strlen($destination_data_2) > 0) { - $destination_data_2 = preg_replace("~[^0-9]~", "",$destination_data_2); + // $destination_data_2 = preg_replace("~[^0-9]~", "",$destination_data_2); } if (strlen($destination_data_3) > 0) { - $destination_data_3 = preg_replace("~[^0-9]~", "",$destination_data_3); + // $destination_data_3 = preg_replace("~[^0-9]~", "",$destination_data_3); } if (strlen($destination_data_4) > 0) { - $destination_data_4 = preg_replace("~[^0-9]~", "",$destination_data_4); + // $destination_data_4 = preg_replace("~[^0-9]~", "",$destination_data_4); } if (strlen($destination_data_5) > 0) { - $destination_data_5 = preg_replace("~[^0-9]~", "",$destination_data_5); + // $destination_data_5 = preg_replace("~[^0-9]~", "",$destination_data_5); } } diff --git a/app/calls/resources/classes/follow_me.php b/app/calls/resources/classes/follow_me.php index 95e0ea6a4f..e8a9d9e5e9 100644 --- a/app/calls/resources/classes/follow_me.php +++ b/app/calls/resources/classes/follow_me.php @@ -306,56 +306,55 @@ include "root.php"; if (strlen($this->cid_name_prefix) > 0) { $dial_string .= ",origination_caller_id_name=".$this->cid_name_prefix."#\${caller_id_name}"; } - else + else { $dial_string .= ",origination_caller_id_name=\${caller_id_name}"; + } if (strlen($this->cid_number_prefix) > 0) { //$dial_string .= ",origination_caller_id_number=".$this->cid_number_prefix.""; $dial_string .= ",origination_caller_id_number=".$this->cid_number_prefix."#\${caller_id_number}"; } - else + else { $dial_string .= ",origination_caller_id_number=\${caller_id_number}"; + } if (strlen($this->accountcode) > 0) { $dial_string .= ",accountcode=".$this->accountcode; } $dial_string .= "}"; foreach ($result as &$row) { - $dial_string .= "["; - if (extension_exists($row["follow_me_destination"])) { - $dial_string .= "outbound_caller_id_number=\${caller_id_number},"; - $dial_string .= "presence_id=".$row["follow_me_destination"]."@".$_SESSION['domain_name'].","; if ($this->call_prompt == "true") { $dial_string .= "group_confirm_key=exec,group_confirm_file=lua confirm.lua,"; } $dial_string .= "leg_delay_start=".$row["follow_me_delay"].","; $dial_string .= "leg_timeout=".$row["follow_me_timeout"]."]"; - $dial_string .= "\${sofia_contact(".$row["follow_me_destination"]."@".$_SESSION['domain_name'].")},"; //$dial_string .= "user/".$row["follow_me_destination"]."@".$_SESSION['domain_name'].","; } else { - $dial_string .= "outbound_caller_id_number=\${outbound_caller_id_number},"; - $dial_string .= "presence_id=".$this->extension."@".$_SESSION['domain_name'].","; if ($this->call_prompt == "true") { $dial_string .= "group_confirm_key=exec,group_confirm_file=lua confirm.lua,"; } $dial_string .= "leg_delay_start=".$row["follow_me_delay"].","; $dial_string .= "leg_timeout=".$row["follow_me_timeout"]."]"; - - $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"].","; - //} + if (is_numeric($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"].","; + //} + } + else { + $dial_string .= $row["follow_me_destination"].","; + } } } $this->dial_string = trim($dial_string, ",");