From: Ivan Poddubny Date: Sat, 16 Dec 2017 13:51:16 +0000 (+0100) Subject: bridge: Stop music on hold on adding an arbitrary channel to a bridge X-Git-Tag: 13.19.0-rc1~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fef23297b746ac994466f61ee030eb780d497ae3;p=thirdparty%2Fasterisk.git bridge: Stop music on hold on adding an arbitrary channel to a bridge When a channel that is on hold gets added to a bridge by the Bridge AMI action or the dialplan application of the same name, music continues to play, causing "robotic sound". This commit adds a call to ast_moh_stop to stop the music. Also, it makes the AMI Park action use the right MOH class when the channel gets parked. Reported by: Zane Conkle ASTERISK-25079 #close Change-Id: I4b129c5a20c15e63968842460ac5a1a85903cf9f --- diff --git a/main/bridge.c b/main/bridge.c index f689b297f9..5e065fb35b 100644 --- a/main/bridge.c +++ b/main/bridge.c @@ -2495,6 +2495,8 @@ int ast_bridge_add_channel(struct ast_bridge *bridge, struct ast_channel *chan, RAII_VAR(struct ast_bridge *, chan_bridge, NULL, ao2_cleanup); RAII_VAR(struct ast_channel *, yanked_chan, NULL, ao2_cleanup); + ast_moh_stop(chan); + ast_channel_lock(chan); chan_bridge = ast_channel_get_bridge(chan); ast_channel_unlock(chan);