[asterisk-commits] mjordan: branch mjordan/AST_18204 r343280 - in /team/mjordan/AST_18204/apps: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 3 10:54:51 CDT 2011


Author: mjordan
Date: Thu Nov  3 10:54:47 2011
New Revision: 343280

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=343280
Log:
Fixes from review

Modified:
    team/mjordan/AST_18204/apps/app_confbridge.c
    team/mjordan/AST_18204/apps/confbridge/conf_config_parser.c

Modified: team/mjordan/AST_18204/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/AST_18204/apps/app_confbridge.c?view=diff&rev=343280&r1=343279&r2=343280
==============================================================================
--- team/mjordan/AST_18204/apps/app_confbridge.c (original)
+++ team/mjordan/AST_18204/apps/app_confbridge.c Thu Nov  3 10:54:47 2011
@@ -1555,11 +1555,14 @@
 static int action_toggle_mute_participants(struct conference_bridge *conference_bridge, struct conference_bridge_user *conference_bridge_user)
 {
 	struct conference_bridge_user *participant = NULL;
+	const char *sound_to_play;
 
 	ao2_lock(conference_bridge);
 
-	/* If already muted, then unmute. */
-	conference_bridge->muted = (!conference_bridge->muted ? 1 : 0);
+	/* If already muted, then unmute */
+	conference_bridge->muted = conference_bridge->muted ? 0 : 1;
+	sound_to_play = conf_get_sound((conference_bridge->muted ? CONF_SOUND_PARTICIPANTS_MUTED : CONF_SOUND_PARTICIPANTS_UNMUTED),
+		conference_bridge_user->b_profile.sounds);
 
 	AST_LIST_TRAVERSE(&conference_bridge->users_list, participant, list) {
 		if (!ast_test_flag(&participant->u_profile, USER_OPT_ADMIN)) {
@@ -1567,19 +1570,16 @@
 		}
 	}
 
+	ao2_unlock(conference_bridge);
+
 	/* The host needs to hear it seperately, as they don't get the audio from play_sound_helper */
-	ast_stream_and_wait(conference_bridge_user->chan, (conference_bridge->muted ?
-		conf_get_sound(CONF_SOUND_PARTICIPANTS_MUTED, conference_bridge_user->b_profile.sounds) :
-		conf_get_sound(CONF_SOUND_PARTICIPANTS_UNMUTED, conference_bridge_user->b_profile.sounds)),
-		"");
-
-	/* Announce to the group that all participants are muted. */
-	play_sound_helper(conference_bridge, (conference_bridge->muted ?
-		conf_get_sound(CONF_SOUND_PARTICIPANTS_MUTED, conference_bridge_user->b_profile.sounds) :
-		conf_get_sound(CONF_SOUND_PARTICIPANTS_UNMUTED, conference_bridge_user->b_profile.sounds)),
-		0);
-
-	ao2_unlock(conference_bridge);
+	ast_stream_and_wait(conference_bridge_user->chan, sound_to_play, "");
+
+	/* Announce to the group that all participants are muted */
+	ast_autoservice_start(conference_bridge_user->chan);
+	play_sound_helper(conference_bridge, sound_to_play, 0);
+	ast_autoservice_stop(conference_bridge_user->chan);
+
 	return 0;
 }
 

Modified: team/mjordan/AST_18204/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/AST_18204/apps/confbridge/conf_config_parser.c?view=diff&rev=343280&r1=343279&r2=343280
==============================================================================
--- team/mjordan/AST_18204/apps/confbridge/conf_config_parser.c (original)
+++ team/mjordan/AST_18204/apps/confbridge/conf_config_parser.c Thu Nov  3 10:54:47 2011
@@ -1380,8 +1380,9 @@
 				conf_bridge_profile_copy(result, &b_data->b_profile);
 				return result;
 			}
-		}
-		ast_channel_unlock(chan);
+		} else {
+			ast_channel_unlock(chan);
+		}
 	}
 	if (ast_strlen_zero(bridge_profile_name)) {
 		bridge_profile_name = DEFAULT_BRIDGE_PROFILE;




More information about the asterisk-commits mailing list