]> sjero.net Git - linphone/commitdiff
If the remote deactivates a media stream, remove the ICE check list for this stream.
authorGhislain MARY <ghislain.mary@belledonne-communications.com>
Wed, 3 Oct 2012 13:23:13 +0000 (15:23 +0200)
committerGhislain MARY <ghislain.mary@belledonne-communications.com>
Wed, 3 Oct 2012 13:24:13 +0000 (15:24 +0200)
coreapi/misc.c

index 935ec54f35de4d4e7403270f15dcd75633db06da..94110fc846f4a1b31de4379c0c50719f89784f40 100644 (file)
@@ -871,8 +871,10 @@ void linphone_core_update_ice_from_remote_media_description(LinphoneCall *call,
                                                break;
                                }
                        }
-                       if ((stream->ice_mismatch == TRUE) || (stream->rtp_port == 0)) {
+                       if (stream->ice_mismatch == TRUE) {
                                ice_check_list_set_state(cl, ICL_Failed);
+                       } else if (stream->rtp_port == 0) {
+                               ice_session_remove_check_list(call->ice_session, ice_session_check_list(call->ice_session, i));
                        } else {
                                if ((stream->ice_pwd[0] != '\0') && (stream->ice_ufrag[0] != '\0'))
                                        ice_check_list_set_remote_credentials(cl, stream->ice_ufrag, stream->ice_pwd);
@@ -940,7 +942,9 @@ void linphone_core_deactivate_ice_for_deactivated_media_streams(LinphoneCall *ca
        for (i = 0; i < md->nstreams; i++) {
                IceCheckList *cl = ice_session_check_list(call->ice_session, i);
                if (cl && (md->streams[i].rtp_port == 0)) {
-                       if (ice_check_list_state(cl) != ICL_Completed) ice_check_list_set_state(cl, ICL_Failed);
+                       if (ice_check_list_state(cl) != ICL_Completed) {
+                               ice_session_remove_check_list(call->ice_session, cl);
+                       }
                }
        }
 }