]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
In the case that you try to directly reload a module has returned
authorRussell Bryant <russell@russellbryant.com>
Fri, 15 Feb 2008 19:50:11 +0000 (19:50 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 15 Feb 2008 19:50:11 +0000 (19:50 +0000)
AST_MODULE_LOAD_DECLINE, log a message indicating that the module is not fully
initialized and must be initialized using "module load".

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

main/loader.c

index 9b96c5bf6fb5d8b24f4831e0d2d28a4af7819ef2..1b808993e525871891db529269b64d9ddd28f356 100644 (file)
@@ -578,8 +578,16 @@ int ast_module_reload(const char *name)
                if (name && resource_name_match(name, cur->resource))
                        continue;
 
-               if (!cur->flags.running || cur->flags.declined)
-                       continue;
+               if (!cur->flags.running || cur->flags.declined) {
+                       if (!name)
+                               continue;
+                       ast_log(LOG_NOTICE, "The module '%s' was not properly initialized.  "
+                               "Before reloading the module, you must run \"module load %s\" "
+                               "and fix whatever is preventing the module from being initialized.\n",
+                               name, name);
+                       res = 2; /* Don't report that the module was not found */
+                       break;
+               }
 
                if (!info->reload) {    /* cannot be reloaded */
                        if (res < 1)    /* store result if possible */