[asterisk-commits] file: trunk r55410 - in /trunk: apps/ configs/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Feb 19 08:57:25 MST 2007


Author: file
Date: Mon Feb 19 09:57:24 2007
New Revision: 55410

URL: http://svn.digium.com/view/asterisk?view=rev&rev=55410
Log:
Allow both an external application and SMDI to do voicemail notification at the same time. (issue #8625 reported by lters)

Modified:
    trunk/apps/app_voicemail.c
    trunk/configs/voicemail.conf.sample

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=55410&r1=55409&r2=55410
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Mon Feb 19 09:57:24 2007
@@ -2817,7 +2817,7 @@
 	else
 		ast_copy_string(ext_context, extension, sizeof(ext_context));
 
-	if (!strcasecmp(externnotify, "smdi")) {
+	if (smdi_iface) {
 		if (ast_app_has_voicemail(ext_context, NULL)) 
 			ast_smdi_mwi_set(smdi_iface, extension);
 		else
@@ -2835,7 +2835,9 @@
 			if (option_debug)
 				ast_log(LOG_DEBUG, "Successfully executed SMDI MWI change for %s on %s\n", extension, smdi_iface->name);
 		}
-	} else if (!ast_strlen_zero(externnotify)) {
+	}
+
+	if (!ast_strlen_zero(externnotify)) {
 		if (inboxcount(ext_context, &newvoicemails, &oldvoicemails)) {
 			ast_log(LOG_ERROR, "Problem in calculating number of voicemail messages available for extension %s\n", extension);
 		} else {
@@ -7294,32 +7296,31 @@
 		}
 #endif
 		/* External voicemail notify application */
-		
 		if ((notifystr = ast_variable_retrieve(cfg, "general", "externnotify"))) {
 			ast_copy_string(externnotify, notifystr, sizeof(externnotify));
 			if (option_debug)
 				ast_log(LOG_DEBUG, "found externnotify: %s\n", externnotify);
-			if (!strcasecmp(externnotify, "smdi")) {
-				if (option_debug)
-					ast_log(LOG_DEBUG, "Using SMDI for external voicemail notification\n");
-				if ((smdistr = ast_variable_retrieve(cfg, "general", "smdiport"))) {
-					smdi_iface = ast_smdi_interface_find(smdistr);
-				} else {
-					if (option_debug)
-						ast_log(LOG_DEBUG, "No SMDI interface set, trying default (/dev/ttyS0)\n");
-					smdi_iface = ast_smdi_interface_find("/dev/ttyS0");
-				}
-
-				if (!smdi_iface) {
-					ast_log(LOG_ERROR, "No valid SMDI interface specfied, disabling external voicemail notification\n");
-					externnotify[0] = '\0';
-				} else {
-					if (option_debug)
-						ast_log(LOG_DEBUG, "Using SMDI port %s\n", smdi_iface->name);
-				}
-			}
 		} else {
 			externnotify[0] = '\0';
+		}
+
+		/* SMDI voicemail notification */
+		if ((s = ast_variable_retrieve(cfg, "general", "smdienable")) && ast_true(s)) {
+			if (option_debug)
+				ast_log(LOG_DEBUG, "Enabled SMDI voicemail notification\n");
+			if ((smdistr = ast_variable_retrieve(cfg, "general", "smdiport"))) {
+				smdi_iface = ast_smdi_interface_find(smdistr);
+			} else {
+				if (option_debug)
+					ast_log(LOG_DEBUG, "No SMDI interface set, trying default (/dev/ttyS0)\n");
+				smdi_iface = ast_smdi_interface_find("/dev/ttyS0");
+			}
+			if (!smdi_iface) {
+				ast_log(LOG_ERROR, "No valid SMDI interface specfied, disabling SMDI voicemail notification\n");
+			} else {
+				if (option_debug)
+					ast_log(LOG_DEBUG, "Using SMDI port %s\n", smdi_iface->name);
+			}
 		}
 
 		/* Silence treshold */

Modified: trunk/configs/voicemail.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/voicemail.conf.sample?view=diff&rev=55410&r1=55409&r2=55410
==============================================================================
--- trunk/configs/voicemail.conf.sample (original)
+++ trunk/configs/voicemail.conf.sample Mon Feb 19 09:57:24 2007
@@ -58,11 +58,13 @@
 ;
 ; If you need to have an external program, i.e. /usr/bin/myapp
 ; called when a voicemail is left, delivered, or your voicemailbox 
-; is checked, uncomment this.  It can also be set to 'smdi' to use
-; smdi for external notification.  If it is 'smdi', smdiport should
-; be set to a valid port as specified in smdi.conf.
-
+; is checked, uncomment this.
 ;externnotify=/usr/bin/myapp
+
+; If you would also like to enable SMDI notification then set smdienable to yes.
+; You will also need to make sure smdiport is set to a valid port as specified in
+; smdi.conf.
+;smdienable=yes
 ;smdiport=/dev/ttyS0
 
 ; If you need to have an external program, i.e. /usr/bin/myapp



More information about the asterisk-commits mailing list