[svn-commits] tilghman: branch 1.4 r195366 - in /branches/1.4: apps/ res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon May 18 15:24:19 CDT 2009


Author: tilghman
Date: Mon May 18 15:24:13 2009
New Revision: 195366

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=195366
Log:
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)

Modified:
    branches/1.4/apps/app_voicemail.c
    branches/1.4/res/res_smdi.c

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=195366&r1=195365&r2=195366
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Mon May 18 15:24:13 2009
@@ -8862,13 +8862,26 @@
 {
 	int res;
 	char *adsi_loaded = ast_module_helper("", "res_adsi.so", 0, 0, 0, 0);
+	char *smdi_loaded = ast_module_helper("", "res_smdi.so", 0, 0, 0, 0);
 	free(adsi_loaded);
+	free(smdi_loaded);
+
 	if (!adsi_loaded) {
 		/* If embedded, res_adsi may be known as "res_adsi" not "res_adsi.so" */
 		adsi_loaded = ast_module_helper("", "res_adsi", 0, 0, 0, 0);
 		ast_free(adsi_loaded);
 		if (!adsi_loaded) {
 			ast_log(LOG_ERROR, "app_voicemail.so depends upon res_adsi.so\n");
+			return AST_MODULE_LOAD_DECLINE;
+		}
+	}
+
+	if (!smdi_loaded) {
+		/* If embedded, res_smdi may be known as "res_smdi" not "res_smdi.so" */
+		smdi_loaded = ast_module_helper("", "res_smdi", 0, 0, 0, 0);
+		ast_free(smdi_loaded);
+		if (!smdi_loaded) {
+			ast_log(LOG_ERROR, "app_voicemail.so depends upon res_smdi.so\n");
 			return AST_MODULE_LOAD_DECLINE;
 		}
 	}

Modified: branches/1.4/res/res_smdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/res/res_smdi.c?view=diff&rev=195366&r1=195365&r2=195366
==============================================================================
--- branches/1.4/res/res_smdi.c (original)
+++ branches/1.4/res/res_smdi.c Mon May 18 15:24:13 2009
@@ -1337,6 +1337,8 @@
 	.read = smdi_msg_read,
 };
 
+static int unload_module(void);
+
 static int load_module(void)
 {
 	int res;
@@ -1354,8 +1356,10 @@
 	/* 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_WARNING, "No SMDI interfaces are available to listen on, not starting SMDI listener.\n");
 		return AST_MODULE_LOAD_DECLINE;
 	}




More information about the svn-commits mailing list