[Asterisk-code-review] chan sip.c: Fix to stop MOH playing on held channel during a... (asterisk[13])

Jason Tomlinson asteriskteam at digium.com
Wed Aug 2 08:53:36 CDT 2017


Jason Tomlinson has uploaded this change for review. ( https://gerrit.asterisk.org/6124


Change subject: chan_sip.c:	Fix to stop MOH playing on held channel during attended transfer
......................................................................

chan_sip.c:	Fix to stop MOH playing on held channel during attended transfer

After the attended transfer happens, the held channel still has
music on hold playing. So simply send an AST_CONTROL_UNHOLD frame to
the new bridge participants to ensure MOH is stopped

ASTERISK-27071

Change-Id: I6a373263d92cf27c513013baefdd72ae1864c2ce
---
M channels/chan_sip.c
1 file changed, 6 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/24/6124/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b19c669..7945fd3 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -25587,6 +25587,7 @@
 		int *nounlock, struct sip_pvt *replaces_pvt, struct ast_channel *replaces_chan)
 {
 	struct ast_channel *c;
+	struct ast_bridge_channel *other;
 	RAII_VAR(struct ast_bridge *, bridge, NULL, ao2_cleanup);
 
 	if (req->ignore) {
@@ -25622,6 +25623,11 @@
 	ast_channel_unlock(replaces_chan);
 
 	if (bridge) {
+		/*Attended transfer is done so stop all music on hold */
+		AST_LIST_TRAVERSE(&bridge->channels, other, entry) {
+			ast_queue_control(other->chan, AST_CONTROL_UNHOLD);
+		}
+
 		if (ast_bridge_impart(bridge, c, replaces_chan, NULL,
 			AST_BRIDGE_IMPART_CHAN_INDEPENDENT)) {
 			ast_hangup(c);

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a373263d92cf27c513013baefdd72ae1864c2ce
Gerrit-Change-Number: 6124
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Tomlinson <j.tomlinson at isi-com.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170802/dbea66a0/attachment.html>


More information about the asterisk-code-review mailing list