[asterisk-commits] file: branch file/bridging r82139 - /team/file/bridging/apps/app_confbridge.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 10 11:49:05 CDT 2007


Author: file
Date: Mon Sep 10 11:49:04 2007
New Revision: 82139

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82139
Log:
Add beginnings of user menu. Will become operational once core functionality is done.

Modified:
    team/file/bridging/apps/app_confbridge.c

Modified: team/file/bridging/apps/app_confbridge.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/apps/app_confbridge.c?view=diff&rev=82139&r1=82138&r2=82139
==============================================================================
--- team/file/bridging/apps/app_confbridge.c (original)
+++ team/file/bridging/apps/app_confbridge.c Mon Sep 10 11:49:04 2007
@@ -52,10 +52,14 @@
 
 enum {
 	OPTION_DYNAMIC = (1 << 0),
+	OPTION_ADMIN = (1 << 1),
+	OPTION_MENU = (1 << 2),
 } option_flags;
 
 AST_APP_OPTIONS(app_opts,{
+	AST_APP_OPTION('a', OPTION_ADMIN),
 	AST_APP_OPTION('d', OPTION_DYNAMIC),
+	AST_APP_OPTION('m', OPTION_MENU),
 });
 
 struct conference_bridge {
@@ -100,12 +104,23 @@
 	return conference_bridge;
 }
 
+static int menu_callback_admin(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
+{
+	return 0;
+}
+
+static int menu_callback_user(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
+{
+	return 0;
+}
+
 static int app_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
 	struct ast_flags flags;
 	char *parse;
 	struct conference_bridge *conference_bridge = NULL;
+	struct ast_bridge_features features;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(conf_name);
 		AST_APP_ARG(options);
@@ -130,8 +145,12 @@
 		return -1;
 	}
 
+	/* If the menu option is enabled provide a user or admin menu as a custom feature hook */
+	if (ast_test_flag(&flags, OPTION_MENU))
+		ast_bridge_features_hook(&features, "#", (ast_test_flag(&flags, OPTION_ADMIN) ? menu_callback_admin : menu_callback_user));
+
 	/* Actually join the bridge */
-	ast_bridge_join(conference_bridge->bridge, chan, NULL);
+	ast_bridge_join(conference_bridge->bridge, chan, &features);
 
 	/* Drop ourselves from the conference bridge and remove it if needed */
 	AST_LIST_LOCK(&conference_bridges);




More information about the asterisk-commits mailing list