From c60867659ae08aad7e63d9f71fb348db82251f30 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 23 Dec 2016 01:17:09 -0700 Subject: [PATCH] Update switch.php --- resources/switch.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/resources/switch.php b/resources/switch.php index 84f55d3dcc..d15b33d52d 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -426,7 +426,7 @@ function save_var_xml() { fclose($fout); //apply settings - $_SESSION["reload_xml"] = true; + $_SESSION["reload_xml"] = true; //$cmd = "api reloadxml"; //event_socket_request_cmd($cmd); @@ -451,8 +451,15 @@ function outbound_route_to_bridge ($domain_uuid, $destination_number) { return $bridge_array; } + //get the hostname + $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); + if ($fp) { + $hostname = trim(event_socket_request($fp, 'api switchname')); + } + $sql = "select * from v_dialplans "; $sql .= "where (domain_uuid = '".$domain_uuid."' or domain_uuid is null) "; + $sql .= "and (hostname = '".$hostname."' or hostname is null) "; $sql .= "and app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3' "; $sql .= "and dialplan_enabled = 'true' "; $sql .= "order by dialplan_order asc "; @@ -1533,4 +1540,4 @@ if(!function_exists('find_php_by_extension')) { } } -?> \ No newline at end of file +?>