summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-09-19 19:51:50 +0000
committerJoshua Colp <jcolp@digium.com>2014-09-19 19:51:50 +0000
commit354fff327ddca6225c5f0be76fdaa5950b95620d (patch)
tree0edeb95f944166360ae0012ebf958d7431e03feb
parentec0313c4118d2d8b26eed1b94319a0744534a32e (diff)
res_pjsip_notify: Fix crash on unload/load and don't say the module doesn't exist on reload.
When unloading the module did not unregister the CLI commands causing a crash upon load when they were registered again. When reloading the module the return value from the config options framework was not checked to determine if an error occurred or not. This caused a message to be output saying the module did not exist when reloading if no changes were present. AST-1433 #close AST-1434 #close ........ Merged revisions 423579 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 423580 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--res/res_pjsip_notify.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_pjsip_notify.c b/res/res_pjsip_notify.c
index cc526c800..8b61d1346 100644
--- a/res/res_pjsip_notify.c
+++ b/res/res_pjsip_notify.c
@@ -1007,13 +1007,17 @@ static int load_module(void)
static int reload_module(void)
{
- return aco_process_config(&notify_cfg, 1) ?
- AST_MODULE_LOAD_DECLINE : 0;
+ if (aco_process_config(&notify_cfg, 1) == ACO_PROCESS_ERROR) {
+ return AST_MODULE_LOAD_DECLINE;
+ }
+
+ return 0;
}
static int unload_module(void)
{
ast_manager_unregister("PJSIPNotify");
+ ast_cli_unregister_multiple(cli_options, ARRAY_LEN(cli_options));
aco_info_destroy(&notify_cfg);
return 0;