]> sjero.net Git - linphone/commitdiff
Remove ICE check lists from media streams that are removed from the SDP.
authorGhislain MARY <ghislain.mary@belledonne-communications.com>
Wed, 1 Aug 2012 13:56:34 +0000 (15:56 +0200)
committerGhislain MARY <ghislain.mary@belledonne-communications.com>
Wed, 1 Aug 2012 13:56:34 +0000 (15:56 +0200)
coreapi/sal_eXosip2_sdp.c

index 1d25d1f51b2de005ae16b97b5a95f917976a2834..1cd88cad71c728843b0d3481a6171de8494d35c9 100644 (file)
@@ -680,6 +680,10 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc, IceS
                        if ((ice_ufrag != NULL) && (ice_pwd != NULL)) {
                                ice_check_list_set_remote_credentials(ice_session_check_list(*ice_session, i), ice_ufrag, ice_pwd);
                        }
+                       if (stream->rtp_port == 0) {
+                               /* This stream has been deactivated by the peer, delete the check list. */
+                               ice_session_remove_check_list(*ice_session, ice_session_check_list(*ice_session, i));
+                       }
                        ice_dump_candidates(ice_session_check_list(*ice_session, i));
                }
        }
@@ -697,6 +701,7 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc, IceS
                }
        }
        if (*ice_session != NULL) {
+               int nb_check_lists;
                if (ice_session_just_created == TRUE) {
                        if (ice_lite == TRUE) {
                                ice_session_set_role(*ice_session, IR_Controlling);
@@ -705,6 +710,9 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc, IceS
                        }
                        ice_session_check_mismatch(*ice_session);
                }
+               while ((nb_check_lists = ice_session_nb_check_lists(*ice_session)) > desc->nstreams) {
+                       ice_session_remove_check_list(*ice_session, ice_session_check_list(*ice_session, nb_check_lists - 1));
+               }
                if ((ice_ufrag != NULL) && (ice_pwd != NULL)) {
                        ice_session_set_remote_credentials(*ice_session, ice_ufrag, ice_pwd);
                        ice_dump_session(*ice_session);