[Asterisk-code-review] features: Stop music on hold in Bridge AMI action (asterisk[master])

Ivan Poddubny asteriskteam at digium.com
Sat Dec 16 07:58:16 CST 2017


Ivan Poddubny has uploaded this change for review. ( https://gerrit.asterisk.org/7615


Change subject: features: Stop music on hold in Bridge AMI action
......................................................................

features: Stop music on hold in Bridge AMI action

Before Asterisk 12, the Bridge action handler called ast_stop_moh on
both channels, but the new implementation doesn't do it, so when one
of the channels is on hold, it stays on hold while also being
in a bridge, resulting in "robotic sound".

Reported by: Zane Conkle

ASTERISK-25079 #close

Change-Id: I4b129c5a20c15e63968842460ac5a1a85903cf9f
---
M main/features.c
1 file changed, 9 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/15/7615/1

diff --git a/main/features.c b/main/features.c
index 516c64a..5482d3f 100644
--- a/main/features.c
+++ b/main/features.c
@@ -758,6 +758,7 @@
 	int chanb_priority;
 	struct ast_bridge *bridge;
 	char buf[256];
+	int moh_is_playing;
 	RAII_VAR(struct ast_features_xfer_config *, xfer_cfg_a, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_features_xfer_config *, xfer_cfg_b, NULL, ao2_cleanup);
 
@@ -785,6 +786,10 @@
 		chana_priority++;
 	}
 	ast_channel_unlock(chana);
+	moh_is_playing = ast_test_flag(ast_channel_flags(chana), AST_FLAG_MOH);
+	if (moh_is_playing) {
+		ast_moh_stop(chana);
+	}
 
 	chanb = ast_channel_get_by_name_prefix(channelb, strlen(channelb));
 	if (!chanb) {
@@ -793,6 +798,10 @@
 		return 0;
 	}
 	ast_channel_lock(chanb);
+	moh_is_playing = ast_test_flag(ast_channel_flags(chanb), AST_FLAG_MOH);
+	if (moh_is_playing) {
+		ast_moh_stop(chanb);
+	}
 	xfer_cfg_b = ast_get_chan_features_xfer_config(chanb);
 	chanb_exten = ast_strdupa(ast_channel_exten(chanb));
 	chanb_context = ast_strdupa(ast_channel_context(chanb));

-- 
To view, visit https://gerrit.asterisk.org/7615
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b129c5a20c15e63968842460ac5a1a85903cf9f
Gerrit-Change-Number: 7615
Gerrit-PatchSet: 1
Gerrit-Owner: Ivan Poddubny <ivan.poddubny at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171216/f4cdc635/attachment.html>


More information about the asterisk-code-review mailing list