From afb1d9606816b3e44ecb3d4e79f1092f75fbda96 Mon Sep 17 00:00:00 2001
From: Matthew Jordan <mjordan@digium.com>
Date: Tue, 21 May 2013 18:45:57 +0000
Subject: [PATCH] Raise the ConfBridgeMute/Unmute events when a CLI or AMI
 action triggers the change

New in 12 are the ConfBridgeMute/Unmute events, which are triggered when a user
changes their mute/unmute state. This was typically triggered when a user hit a
DTMF key that triggered the mute/unmute menu handler. Forgotten in this is when an
AMI action or CLI command triggers the mute/unmute. This patch now raises the
events in those situations as well.

(closes issue ASTERISK-21802)
Reported by: Birger "WIMPy" Harzenetter

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 apps/app_confbridge.c                | 8 +++++++-
 apps/confbridge/confbridge_manager.c | 1 -
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index 5107bcd5cc..d52c882958 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -2332,7 +2332,13 @@ static int generic_mute_unmute_helper(int mute, const char *conference_name, con
 	}
 	if (user) {
 		user->features.mute = mute;
-		ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", ast_channel_name(user->chan), user->features.mute ? "muted" : "unmuted", conference->b_profile.name, ast_channel_name(user->chan));
+		ast_channel_lock(user->chan);
+		if (user->features.mute) {
+			send_mute_event(user->chan, conference);
+		} else {
+			send_unmute_event(user->chan, conference);
+		}
+		ast_channel_unlock(user->chan);
 	} else {
 		res = -2;;
 	}
diff --git a/apps/confbridge/confbridge_manager.c b/apps/confbridge/confbridge_manager.c
index 56fedb98e8..c25edc3778 100644
--- a/apps/confbridge/confbridge_manager.c
+++ b/apps/confbridge/confbridge_manager.c
@@ -161,7 +161,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 			</see-also>
 		</managerEventInstance>
 	</managerEvent>
-
 	<managerEvent language="en_US" name="ConfbridgeTalking">
 		<managerEventInstance class="EVENT_FLAG_CALL">
 			<synopsis>Raised when a confbridge participant unmutes.</synopsis>
-- 
GitLab