[svn-commits] mmichelson: branch file/bridging r109055 - /team/file/bridging/apps/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 17 09:48:48 CDT 2008


Author: mmichelson
Date: Mon Mar 17 09:48:48 2008
New Revision: 109055

URL: http://svn.digium.com/view/asterisk?view=rev&rev=109055
Log:
Add the ability to specify an moh class when using the 'M' option for 
app_confbridge.


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=109055&r1=109054&r2=109055
==============================================================================
--- team/file/bridging/apps/app_confbridge.c (original)
+++ team/file/bridging/apps/app_confbridge.c Mon Mar 17 09:48:48 2008
@@ -73,6 +73,12 @@
 	OPTION_ANNOUNCEUSERCOUNT = (1 << 6), /*!< Set if the number of users should be announced to the caller */
 } option_flags;
 
+enum {
+	OPTION_MUSICONHOLD_CLASS,            /*!< If the 'M' option is set, the music on hold class to play */
+	/*This must be the last element */
+	OPTION_ARRAY_SIZE,
+} option_args;
+
 AST_APP_OPTIONS(app_opts,{
 	AST_APP_OPTION('a', OPTION_ADMIN),
 	AST_APP_OPTION('c', OPTION_ANNOUNCEUSERCOUNT),
@@ -101,6 +107,7 @@
 	struct conference_bridge *conference_bridge; /*!< Conference bridge they are participating in */
 	struct ast_channel *chan;                    /*!< Asterisk channel participating */
 	struct ast_flags flags;                      /*!< Flags passed in when the application was called */
+	char *opt_args[OPTION_ARRAY_SIZE];            /*!< Arguments to options passed when application was called */
 	struct ast_bridge_features features;         /*!< Bridge features structure */
 	unsigned int kicked:1;                       /*!< User has been kicked from the conference */
 	AST_LIST_ENTRY(conference_bridge_user) list; /*!< Linked list information */
@@ -214,7 +221,7 @@
 		}
 		/* We have to check again as the value may have changed while playing back the recording */
 		if (conference_bridge->users == 1 && ast_test_flag(&conference_bridge_user->flags, OPTION_MUSICONHOLD)) {
-			ast_moh_start(conference_bridge_user->chan, NULL, NULL);
+			ast_moh_start(conference_bridge_user->chan, conference_bridge_user->opt_args[OPTION_MUSICONHOLD_CLASS], NULL);
 		}
 	} else if (previous_participants == 1) {
 		struct conference_bridge_user *first_participant = AST_LIST_FIRST(&conference_bridge->users_list);
@@ -272,7 +279,7 @@
 
 		/* Temporarily suspend the above participant from the bridge so we have control to start MOH if needed */
 		if (ast_test_flag(&first_participant->flags, OPTION_MUSICONHOLD) && !ast_bridge_suspend(conference_bridge->bridge, first_participant->chan)) {
-			ast_moh_start(first_participant->chan, NULL, NULL);
+			ast_moh_start(first_participant->chan, first_participant->opt_args[OPTION_MUSICONHOLD_CLASS], NULL);
 			ast_bridge_unsuspend(conference_bridge->bridge, first_participant->chan);
 		}
 	} else if (previous_participants == 1 && conference_bridge->dynamic) {
@@ -393,7 +400,7 @@
 	/* See if music on hold needs to be started back up again */
 	AST_LIST_LOCK(&conference_bridges);
 	if (conference_bridge->users == 1 && ast_test_flag(&conference_bridge_user->flags, OPTION_MUSICONHOLD)) {
-		ast_moh_start(bridge_channel->chan, NULL, NULL);
+		ast_moh_start(bridge_channel->chan, conference_bridge_user->opt_args[OPTION_MUSICONHOLD_CLASS], NULL);
 	}
 	AST_LIST_UNLOCK(&conference_bridges);
 
@@ -429,7 +436,7 @@
 	AST_STANDARD_APP_ARGS(args, parse);
 
 	if (args.argc == 2) {
-		ast_app_parse_options(app_opts, &conference_bridge_user.flags, NULL, args.options);
+		ast_app_parse_options(app_opts, &conference_bridge_user.flags, conference_bridge_user.opt_args, args.options);
 	}
 
 	/* Look for a conference bridge matching the provided name */




More information about the svn-commits mailing list