[Asterisk-code-review] res_pjsip_sdp_rtp: Only do hold/unhold on default audio stream. (asterisk[master])

Kevin Harwell asteriskteam at digium.com
Wed Mar 25 15:22:11 CDT 2020


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13991 )

Change subject: res_pjsip_sdp_rtp: Only do hold/unhold on default audio stream.
......................................................................

res_pjsip_sdp_rtp: Only do hold/unhold on default audio stream.

When examining a stream to determine hold/unhold information we
only care about the default audio stream. Other streams aren't
used for hold/unhold.

ASTERISK-28784

Change-Id: I7a1f10f07822c4aee1f98a38b9628849b578afe4
---
M res/res_pjsip_sdp_rtp.c
1 file changed, 12 insertions(+), 10 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, approved; Approved for Submit
  George Joseph: Looks good to me, but someone else must approve



diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 7514bff..bc60d41 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -1488,18 +1488,20 @@
 	/* If ICE support is enabled find all the needed attributes */
 	check_ice_support(session, session_media, stream);
 
-	/* Check if incomming SDP is changing the remotely held state */
-	if (ast_sockaddr_isnull(addrs) ||
-		ast_sockaddr_is_any(addrs) ||
-		pjmedia_sdp_media_find_attr2(stream, "sendonly", NULL) ||
-		pjmedia_sdp_media_find_attr2(stream, "inactive", NULL)) {
-		if (!session_media->remotely_held) {
-			session_media->remotely_held = 1;
+	if (ast_sip_session_is_pending_stream_default(session, asterisk_stream) && media_type == AST_MEDIA_TYPE_AUDIO) {
+		/* Check if incomming SDP is changing the remotely held state */
+		if (ast_sockaddr_isnull(addrs) ||
+			ast_sockaddr_is_any(addrs) ||
+			pjmedia_sdp_media_find_attr2(stream, "sendonly", NULL) ||
+			pjmedia_sdp_media_find_attr2(stream, "inactive", NULL)) {
+			if (!session_media->remotely_held) {
+				session_media->remotely_held = 1;
+				session_media->remotely_held_changed = 1;
+			}
+		} else if (session_media->remotely_held) {
+			session_media->remotely_held = 0;
 			session_media->remotely_held_changed = 1;
 		}
-	} else if (session_media->remotely_held) {
-		session_media->remotely_held = 0;
-		session_media->remotely_held_changed = 1;
 	}
 
 	if (apply_cap_to_bundled(session_media, session_media_transport, asterisk_stream,

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I7a1f10f07822c4aee1f98a38b9628849b578afe4
Gerrit-Change-Number: 13991
Gerrit-PatchSet: 3
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200325/48b48281/attachment-0001.html>


More information about the asterisk-code-review mailing list