diff --git a/app/calls/resources/classes/switch_call_forward.php b/app/calls/resources/classes/switch_call_forward.php index ae28956b1d..2bb1dff4af 100644 --- a/app/calls/resources/classes/switch_call_forward.php +++ b/app/calls/resources/classes/switch_call_forward.php @@ -35,14 +35,34 @@ include "root.php"; public $forward_all_destination; public $forward_all_enabled; private $dial_string; + public $accountcode; public function set() { //set the global variable global $db; + //determine whether to update the dial string + $sql = "select * from v_extensions "; + $sql .= "where domain_uuid = '".$this->domain_uuid."' "; + $sql .= "and extension_uuid = '".$this->extension_uuid."' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + if (count($result) > 0) { + foreach ($result as &$row) { + $this->extension = $row["extension"]; + $this->accountcode = $row["accountcode"]; + } + } + unset ($prep_statement); + //set the dial string if ($this->forward_all_enabled == "true") { - $dial_string = "[presence_id=".$this->forward_all_destination."@".$_SESSION['domain_name'].",instant_ringback=true]"; + $dial_string = "{presence_id=".$this->forward_all_destination."@".$_SESSION['domain_name'].",instant_ringback=true"; + if (strlen($this->accountcode) > 0) { + $dial_string .= ",accountcode=".$this->accountcode; + } + $dial_string .= "}"; if (extension_exists($this->forward_all_destination)) { $dial_string .= "\${sofia_contact(".$this->forward_all_destination."@".$_SESSION['domain_name'].")}"; } @@ -61,20 +81,6 @@ include "root.php"; $this->dial_string = ''; } - //determine whether to update the dial string - $sql = "select * from v_extensions "; - $sql .= "where domain_uuid = '".$this->domain_uuid."' "; - $sql .= "and extension_uuid = '".$this->extension_uuid."' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - if (count($result) > 0) { - foreach ($result as &$row) { - $this->extension = $row["extension"]; - } - } - unset ($prep_statement); - //update the extension $sql = "update v_extensions set "; $sql .= "forward_all_destination = '$this->forward_all_destination', "; diff --git a/app/calls/resources/classes/switch_follow_me.php b/app/calls/resources/classes/switch_follow_me.php index 476fc2709e..21901b0404 100644 --- a/app/calls/resources/classes/switch_follow_me.php +++ b/app/calls/resources/classes/switch_follow_me.php @@ -298,7 +298,7 @@ include "root.php"; $dial_string .= ",origination_caller_id_name=".$this->cid_name_prefix."#\${caller_id_name}"; } if (strlen($this->accountcode) > 0) { - $dial_string .= ",accountcode=".$this->accountcode."}"; + $dial_string .= ",accountcode=".$this->accountcode; } $dial_string .= "}"; foreach ($result as &$row) { diff --git a/app/dialplan/resources/xml/dialplan/460_park_slots.xml b/app/dialplan/resources/xml/dialplan/460_park_slots.xml index 762b4fcab7..a07b86ade5 100644 --- a/app/dialplan/resources/xml/dialplan/460_park_slots.xml +++ b/app/dialplan/resources/xml/dialplan/460_park_slots.xml @@ -1,5 +1,5 @@ - + diff --git a/app/schemas/schema_data_view.php b/app/schemas/schema_data_view.php index f25e32870a..c6b9632bad 100644 --- a/app/schemas/schema_data_view.php +++ b/app/schemas/schema_data_view.php @@ -116,7 +116,7 @@ if (strlen($_GET["id"]) > 0) { if (strlen($search_all) == 0) { $sql .= "and schema_uuid = '$schema_uuid' "; if (strlen($data_parent_row_uuid) > 0) { - $sql .= " and data_parent_row_uuid = '$data_parent_row_uuid' "; + $sql .= "and data_parent_row_uuid = '$data_parent_row_uuid' "; } } else { @@ -182,7 +182,7 @@ if (strlen($_GET["id"]) > 0) { if ($row["field_type"] != "label") { if ($row["field_name"] != "domain_uuid") { //$row["field_label"]; - //$row["field_name"] + //$row["field_name"]; //$row["field_type"]; if ($row["field_name"] == "number") { $sql .= "'".$row["field_name"]."' NUMERIC, "; @@ -195,7 +195,6 @@ if (strlen($_GET["id"]) > 0) { } $sql .= "'domain_uuid' TEXT "; $sql .= ");"; - //echo "$sql

\n"; $prep_statement = $db_memory->prepare($sql); $prep_statement->execute(); unset ($prep_statement, $sql); @@ -284,9 +283,6 @@ if (strlen($_GET["id"]) > 0) { $sql .= "where domain_uuid = '$domain_uuid' \n"; $sql .= "limit $rows_per_page offset $offset \n"; //$sql .= "order by field_order asc \n"; - //echo "
\n";
-	//echo $sql;
-	//echo "
\n"; $prep_statement = $db_memory->prepare($sql); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);