diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/res_monitor.c | 1 | ||||
-rw-r--r-- | res/res_smdi.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/res/res_monitor.c b/res/res_monitor.c index 6bd96fbca..17d84892f 100644 --- a/res/res_monitor.c +++ b/res/res_monitor.c @@ -38,6 +38,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/manager.h" #include "asterisk/cli.h" +#define AST_API_MODULE #include "asterisk/monitor.h" #include "asterisk/app.h" #include "asterisk/utils.h" diff --git a/res/res_smdi.c b/res/res_smdi.c index cb8cd6120..224dca9e4 100644 --- a/res/res_smdi.c +++ b/res/res_smdi.c @@ -43,6 +43,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/lock.h" #include "asterisk/utils.h" +#define AST_API_MODULE #include "asterisk/smdi.h" #include "asterisk/config.h" #include "asterisk/astobj.h" @@ -1332,6 +1333,8 @@ static struct ast_custom_function smdi_msg_function = { .read = smdi_msg_read, }; +static int unload_module(void); + static int load_module(void) { int res; @@ -1349,8 +1352,10 @@ static int load_module(void) /* load the config and start the listener threads*/ res = smdi_load(0); if (res < 0) { + unload_module(); return res; } else if (res == 1) { + unload_module(); ast_log(LOG_NOTICE, "No SMDI interfaces are available to listen on, not starting SMDI listener.\n"); return AST_MODULE_LOAD_DECLINE; } |