]> sjero.net Git - linphone/commitdiff
Set an ICE check list to the Failed state if the corresponding media stream has been...
authorGhislain MARY <ghislain.mary@belledonne-communications.com>
Thu, 23 Aug 2012 14:10:55 +0000 (16:10 +0200)
committerGhislain MARY <ghislain.mary@belledonne-communications.com>
Fri, 24 Aug 2012 08:57:05 +0000 (10:57 +0200)
coreapi/callbacks.c
coreapi/misc.c
coreapi/private.h

index 584191cc49772347109da77bfbb7c749afc44eb5..95d5b81afa50a81c9c850d916930ac29c0f7f0fb 100644 (file)
@@ -46,6 +46,9 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
                call->media_pending=TRUE;
        }
        call->resultdesc=new_md;
+       if (call->ice_session != NULL) {
+               linphone_core_deactivate_ice_for_deactivated_media_streams(call, call->resultdesc);
+       }
        if (call->audiostream && call->audiostream->ticker){
                /* we already started media: check if we really need to restart it*/
                if (oldmd){
index 3f48b419bc585ffad00438da77b78d82ffeb2e95..a657933505d1c446536ea977c2964e0c6da59216 100644 (file)
@@ -813,6 +813,17 @@ void linphone_core_update_ice_from_remote_media_description(LinphoneCall *call,
        }
 }
 
+void linphone_core_deactivate_ice_for_deactivated_media_streams(LinphoneCall *call, const SalMediaDescription *md)
+{
+       int i;
+       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 (cl->state != ICL_Completed) ice_check_list_set_state(cl, ICL_Failed);
+               }
+       }
+}
+
 LinphoneCall * is_a_linphone_call(void *user_pointer){
        LinphoneCall *call=(LinphoneCall*)user_pointer;
        if (call==NULL) return NULL;
index a68615e36c1590fce04216898557ae5e45c5d027..b102dc7b53f10ae13bda1cec5b995f079d5b9a0f 100644 (file)
@@ -224,6 +224,7 @@ void linphone_core_run_stun_tests(LinphoneCore *lc, LinphoneCall *call);
 int linphone_core_gather_ice_candidates(LinphoneCore *lc, LinphoneCall *call);
 void linphone_core_update_local_media_description_from_ice(SalMediaDescription *desc, IceSession *session);
 void linphone_core_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md);
+void linphone_core_deactivate_ice_for_deactivated_media_streams(LinphoneCall *call, const SalMediaDescription *md);
 
 void linphone_core_send_initial_subscribes(LinphoneCore *lc);
 void linphone_core_write_friends_config(LinphoneCore* lc);