]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix MODAPP-54
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 4 Dec 2007 17:44:03 +0000 (17:44 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 4 Dec 2007 17:44:03 +0000 (17:44 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6495 d0543943-73ff-0310-b7d9-9358b9ac24b2

conf/autoload_configs/enum.conf.xml
src/mod/applications/mod_enum/mod_enum.c

index 6428571a3f521e01f5687e8415590da9ab17d25a..664c9e5a6cc78916dc13cf6632fc9aa842f4eb25 100644 (file)
@@ -2,6 +2,7 @@
   <settings>
     <param name="default-root" value="e164.org"/>
     <param name="default-isn-root" value="freenum.org"/>
+    <param name="query-timeout" value="10"/>
   </settings>
 
   <routes>
index c0ba560831ad262fa09673d053afac8de037705b..7f68b9dfeeeb69efec920ca657628825192dc518 100644 (file)
@@ -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 */