[asterisk-commits] kmoore: trunk r323272 - /trunk/apps/confbridge/conf_config_parser.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 13 15:45:04 CDT 2011


Author: kmoore
Date: Mon Jun 13 15:44:59 2011
New Revision: 323272

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=323272
Log:
Config inheritance doesn't work with ConfBridge() menu definitions

Current behavior in ConfBridge menu definitions is that first definition takes
precedence, even in templated situations.  This change allows inheritance and
overriding to work as expected so that the last definition takes precedence.

(closes ASTERISK-17986)
Review: https://reviewboard.asterisk.org/r/1267/

Modified:
    trunk/apps/confbridge/conf_config_parser.c

Modified: trunk/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/confbridge/conf_config_parser.c?view=diff&rev=323272&r1=323271&r2=323272
==============================================================================
--- trunk/apps/confbridge/conf_config_parser.c (original)
+++ trunk/apps/confbridge/conf_config_parser.c Mon Jun 13 15:44:59 2011
@@ -582,7 +582,7 @@
 
 static int add_menu_entry(struct conf_menu *menu, const char *dtmf, const char *action_names)
 {
-	struct conf_menu_entry *menu_entry = NULL;
+	struct conf_menu_entry *menu_entry = NULL, *cur = NULL;
 	int res = 0;
 	char *tmp_action_names = ast_strdupa(action_names);
 	char *action = NULL;
@@ -690,6 +690,16 @@
 		ast_free(menu_entry);
 		return -1;
 	}
+
+	/* remove any list entry with an identical DTMF sequence for overrides */
+	AST_LIST_TRAVERSE_SAFE_BEGIN(&menu->entries, cur, entry) {
+		if (!strcasecmp(cur->dtmf, menu_entry->dtmf)) {
+			AST_LIST_REMOVE_CURRENT(entry);
+			ast_free(cur);
+			break;
+		}
+	}
+	AST_LIST_TRAVERSE_SAFE_END;
 
 	AST_LIST_INSERT_TAIL(&menu->entries, menu_entry, entry);
 




More information about the asterisk-commits mailing list