Raise the ConfBridgeMute/Unmute events when a CLI or AMI action triggers the change
authorMatthew Jordan <mjordan@digium.com>
Tue, 21 May 2013 18:45:57 +0000 (18:45 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 21 May 2013 18:45:57 +0000 (18:45 +0000)
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
apps/confbridge/confbridge_manager.c

index 5107bcd..d52c882 100644 (file)
@@ -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;;
        }
index 56fedb9..c25edc3 100644 (file)
@@ -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>