--- apps/app_confbridge.c.patched 2012-03-23 14:30:04.427415542 -0600 +++ apps/app_confbridge.c 2012-04-05 13:13:40.040846822 -0600 @@ -748,6 +748,9 @@ conference_bridge_user->playing_moh = 0; ast_moh_stop(conference_bridge_user->chan); ast_bridge_unsuspend(conference_bridge->bridge, conference_bridge_user->chan); + if (!conference_bridge_user->forced_mute) { + conference_bridge_user->features.mute = 0; + } } else { return -1; } @@ -826,8 +829,8 @@ if (other_conference_bridge_user == conference_bridge_user) { continue; } - /* only unmute them if they are not supposed to start muted */ - if (!ast_test_flag(&other_conference_bridge_user->u_profile, USER_OPT_STARTMUTED)) { + /* only unmute them if they are not supposed to be muted */ + if (!other_conference_bridge_user->forced_mute) { other_conference_bridge_user->features.mute = 0; } } @@ -836,8 +839,7 @@ if (conference_bridge->markedusers) { return 0; } - /* Be sure we are muted so we can't talk to anybody else waiting */ - conference_bridge_user->features.mute = 1; + /* If we have not been quieted play back that they are waiting for the leader */ if (!ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_QUIET)) { if (play_prompt_to_channel(conference_bridge, @@ -856,10 +858,9 @@ if (ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_MUSICONHOLD) && ((ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_WAITMARKED) && !conference_bridge->markedusers) || conference_bridge_bridge->users == 1) ) { - if (!conference_bridge_user->playing_moh) { - ast_moh_start(conference_bridge_user->chan, conference_bridge_user->u_profile.moh_class, NULL); - conference_bridge_user->playing_moh = 1; - } + ast_moh_start(conference_bridge_user->chan, conference_bridge_user->u_profile.moh_class, NULL); + conference_bridge_user->playing_moh = 1; + conference_bridge_user->features.mute = 1; } return 0; @@ -902,6 +903,9 @@ nonwaiting_participants += 1; if (ast_test_flag(&other_conference_bridge_user->u_profile, USER_OPT_MUSICONHOLD)) { turn_off_moh(conference_bridge, other_conference_bridge_user); + if (!other_conference_bridge_user->forced_mute) { + other_conference_bridge_user->features.mute = 0; + } } } } @@ -909,6 +913,7 @@ if (!nonwaiting_participants && ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_MUSICONHOLD)) { ast_moh_start(conference_bridge_user->chan, conference_bridge_user->u_profile.moh_class, NULL); conference_bridge_user->playing_moh = 1; + conference_bridge_user->features.mute = 1; return 0; /* No point in announcing participant-count if the user is on hold */ } @@ -1182,6 +1187,7 @@ if (!ast_bridge_suspend(conference_bridge->bridge, other_participant->chan)) { ast_moh_start(other_participant->chan, other_participant->u_profile.moh_class, NULL); other_participant->playing_moh = 1; + other_participant->features.mute = 1; ast_bridge_unsuspend(conference_bridge->bridge, other_participant->chan); } } @@ -1530,6 +1536,7 @@ /* If the caller should be joined already muted, make it so */ if (ast_test_flag(&conference_bridge_user.u_profile, USER_OPT_STARTMUTED)) { + conference_bridge_user.forced_mute = 1; conference_bridge_user.features.mute = 1; } @@ -1653,6 +1660,7 @@ /* Mute or unmute yourself, note we only allow manipulation if they aren't waiting for a marked user or if marked users exist */ if (!ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_WAITMARKED) || conference_bridge->markedusers) { conference_bridge_user->features.mute = (!conference_bridge_user->features.mute ? 1 : 0); + conference_bridge_user->forced_mute = conference_bridge_user->features.mute; ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", ast_channel_name(chan), conference_bridge_user->features.mute ? "muted" : "unmuted", conference_bridge_user->b_profile.name, ast_channel_name(chan)); } return ast_stream_and_wait(chan, (conference_bridge_user->features.mute ? @@ -1676,6 +1684,7 @@ AST_LIST_TRAVERSE(&conference_bridge->users_list, participant, list) { if (!ast_test_flag(&participant->u_profile, USER_OPT_ADMIN)) { participant->features.mute = conference_bridge->muted; + participant->forced_mute = conference_bridge->muted; } } @@ -2172,8 +2181,12 @@ if (!ast_bridge_suspend(bridge->bridge, participant->chan)) { if (participant->forced_moh) { ast_moh_start(participant->chan, participant->u_profile.moh_class, NULL); + participant->features.mute = 1; } else { ast_moh_stop(participant->chan); + if (!participant->forced_mute) { + participant->features.mute = 0; + } } ast_bridge_unsuspend(bridge->bridge, participant->chan); } @@ -2275,6 +2288,7 @@ } if (participant) { participant->features.mute = mute; + participant->forced_mute = mute; ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", ast_channel_name(participant->chan), participant->features.mute ? "muted" : "unmuted", bridge->b_profile.name, ast_channel_name(participant->chan)); } else { res = -2;; --- apps/confbridge/include/confbridge.h.patched 2012-04-05 11:43:01.659473388 -0600 +++ apps/confbridge/include/confbridge.h 2012-04-05 11:43:12.627472988 -0600 @@ -230,6 +230,7 @@ unsigned int kicked:1; /*!< User has been kicked from the conference */ unsigned int playing_moh:1; /*!< MOH is currently being played to the user */ unsigned int forced_moh:1; /*!< The user has been explicitly placed on hold and should not be subject to automatic toggles */ + unsigned int forced_mute:1; /*!< The user has been explicitly placed on hold and should not be subject to automatic toggles */ AST_LIST_ENTRY(conference_bridge_user) list; /*!< Linked list information */ };