From 352b37c2349433c477e55cf72265aaaa3333f36c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 4 Dec 2007 17:44:03 +0000 Subject: [PATCH] fix MODAPP-54 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6495 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- conf/autoload_configs/enum.conf.xml | 1 + src/mod/applications/mod_enum/mod_enum.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/autoload_configs/enum.conf.xml b/conf/autoload_configs/enum.conf.xml index 6428571a3f..664c9e5a6c 100644 --- a/conf/autoload_configs/enum.conf.xml +++ b/conf/autoload_configs/enum.conf.xml @@ -2,6 +2,7 @@ + diff --git a/src/mod/applications/mod_enum/mod_enum.c b/src/mod/applications/mod_enum/mod_enum.c index c0ba560831..7f68b9dfee 100644 --- a/src/mod/applications/mod_enum/mod_enum.c +++ b/src/mod/applications/mod_enum/mod_enum.c @@ -75,6 +75,7 @@ static struct { switch_hash_t *routes; enum_route_t *route_order; switch_memory_pool_t *pool; + int timeout; } globals; SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_root, globals.root); @@ -127,6 +128,8 @@ static switch_status_t load_config(void) char *val = (char *) switch_xml_attr_soft(param, "value"); if (!strcasecmp(var, "default-root")) { set_global_root(val); + } else if (!strcasecmp(var, "query-timeout")) { + globals.timeout = atoi(val); } else if (!strcasecmp(var, "default-isn-root")) { set_global_isn_root(val); } else if (!strcasecmp(var, "log-level-trace")) { @@ -486,7 +489,7 @@ static switch_status_t enum_lookup(char *root, char *in, enum_record_t ** result FD_ZERO(&fds); now = 0; - while ((i = dns_timeouts(nctx, -1, now)) > 0) { + while ((i = dns_timeouts(nctx, globals.timeout, now)) > 0) { #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4389 4127) @@ -702,7 +705,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_enum_load) memset(&globals, 0, sizeof(globals)); globals.pool = pool; - + globals.timeout = 10; load_config(); /* connect my internal structure to the blank pointer passed to me */