]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_sdp_rtp: Only do hold/unhold on default audio stream.
authorJoshua C. Colp <jcolp@sangoma.com>
Thu, 19 Mar 2020 18:34:02 +0000 (15:34 -0300)
committerKevin Harwell <kharwell@digium.com>
Wed, 25 Mar 2020 20:21:58 +0000 (15:21 -0500)
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

res/res_pjsip_sdp_rtp.c

index 359b2d611e110aadd7429be6b5367ac51179f056..d30116095a6305b547486b4f0270738832636341 100644 (file)
@@ -1430,18 +1430,20 @@ static int negotiate_incoming_sdp_stream(struct ast_sip_session *session,
        /* 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 (set_caps(session, session_media, session_media_transport, stream, 1, asterisk_stream)) {