[svn-commits] dvossel: branch dvossel/hd_confbridge r309252 - in /team/dvossel/hd_confbridg...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Mar 2 10:44:26 CST 2011


Author: dvossel
Date: Wed Mar  2 10:44:22 2011
New Revision: 309252

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=309252
Log:
Addition of more bridge profile options

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

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=309252&r1=309251&r2=309252
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c Wed Mar  2 10:44:22 2011
@@ -124,6 +124,7 @@
 	ao2_lock(b_profile);
 	/* set defaults */
 	b_profile->internal_sample_rate = 0;
+	b_profile->flags = 0;
 
 	for (var = ast_variable_browse(cfg, cat); var; var = var->next) {
 		if (!strcasecmp(var->name, "internal_sample_rate")) {
@@ -133,6 +134,22 @@
 				ast_log(LOG_WARNING, "internal_sample_rate '%s' at line %d of %s is not supported.\n",
 						var->value, var->lineno, CONF_CONFIG);
 			}
+		} else if (!strcasecmp(var->name, "music_on_hold_when_empty")) {
+			b_profile->flags = ast_true(var->value) ?
+				b_profile->flags | BRIDGE_OPT_MUSICONHOLD :
+				b_profile->flags & ~BRIDGE_OPT_MUSICONHOLD;
+		} else if (!strcasecmp(var->name, "wait_marked")) {
+			b_profile->flags = ast_true(var->value) ?
+				b_profile->flags | BRIDGE_OPT_WAITMARKED :
+				b_profile->flags & ~BRIDGE_OPT_WAITMARKED;
+		} else if (!strcasecmp(var->name, "quiet")) {
+			b_profile->flags = ast_true(var->value) ?
+				b_profile->flags | BRIDGE_OPT_QUIET :
+				b_profile->flags & ~BRIDGE_OPT_QUIET;
+		} else if (!strcasecmp(var->name, "announce_user_count")) {
+			b_profile->flags = ast_true(var->value) ?
+				b_profile->flags | BRIDGE_OPT_ANNOUNCEUSERCOUNT :
+				b_profile->flags & ~BRIDGE_OPT_ANNOUNCEUSERCOUNT;
 		} else if (!strcasecmp(var->name, "type")) {
 			continue;
 		} else {
@@ -316,13 +333,26 @@
 		return CLI_SUCCESS;
 	}
 
-	ast_cli(a->fd,"Name: %s\n", b_profile->name);
+	ast_cli(a->fd,"--------------------------------------------\n");
+	ast_cli(a->fd,"Name:                 %s\n", b_profile->name);
 	if (b_profile->internal_sample_rate) {
 		snprintf(tmp, sizeof(tmp), "%d", b_profile->internal_sample_rate);
 	} else {
 		snprintf(tmp, sizeof(tmp), "auto");
 	}
 	ast_cli(a->fd,"Internal Sample Rate: %s\n", tmp);
+	ast_cli(a->fd,"MOH When Empty:       %s\n",
+		b_profile->flags & BRIDGE_OPT_MUSICONHOLD ?
+		"enabled" : "disabled");
+	ast_cli(a->fd,"Wait Marked:          %s\n",
+		b_profile->flags & BRIDGE_OPT_WAITMARKED ?
+		"enabled" : "disabled");
+	ast_cli(a->fd,"Quiet:                %s\n",
+		b_profile->flags & BRIDGE_OPT_QUIET ?
+		"enabled" : "disabled");
+	ast_cli(a->fd,"Announce User Count:  %s\n",
+		b_profile->flags & BRIDGE_OPT_ANNOUNCEUSERCOUNT ?
+		"enabled" : "disabled");
 	ast_cli(a->fd,"\n");
 
 	ao2_ref((struct bridge_profile *) b_profile, -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=309252&r1=309251&r2=309252
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h Wed Mar  2 10:44:22 2011
@@ -27,8 +27,8 @@
 /* Maximum length of a conference bridge name */
 #define MAX_CONF_NAME 32
 
-
-enum user_profile_flags {
+//todohere remove these old flags once the new ones take their place.
+enum {
 	OPTION_ADMIN = (1 << 0),             /*!< Set if the caller is an administrator */
 	OPTION_MENU = (1 << 1),              /*!< Set if the caller should have access to the conference bridge IVR menu */
 	OPTION_MUSICONHOLD = (1 << 2),       /*!< Set if music on hold should be played if nobody else is in the conference bridge */
@@ -40,6 +40,20 @@
 	OPTION_QUIET = (1 << 8),             /*!< Set if no audio prompts should be played */
 };
 
+enum user_profile_flags {
+	USER_OPT_ADMIN = (1 << 0),             /*!< Set if the caller is an administrator */
+	USER_OPT_MARKEDUSER = (1 << 2),        /*!< Set if the caller is a marked user */
+	USER_OPT_STARTMUTED = (1 << 3),        /*!< Set if the caller should be initially set muted */
+};
+
+enum bridge_profile_flags {
+	BRIDGE_OPT_MUSICONHOLD = (1 << 0),  /*!< Set if music on hold should be played if nobody else is in the conference bridge */
+	BRIDGE_OPT_NOONLYPERSON = (1 << 1), /*!< Set if the "you are currently the only person in this conference" sound file should not be played */
+	BRIDGE_OPT_WAITMARKED = (1 << 2),   /*!< Set if the conference must wait for a marked user before starting */
+	BRIDGE_OPT_QUIET = (1 << 3),        /*!< Set if no audio prompts should be played */
+	BRIDGE_OPT_ANNOUNCEUSERCOUNT = (1 << 4), /*!< Set if the number of users should be announced to the caller */
+};
+
 struct conf_menu {
 	char name[64];
 	int delme;
@@ -47,13 +61,14 @@
 
 struct user_profile {
 	char name[64];
-	enum user_profile_flags flags;
+	unsigned int flags;
 	int volume;
 	int delme;
 };
 
 struct bridge_profile {
 	char name[64];
+	unsigned int flags;
 	unsigned int internal_sample_rate;     /*!< The internal sample rate of the bridge. 0 when set to auto adjust mode. */
 	int delme;
 };

Modified: team/dvossel/hd_confbridge/configs/confbridge.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/configs/confbridge.conf.sample?view=diff&rev=309252&r1=309251&r2=309252
==============================================================================
--- team/dvossel/hd_confbridge/configs/confbridge.conf.sample (original)
+++ team/dvossel/hd_confbridge/configs/confbridge.conf.sample Wed Mar  2 10:44:22 2011
@@ -8,10 +8,28 @@
 ; instances invoked without a user, bridge, or menu argument.
 [default_user]
 type=user
+;admin=yes     ; Sets if the user is an admin or not. Off by default.
+;marked=yes    ; Sets if this is a marked user or not. Off by default.
+;startmuted=yes; Sets if all users should start out muted. Off by default
 
 [default_bridge]
 type=bridge
-internal_sample_rate=auto
+;internal_sample_rate=auto     ; Sets the internal native sample rate the
+                               ; conference is mixed at.  This is set to automatically
+                               ; adjust the sample rate to the best quality by default.
+                               ; Other values can be anything from 8000-192000.  If a
+                               ; sample rate is set that Asterisk does not support, the
+                               ; closest sample rate Asterisk does support to the one requested
+                               ; will be used.
+
+;music_on_hold_when_empty=yes  ; Sets whether MOH should be played when only
+                               ; one person is in the conference.  Off by default.
+;wait_marked=yes      ; Sets if the conference must wait for a marked user
+                      ; to enter before starting. Off by default.
+;quiet=yes            ; Sets if no audio prompts should be played. Off by default
+;announce_user_count=yes  ; Sets if the number of users should be announced to the
+                          ; caller.  Off by default.
+
 
 [default_menu]
 type=menu




More information about the svn-commits mailing list