Open a timer before loading configuration so that the trunking configuration option
authorRussell Bryant <russell@russellbryant.com>
Mon, 15 Dec 2008 22:25:46 +0000 (22:25 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 15 Dec 2008 22:25:46 +0000 (22:25 +0000)
will take effect.

(closes issue #14082)
Reported by: seandarcy

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164525 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index d05ac31..98401fb 100644 (file)
@@ -12573,14 +12573,15 @@ static int load_module(void)
        ast_manager_register( "IAXnetstats", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_netstats, "Show IAX Netstats" );
        ast_manager_register( "IAXregistry", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_registry, "Show IAX registrations");
 
-       if(set_config(config, 0) == -1)
-               return AST_MODULE_LOAD_DECLINE;
-
        timingfd = ast_timer_open();
        if (timingfd > -1) {
                ast_timer_set_rate(timingfd, trunkfreq);
        }
 
+       if (set_config(config, 0) == -1) {
+               return AST_MODULE_LOAD_DECLINE;
+       }
+
        if (ast_channel_register(&iax2_tech)) {
                ast_log(LOG_ERROR, "Unable to register channel class %s\n", "IAX2");
                __unload_module();