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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 30 12:49:56 CDT 2013


Author: mmichelson
Date: Thu May 30 12:49:55 2013
New Revision: 390143

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390143
Log:
Fix bug where DYNAMIC_FEATURES variable would not allow applicationmap item names.

Previously, I was just checking for featuregroup names. Now I allow for individual
applicationmap items to be listed as well.


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=390143&r1=390142&r2=390143
==============================================================================
--- team/mmichelson/features_config/main/features_config.c (original)
+++ team/mmichelson/features_config/main/features_config.c Thu May 30 12:49:55 2013
@@ -49,7 +49,7 @@
 					<enum name="atxferthreeway"><para>Digits to dial to change an attended transfer into a three-way call</para></enum>
 					<enum name="pickupexten"><para>Digits used for picking up ringing calls</para></enum>
 					<enum name="pickupsound"><para>Sound to play to a caller when a call is picked up</para></enum>
-					<enum name="pickupfailsound"><para>Sound to play to picker when a call cannot be picked up</para><enum>
+					<enum name="pickupfailsound"><para>Sound to play to picker when a call cannot be picked up</para></enum>
 				</enumlist>
 			</parameter>
 		</syntax>
@@ -947,13 +947,22 @@
 {
 	struct featuregroup_item *fg_item = obj;
 	struct ao2_container *applicationmap = arg;
-	struct ast_applicationmap_item *appmap_item;
-
-	appmap_item = applicationmap_item_alloc(fg_item->appmap_item_name,
-			fg_item->appmap_item->app, fg_item->appmap_item->app_data,
-			fg_item->appmap_item->moh_class,
-			S_OR(fg_item->dtmf_override, fg_item->appmap_item->dtmf),
-			fg_item->appmap_item->activate_on_self);
+	RAII_VAR(struct ast_applicationmap_item *, appmap_item, NULL, ao2_cleanup);
+
+	/* If there's no DTMF override, then we can just link
+	 * the applicationmap item directly. Otherwise, we need
+	 * to create a copy with the DTMF override in place and
+	 * link that instead
+	 */
+	if (ast_strlen_zero(fg_item->dtmf_override)) {
+		ao2_ref(fg_item->appmap_item, +1);
+		appmap_item = fg_item->appmap_item;
+	} else {
+		appmap_item = applicationmap_item_alloc(fg_item->appmap_item_name,
+				fg_item->appmap_item->app, fg_item->appmap_item->app_data,
+				fg_item->appmap_item->moh_class, fg_item->dtmf_override,
+				fg_item->appmap_item->activate_on_self);
+	}
 
 	if (!appmap_item) {
 		return 0;
@@ -994,9 +1003,13 @@
 	while ((name = strsep(&group_names, "#"))) {
 		RAII_VAR(struct featuregroup *, group, ao2_find(cfg->featuregroups, name, OBJ_KEY), ao2_cleanup);
 		if (!group) {
-			continue;
+			RAII_VAR(struct ast_applicationmap_item *, item, ao2_find(cfg->applicationmap, name, OBJ_KEY), ao2_cleanup);
+			if (item) {
+				ao2_link(applicationmap, item);
+			}
+		} else {
+			ao2_callback(group->items, 0, add_item, applicationmap);
 		}
-		ao2_callback(group->items, 0, add_item, applicationmap);
 	}
 
 	if (ao2_container_count(applicationmap) == 0) {




More information about the asterisk-commits mailing list