Fixes a problem where all the templates were marked as dead no matter what. The templ...
authorJeff Peeler <jpeeler@digium.com>
Tue, 29 Apr 2008 22:54:14 +0000 (22:54 +0000)
committerJeff Peeler <jpeeler@digium.com>
Tue, 29 Apr 2008 22:54:14 +0000 (22:54 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114866 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/iax2-provision.c

index fa5cdb0..4a5281c 100644 (file)
@@ -491,14 +491,16 @@ int iax_provision_reload(int reload)
        struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
        if (!provinit)
                iax_provision_init();
-       /* Mark all as dead.  No need for locking */
-       cur = templates;
-       while(cur) {
-               cur->dead = 1;
-               cur = cur->next;
-       }
+       
        cfg = ast_config_load2("iaxprov.conf", "chan_iax2", config_flags);
        if (cfg != NULL && cfg != CONFIG_STATUS_FILEUNCHANGED) {
+               /* Mark all as dead.  No need for locking */
+               cur = templates;
+               while(cur) {
+                       cur->dead = 1;
+                       cur = cur->next;
+               }
+
                /* Load as appropriate */
                cat = ast_category_browse(cfg, NULL);
                while(cat) {