[asterisk-commits] dvossel: branch dvossel/hd_confbridge r309342 - in /team/dvossel/hd_confbridg...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 3 10:40:32 CST 2011


Author: dvossel
Date: Thu Mar  3 10:40:30 2011
New Revision: 309342

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=309342
Log:
Introduction of the confbridge menu structures

Modified:
    team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
    team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h

Modified: team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c?view=diff&rev=309342&r1=309341&r2=309342
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c Thu Mar  3 10:40:30 2011
@@ -22,6 +22,7 @@
 #include "include/confbridge.h"
 #include "asterisk/astobj2.h"
 #include "asterisk/cli.h"
+#include "asterisk/bridging_features.h"
 
 #define CONF_CONFIG "confbridge.conf"
 
@@ -75,6 +76,15 @@
 {
 	struct conf_menu *entry = obj;
 	return entry->delme ? CMP_MATCH : 0;
+}
+static void menu_destructor(void *obj)
+{
+	struct conf_menu *menu = obj;
+	struct conf_menu_entry *entry = NULL;
+
+	while ((entry = AST_LIST_REMOVE_HEAD(&menu->entries, entry))) {
+		ast_free(entry);
+	}
 }
 
 /*! User profile container functions */
@@ -117,7 +127,6 @@
 		ast_copy_string(b_profile->name, cat, sizeof(b_profile->name));
 		ao2_link(bridge_profiles, b_profile);
 	} else {
-		ao2_unlock(b_profile);
 		return -1;
 	}
 
@@ -159,7 +168,6 @@
 		ast_copy_string(u_profile->name, cat, sizeof(u_profile->name));
 		ao2_link(user_profiles, u_profile);
 	} else {
-		ao2_unlock(u_profile);
 		return -1;
 	}
 
@@ -221,11 +229,10 @@
 	ast_copy_string(tmp.name, cat, sizeof(tmp.name));
 	if ((menu = ao2_find(menus, &tmp, OBJ_POINTER))) {
 		menu->delme = 0;
-	} else if ((menu = ao2_alloc(sizeof(*menu), NULL))) {
+	} else if ((menu = ao2_alloc(sizeof(*menu), menu_destructor))) {
 		ast_copy_string(menu->name, cat, sizeof(menu->name));
 		ao2_link(menus, menu);
 	} else {
-		ao2_unlock(menu);
 		return -1;
 	}
 

Modified: team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h?view=diff&rev=309342&r1=309341&r2=309342
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h Thu Mar  3 10:40:30 2011
@@ -24,6 +24,8 @@
 #include "asterisk/linkedlists.h"
 #include "asterisk/channel.h"
 #include "asterisk/bridging.h"
+#include "asterisk/bridging_features.h"
+
 /* Maximum length of a conference bridge name */
 #define MAX_CONF_NAME 32
 
@@ -38,9 +40,16 @@
 	USER_OPT_WAITMARKED = (1 << 7), /*!< Set if the conference must wait for a marked user before starting */
 };
 
+struct conf_menu_entry {
+	ast_bridge_features_hook_callback callback;
+	char dtmf[MAXIMUM_DTMF_FEATURE_STRING];
+	AST_LIST_ENTRY(conf_menu_entry) entry;
+};
+
 struct conf_menu {
 	char name[64];
 	int delme;
+	AST_LIST_HEAD_NOLOCK(, conf_menu_entry) entries;
 };
 
 struct user_profile {




More information about the asterisk-commits mailing list