[svn-commits] file: branch file/bridging r109358 - /team/file/bridging/apps/app_confbridge.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 18 09:11:50 CDT 2008


Author: file
Date: Tue Mar 18 09:11:49 2008
New Revision: 109358

URL: http://svn.digium.com/view/asterisk?view=rev&rev=109358
Log:
Add option to set caller as a marked user. Right now this just bumps up/bumps down a counter.

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=109358&r1=109357&r2=109358
==============================================================================
--- team/file/bridging/apps/app_confbridge.c (original)
+++ team/file/bridging/apps/app_confbridge.c Tue Mar 18 09:11:49 2008
@@ -53,6 +53,7 @@
 static char *descrip =
 "  ConfBridge([confno][,[options]]): Enters the user into a specified conference bridge.\n"
 "The option string may contain zero or more of the following characters:\n"
+"      'A' -- Set marked mode\n"
 "      'a' -- Set admin mode\n"
 "      'c' -- Announce user(s) count on joining a conference\n"
 "      'd' -- Dynamically add conference\n"
@@ -75,6 +76,7 @@
 	OPTION_NOONLYPERSON = (1 << 4),      /*!< Set if the "you are currently the only person in this conference" sound file should not be played */
 	OPTION_STARTMUTED = (1 << 5),        /*!< Set if the caller should be initially set muted */
 	OPTION_ANNOUNCEUSERCOUNT = (1 << 6), /*!< Set if the number of users should be announced to the caller */
+	OPTION_MARKEDUSER = (1 << 7),        /*!< Set if the caller is a marked user */
 } option_flags;
 
 enum {
@@ -84,6 +86,7 @@
 } option_args;
 
 AST_APP_OPTIONS(app_opts,{
+	AST_APP_OPTION('A', OPTION_MARKEDUSER),
 	AST_APP_OPTION('a', OPTION_ADMIN),
 	AST_APP_OPTION('c', OPTION_ANNOUNCEUSERCOUNT),
 	AST_APP_OPTION('d', OPTION_DYNAMIC),
@@ -100,6 +103,7 @@
 	char name[MAX_CONF_NAME];                                  /*!< Name of the conference bridge */
 	struct ast_bridge *bridge;                                 /*!< Bridge structure doing the mixing */
 	int users;                                                 /*!< Number of users present */
+	int markedusers;                                           /*!< Number of marked users present */
 	unsigned int dynamic:1;                                    /*!< Is this conference bridge dynamically generated? */
 	unsigned int locked:1;                                     /*!< Is this conference bridge locked? */
 	AST_LIST_HEAD_NOLOCK(, conference_bridge_user) users_list; /*!< List of users participating in the conference bridge */
@@ -215,6 +219,11 @@
 	/* Increment the users count on the bridge, but record it as it is going to need to be known right after this */
 	previous_participants = ast_atomic_fetchadd_int(&conference_bridge->users, +1);
 
+	/* If the caller is a marked user bump up the count */
+	if (ast_test_flag(&conference_bridge_user->flags, OPTION_MARKEDUSER)) {
+		ast_atomic_fetchadd_int(&conference_bridge->markedusers, +1);
+	}
+
 	/* If we are the first participant we may need to start MOH, if we are the second participant we may need to stop MOH on the first */
 	if (previous_participants == 0) {
 		if (!ast_test_flag(&conference_bridge_user->flags, OPTION_NOONLYPERSON)) {
@@ -270,6 +279,11 @@
 	int previous_participants = 0;
 
 	AST_LIST_LOCK(&conference_bridges);
+
+	/* If this caller is a marked user bump down the count */
+	if (ast_test_flag(&conference_bridge_user->flags, OPTION_MARKEDUSER)) {
+		ast_atomic_fetchadd_int(&conference_bridge->markedusers, -1);
+	}
 
 	/* Decrement the users count while keeping the previous participant count */
 	previous_participants = ast_atomic_fetchadd_int(&conference_bridge->users, -1);




More information about the svn-commits mailing list