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

Ivan Poddubny asteriskteam at digium.com
Sat Dec 16 08:01:13 CST 2017


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


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/17/7617/1

diff --git a/main/features.c b/main/features.c
index 516c64a..194a050 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) {
@@ -801,6 +806,10 @@
 		chanb_priority++;
 	}
 	ast_channel_unlock(chanb);
+	moh_is_playing = ast_test_flag(ast_channel_flags(chanb), AST_FLAG_MOH);
+	if (moh_is_playing) {
+		ast_moh_stop(chanb);
+	}
 
 	bridge = ast_bridge_basic_new();
 	if (!bridge) {

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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b129c5a20c15e63968842460ac5a1a85903cf9f
Gerrit-Change-Number: 7617
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/128640d1/attachment.html>


More information about the asterisk-code-review mailing list