From caaa5726b07e717ed02229993b520e5e6fa2f42f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 20 Sep 2012 10:49:39 -0500 Subject: [PATCH] fold over use-server to be alias for nameserver param and support back compat with legacy configs --- src/mod/applications/mod_enum/mod_enum.c | 68 ++++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/mod/applications/mod_enum/mod_enum.c b/src/mod/applications/mod_enum/mod_enum.c index c40e6443f0..ae19bdb791 100644 --- a/src/mod/applications/mod_enum/mod_enum.c +++ b/src/mod/applications/mod_enum/mod_enum.c @@ -67,7 +67,6 @@ static switch_event_node_t *NODE = NULL; static struct { char *root; - char *server; char *isn_root; enum_route_t *route_order; switch_memory_pool_t *pool; @@ -79,7 +78,6 @@ static struct { } globals; SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_root, globals.root); -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_server, globals.server); SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_isn_root, globals.isn_root); static void add_route(char *service, char *regex, char *replace) @@ -126,8 +124,6 @@ static switch_status_t load_config(void) const char *val = switch_xml_attr_soft(param, "value"); if (!strcasecmp(var, "default-root")) { set_global_root(val); - } else if (!strcasecmp(var, "use-server")) { - set_global_server(val); } else if (!strcasecmp(var, "auto-reload")) { globals.auto_reload = switch_true(val); } else if (!strcasecmp(var, "query-timeout")) { @@ -140,7 +136,7 @@ static switch_status_t load_config(void) globals.random = switch_true(val); } else if (!strcasecmp(var, "default-isn-root")) { set_global_isn_root(val); - } else if (!strcasecmp(var, "nameserver")) { + } else if (!strcasecmp(var, "nameserver") || !strcasecmp(var, "use-server")) { if ( inameserver < ENUM_MAXNAMESERVERS ) { globals.nameserver[inameserver] = (char *) val; inameserver++; @@ -560,6 +556,7 @@ static switch_status_t enum_lookup(char *root, char *in, enum_record_t **results int argc; int x = 0; char *enum_nameserver_dup; + const char *enum_nameserver = NULL; *results = NULL; @@ -577,41 +574,45 @@ static switch_status_t enum_lookup(char *root, char *in, enum_record_t **results /* Empty the server array */ for(inameserver=0; inameserver