aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-05 15:51:53 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-05 15:51:53 +0000
commiteb02aa69b9a111b1bcd63c170a2048dc67560b81 (patch)
tree2b99d894a46c9f12785e2e840661614cb0913938 /main/asterisk.c
parent57a489abfdcdbf55b611feac52794e0ad9e953fb (diff)
When shutting down "gracefully", go through and run the unload() callbacks for
all of the modules. "stop now" is considered a non-graceful shutdown and will not go through this process. (issue #9804, reported by chrisost, patch by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67308 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 570337168..7eccefdbf 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -124,6 +124,7 @@ int daemon(int, int); /* defined in libresolv of all places */
#include "asterisk/version.h"
#include "asterisk/linkedlists.h"
#include "asterisk/devicestate.h"
+#include "asterisk/module.h"
#include "asterisk/doxyref.h" /* Doxygen documentation */
@@ -1253,6 +1254,9 @@ static void quit_handler(int num, int nice, int safeshutdown, int restart)
ast_verbose("Asterisk %s cancelled.\n", restart ? "restart" : "shutdown");
return;
}
+
+ if (nice)
+ ast_module_shutdown();
}
if (ast_opt_console || ast_opt_remote) {
if (getenv("HOME"))