]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
bridge_softmix: clear hold when joining a softmix bridge
authorKevin Harwell <kharwell@digium.com>
Wed, 13 Nov 2019 23:24:48 +0000 (17:24 -0600)
committerKevin Harwell <kharwell@digium.com>
Wed, 13 Nov 2019 23:54:26 +0000 (18:54 -0500)
MOH continues to play to a channel if that channel was on hold prior to
entering a softmix bridge. MOH will not stop even if the original "holder"
attempts an unhold.

For the most part a softmix bridge ignores holds, so a participating channel
shouldn't join while on hold. This patch checks to see if the channel joining
the softmix bridge is currently on hold. If so then it indicates an unhold.

ASTERISK-28618

Change-Id: I66ccd4efc80f5b4c3dd68186b379eb442916392b

bridges/bridge_softmix.c

index fbe15873e728e0ade08ca0a9f99163fd9e652cde..0febc46bdca35be1cdbd6c21cd1636a310833de6 100644 (file)
@@ -479,6 +479,13 @@ static int softmix_bridge_join(struct ast_bridge *bridge, struct ast_bridge_chan
                        : DEFAULT_SOFTMIX_INTERVAL,
                bridge_channel, 0);
 
+       /* Complete any active hold before entering, or transitioning to softmix. */
+       if (ast_channel_hold_state(bridge_channel->chan) == AST_CONTROL_HOLD) {
+               ast_debug(1, "Channel %s simulating UNHOLD for bridge softmix join.\n",
+                       ast_channel_name(bridge_channel->chan));
+               ast_indicate(bridge_channel->chan, AST_CONTROL_UNHOLD);
+       }
+
        softmix_poke_thread(softmix_data);
        return 0;
 }