From 52766069426b9e6d2f24c15c5f3d2037d51826de Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 23 Aug 2012 09:57:10 +0200 Subject: [PATCH] Do not delete ICE session when it is in the Failed state. If the ICE session is deleted it can not be restarted later. However try to send a re-invite if the session state is Failed but some check lists have completed successfully. --- coreapi/linphonecall.c | 8 +++++++- coreapi/misc.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 340f02cc3..4ffb699b2 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1718,7 +1718,13 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){ } break; case IS_Failed: - linphone_call_delete_ice_session(call); + if (ice_session_has_completed_check_list(call->ice_session) == TRUE) { + if (ice_session_role(call->ice_session) == IR_Controlling) { + /* At least one ICE session has succeeded, so perform a call update. */ + ice_session_select_candidates(call->ice_session); + linphone_core_update_call(call->core, call, &call->current_params); + } + } break; default: break; diff --git a/coreapi/misc.c b/coreapi/misc.c index e5aa6ec2c..3f48b419b 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -808,7 +808,7 @@ void linphone_core_update_ice_from_remote_media_description(LinphoneCall *call, } ice_session_check_mismatch(call->ice_session); } - if ((ice_session_state(call->ice_session) == IS_Failed) || (ice_session_nb_check_lists(call->ice_session) == 0)) { + if (ice_session_nb_check_lists(call->ice_session) == 0) { linphone_call_delete_ice_session(call); } }