From da0836c53905b2f9925e07fb6d698147ceb97ec3 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 25 Aug 2011 09:17:50 -0500 Subject: [PATCH] FS-3518 --resolve this was an issue specific to mute-detect-sound and muting someone right when it decided to play the mute detect sound, fixed with a queued flag so only 1 thread ever plays sounds to the channel --- .../mod_conference/mod_conference.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 8217130ed6..b99ee84160 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -145,7 +145,8 @@ typedef enum { MFLAG_INDICATE_MUTE = (1 << 17), MFLAG_INDICATE_UNMUTE = (1 << 18), MFLAG_NOMOH = (1 << 19), - MFLAG_VIDEO_BRIDGE = (1 << 20) + MFLAG_VIDEO_BRIDGE = (1 << 20), + MFLAG_INDICATE_MUTE_DETECT = (1 << 21) } member_flag_t; typedef enum { @@ -2359,7 +2360,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v if (switch_test_flag(member, MFLAG_MUTE_DETECT) && !switch_test_flag(member, MFLAG_CAN_SPEAK)) { if (!zstr(member->conference->mute_detect_sound)) { - conference_member_play_file(member, member->conference->mute_detect_sound, 0); + switch_set_flag(member, MFLAG_INDICATE_MUTE_DETECT); } if (test_eflag(member->conference, EFLAG_MUTE_DETECT) && @@ -2850,6 +2851,18 @@ static void conference_loop_output(conference_member_t *member) } switch_clear_flag(member, MFLAG_INDICATE_MUTE); } + + if (switch_test_flag(member, MFLAG_INDICATE_MUTE_DETECT)) { + if (!zstr(member->conference->mute_detect_sound)) { + conference_member_play_file(member, member->conference->mute_detect_sound, 0); + } else { + char msg[512]; + + switch_snprintf(msg, sizeof(msg), "Currently Muted"); + conference_member_say(member, msg, 0); + } + switch_clear_flag(member, MFLAG_INDICATE_MUTE_DETECT); + } if (switch_test_flag(member, MFLAG_INDICATE_UNMUTE)) { if (!zstr(member->conference->unmuted_sound)) {