FS-3277 --resolve There are actually really only 2 places where it needs the real hostname, the hostname command and the header on the events. I changed everything to the switchname because there were some more sql stmts etc in the core.

This commit is contained in:
Anthony Minessale
2011-04-29 10:24:50 -05:00
parent 5510618660
commit 00b53a91ea
18 changed files with 102 additions and 93 deletions

View File

@@ -265,6 +265,13 @@ SWITCH_DECLARE(const char *) switch_core_get_hostname(void)
return runtime.hostname;
}
SWITCH_DECLARE(const char *) switch_core_get_switchname(void)
{
if (!zstr(runtime.switchname)) return runtime.switchname;
return runtime.hostname;
}
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
{
char *val;
@@ -1716,6 +1723,9 @@ static void switch_load_core_config(const char *file)
} else if (!strcasecmp(var, "rtp-enable-zrtp")) {
switch_core_set_variable("zrtp_enabled", val);
#endif
} else if (!strcasecmp(var, "switchname") && !zstr(val)) {
runtime.switchname = switch_core_strdup(runtime.memory_pool, val);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Set switchname to %s\n", runtime.switchname);
}
}
}