From a4f4d599061dec59e8217f2bf43ce72af9bff234 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 25 Sep 2015 19:23:20 +0200 Subject: [PATCH] fix ICE regression --- coreapi/linphonecore.c | 5 +++-- coreapi/misc.c | 3 +-- coreapi/private.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 982f64f2b..69326bbe8 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3479,10 +3479,10 @@ int linphone_core_start_accept_call_update(LinphoneCore *lc, LinphoneCall *call, linphone_call_make_local_media_description(call); linphone_call_update_remote_session_id_and_ver(call); - linphone_call_stop_ice_for_inactive_streams(call); sal_call_set_local_media_description(call->op,call->localdesc); sal_call_accept(call->op); md=sal_call_get_final_media_description(call->op); + linphone_call_stop_ice_for_inactive_streams(call, md); if (md && !sal_media_description_empty(md)){ linphone_core_update_streams(lc, call, md, next_state); } @@ -3711,12 +3711,13 @@ int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, } linphone_call_update_remote_session_id_and_ver(call); - linphone_call_stop_ice_for_inactive_streams(call); + sal_call_accept(call->op); linphone_core_notify_display_status(lc,_("Connected.")); lc->current_call=call; linphone_call_set_state(call,LinphoneCallConnected,"Connected"); new_md=sal_call_get_final_media_description(call->op); + linphone_call_stop_ice_for_inactive_streams(call, new_md); if (new_md){ linphone_core_update_streams(lc, call, new_md, LinphoneCallStreamsRunning); linphone_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)"); diff --git a/coreapi/misc.c b/coreapi/misc.c index 5381d093e..e68b42d85 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -758,10 +758,9 @@ void linphone_core_update_ice_state_in_call_stats(LinphoneCall *call) linphone_ice_state_to_string(call->stats[LINPHONE_CALL_STATS_AUDIO].ice_state), linphone_ice_state_to_string(call->stats[LINPHONE_CALL_STATS_VIDEO].ice_state)); } -void linphone_call_stop_ice_for_inactive_streams(LinphoneCall *call) { +void linphone_call_stop_ice_for_inactive_streams(LinphoneCall *call, SalMediaDescription *desc) { int i; IceSession *session = call->ice_session; - SalMediaDescription *desc = call->localdesc; if (session == NULL) return; if (ice_session_state(session) == IS_Completed) return; diff --git a/coreapi/private.h b/coreapi/private.h index f12a20173..360164331 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -437,7 +437,7 @@ void linphone_core_adapt_to_network(LinphoneCore *lc, int ping_time_ms, Linphone int linphone_core_gather_ice_candidates(LinphoneCore *lc, LinphoneCall *call); void linphone_core_update_ice_state_in_call_stats(LinphoneCall *call); void linphone_call_stats_fill(LinphoneCallStats *stats, MediaStream *ms, OrtpEvent *ev); -void linphone_call_stop_ice_for_inactive_streams(LinphoneCall *call); +void linphone_call_stop_ice_for_inactive_streams(LinphoneCall *call, SalMediaDescription *result); void _update_local_media_description_from_ice(SalMediaDescription *desc, IceSession *session); void linphone_call_update_local_media_description_from_ice_or_upnp(LinphoneCall *call); void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md);