[asterisk-commits] mmichelson: branch mmichelson/features_config r390144 - /team/mmichelson/feat...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 30 13:04:14 CDT 2013


Author: mmichelson
Date: Thu May 30 13:04:12 2013
New Revision: 390144

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390144
Log:
Fix parsing problem for applicationmap lines.


Modified:
    team/mmichelson/features_config/main/features_config.c

Modified: team/mmichelson/features_config/main/features_config.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/features_config/main/features_config.c?view=diff&rev=390144&r1=390143&r2=390144
==============================================================================
--- team/mmichelson/features_config/main/features_config.c (original)
+++ team/mmichelson/features_config/main/features_config.c Thu May 30 13:04:12 2013
@@ -1039,6 +1039,13 @@
 
 	AST_STANDARD_APP_ARGS(args, parse);
 
+	if (ast_strlen_zero(args.dtmf) ||
+			ast_strlen_zero(args.activate_on) ||
+			ast_strlen_zero(args.app)) {
+		ast_log(LOG_WARNING, "Invalid applicationmap syntax for '%s'. Missing required argument\n", var->name);
+		return -1;
+	}
+
 	/* features.conf used to have an "activated_by" portion
 	 * in addition to activate_on. Get rid of whatever may be
 	 * there
@@ -1057,15 +1064,20 @@
 	paren = strchr(args.app, '(');
 	if (paren) {
 		/* New syntax */
+		char *close_paren;
+
 		args.moh_class = args.app_data;
-		args.app_data = ast_strip_quoted(paren, "(", ")");
-	}
-
-	if (ast_strlen_zero(args.dtmf) ||
-			ast_strlen_zero(args.activate_on) ||
-			ast_strlen_zero(args.app)) {
-		ast_log(LOG_WARNING, "Invalid applicationmap syntax for '%s'. Missing required argument\n", var->name);
-		return -1;
+		*paren++ = '\0';
+		close_paren = strrchr(paren, ')');
+		if (close_paren) {
+			*close_paren = '\0';
+		}
+		args.app_data = paren;
+
+		/* Re-check that the application is not empty */
+		if (ast_strlen_zero(args.app)) {
+			return -1;
+		}
 	}
 
 	if (!strcasecmp(args.activate_on, "self")) {
@@ -1077,6 +1089,9 @@
 			args.activate_on, var->name);
 		return -1;
 	}
+
+	ast_debug(1, "Allocating applicationmap item: dtmf = %s, app = %s, app_data = %s, moh_class = %s\n",
+			args.dtmf, args.app, args.app_data, args.moh_class);
 
 	item = applicationmap_item_alloc(var->name, args.app, args.app_data,
 			args.moh_class, args.dtmf, activate_on_self);




More information about the asterisk-commits mailing list