--- asterisk-10/apps/app_confbridge.c 2011-08-01 18:28:52.000000000 -0500 +++ asterisk/apps/app_confbridge.c 2011-08-01 18:40:39.000000000 -0500 @@ -34,7 +34,7 @@ #include "asterisk.h" -ASTERISK_FILE_VERSION(__FILE__, "$Revision: 330163 $") +ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328259 $") #include #include @@ -340,6 +340,10 @@ return S_OR(custom_sounds->join, "confbridge-join"); case CONF_SOUND_LEAVE: return S_OR(custom_sounds->leave, "confbridge-leave"); + case CONF_SOUND_PARTICIPANTS_MUTED: + return S_OR(custom_sounds->participantsmuted, "conf-participants-muted"); + case CONF_SOUND_PARTICIPANTS_UNMUTED: + return S_OR(custom_sounds->participantsunmuted, "conf-participants-unmuted"); } return ""; @@ -1547,6 +1551,37 @@ ""); } +static int action_toggle_mute_participants(struct conference_bridge *conference_bridge, struct conference_bridge_user *conference_bridge_user) +{ + struct conference_bridge_user *participant = NULL; + + ao2_lock(conference_bridge); + + /* If already muted, then unmute. */ + conference_bridge->muted = (!conference_bridge->muted ? 1 : 0); + + 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; + } + } + + /* 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); + + /* The host needs to hear it too because 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 ) ), + "" ); + + ao2_unlock(conference_bridge); + return 0; +} + static int action_playback(struct ast_bridge_channel *bridge_channel, const char *playback_file) { char *file_copy = ast_strdupa(playback_file); @@ -1726,6 +1761,12 @@ conference_bridge_user, bridge_channel->chan); break; + case MENU_ACTION_ADMIN_TOGGLE_MUTE_PARTICIPANTS: + action_toggle_mute_participants(conference_bridge, conference_bridge_user); + break; + case MENU_ACTION_PARTICIPANT_COUNT: + announce_user_count(conference_bridge, conference_bridge_user); + break; case MENU_ACTION_PLAYBACK: if (!stop_prompts) { res |= action_playback(bridge_channel, menu_action->data.playback_file); @@ -1943,14 +1984,15 @@ ast_cli(a->fd, "No conference bridge named '%s' found!\n", a->argv[2]); return CLI_SUCCESS; } - ast_cli(a->fd, "Channel User Profile Bridge Profile Menu\n"); - ast_cli(a->fd, "============================= ================ ================ ================\n"); + ast_cli(a->fd, "Channel User Profile Bridge Profile Menu CallerID\n"); + ast_cli(a->fd, "============================= ================ ================ ================ ================\n"); ao2_lock(bridge); AST_LIST_TRAVERSE(&bridge->users_list, participant, list) { ast_cli(a->fd, "%-29s ", participant->chan->name); ast_cli(a->fd, "%-17s", participant->u_profile.name); ast_cli(a->fd, "%-17s", participant->b_profile.name); ast_cli(a->fd, "%-17s", participant->menu_name); + ast_cli(a->fd, "%-17s", S_COR(participant->chan->caller.id.number.valid, participant->chan->caller.id.number.str, "")); ast_cli(a->fd, "\n"); } ao2_unlock(bridge);