aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/res_smdi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_smdi.c b/res/res_smdi.c
index 76f61fc5b..53f174b3c 100644
--- a/res/res_smdi.c
+++ b/res/res_smdi.c
@@ -1332,6 +1332,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 +1351,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;
}