From add3dc70ec3423fcafa589845cd980f0f99e6781 Mon Sep 17 00:00:00 2001 From: Luis Daniel Lucio Quiroz Date: Thu, 20 Jun 2019 05:35:41 -0400 Subject: [PATCH] gives save_var_xml() more tolerance (#4299) when there is no local freeswitch running (big cluster deployments where Fusion UI is in another server), sometimes there is no local freeswitch running. this breaks the variables per host. This patch gives the chance to use the hostname as a fallback option before giving up. --- resources/switch.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/switch.php b/resources/switch.php index ed15401005..2e8b37ba58 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -401,6 +401,12 @@ function save_var_xml() { //get the hostname $hostname = trim(event_socket_request_cmd('api switchname')); + if (strlen($hostname) == 0){ + $hostname = trim(gethostname()); + } + if (strlen($hostname) == 0){ + return; + } //build the xml $sql = "select * from v_vars ";