[Asterisk-code-review] chan_pjsip: fix music on hold continues after INVITE with replaces (asterisk[master])

George Joseph asteriskteam at digium.com
Mon Apr 10 13:36:00 CDT 2023


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/20051 )

Change subject: chan_pjsip: fix music on hold continues after INVITE with replaces
......................................................................

chan_pjsip: fix music on hold continues after INVITE with replaces

In a three party scenario with INVITE with replaces, we need to
unhold the call, otherwise one party continues to get music on
hold, and the call is not properly bridged between them.

ASTERISK-30428

Change-Id: I5675df11e739be5226b328f8828d4b8d81fbefb4
---
M res/res_pjsip_refer.c
1 file changed, 19 insertions(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved; Approved for Submit




diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c
index 8890d23..a20bf6b 100644
--- a/res/res_pjsip_refer.c
+++ b/res/res_pjsip_refer.c
@@ -1019,6 +1019,10 @@
 	ast_debug(3, "INVITE with Replaces being attempted.  '%s' --> '%s'\n",
 		ast_channel_name(session->channel), ast_channel_name(invite.channel));
 
+	/* Unhold the channel now, as later we are not having access to it anymore */
+	ast_queue_unhold(session->channel);
+	ast_queue_frame(session->channel, &ast_null_frame);
+
 	if (!invite.bridge) {
 		struct ast_channel *chan = session->channel;
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/20051
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I5675df11e739be5226b328f8828d4b8d81fbefb4
Gerrit-Change-Number: 20051
Gerrit-PatchSet: 2
Gerrit-Owner: Henning Westerholt <hw at gilawa.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230410/836cd7e9/attachment-0001.html>


More information about the asterisk-code-review mailing list