[Asterisk-code-review] features: Stop music on hold in Bridge AMI action (asterisk[13])
Ivan Poddubny
asteriskteam at digium.com
Sat Dec 16 08:01:01 CST 2017
Ivan Poddubny has uploaded this change for review. ( https://gerrit.asterisk.org/7616
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/16/7616/1
diff --git a/main/features.c b/main/features.c
index 2ca56bc..a89ae51 100644
--- a/main/features.c
+++ b/main/features.c
@@ -761,6 +761,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);
@@ -788,6 +789,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) {
@@ -804,6 +809,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/7616
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b129c5a20c15e63968842460ac5a1a85903cf9f
Gerrit-Change-Number: 7616
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/e1ce9649/attachment-0001.html>
More information about the asterisk-code-review
mailing list