summaryrefslogtreecommitdiff
path: root/res/res_smdi.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2009-05-18 20:52:33 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2009-05-18 20:52:33 +0000
commitbdcafc1ab45dbb7b0a7e0754c41ccf10e8cb4533 (patch)
tree6c359af731649df1389311da52def13ac4e96938 /res/res_smdi.c
parente45d681d1509578e06649ed572e823fb7f4cb045 (diff)
Recorded merge of revisions 195366 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r195366 | tilghman | 2009-05-18 15:24:13 -0500 (Mon, 18 May 2009) | 8 lines Add a similar dependency on SMDI for voicemail as already exists for ADSI. (closes issue #14846) Reported by: pj Patches: 20090413__bug14846__1.4.diff.txt uploaded by tilghman (license 14) 20090507__issue14846__1.6.0.diff.txt uploaded by tilghman (license 14) 20090507__issue14846__1.6.1.diff.txt uploaded by tilghman (license 14) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_smdi.c')
-rw-r--r--res/res_smdi.c5
1 files changed, 5 insertions, 0 deletions
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;
}