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.
This commit is contained in:
Luis Daniel Lucio Quiroz 2019-06-20 05:35:41 -04:00 committed by FusionPBX
parent 536cf2b137
commit add3dc70ec
1 changed files with 6 additions and 0 deletions

View File

@ -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 ";