diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index dbbccee05..d96735a64 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1364,6 +1364,9 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr call->params = linphone_call_params_copy(params); linphone_call_init_common(call, from, to); + /*reserve the sockets immediately*/ + linphone_call_init_media_streams(call); + call->current_params->update_call_when_ice_completed = call->params->update_call_when_ice_completed; /*copy param*/ linphone_call_fill_media_multicast_addr(call); @@ -6022,10 +6025,6 @@ end: int linphone_call_restart_invite(LinphoneCall *call) { linphone_call_create_op(call); linphone_call_stop_media_streams(call); - ms_media_stream_sessions_uninit(&call->sessions[call->main_audio_stream_index]); - ms_media_stream_sessions_uninit(&call->sessions[call->main_video_stream_index]); - ms_media_stream_sessions_uninit(&call->sessions[call->main_text_stream_index]); - linphone_call_init_media_streams(call); return linphone_call_start_invite(call, NULL); } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 4e3c33d3f..82d14b0b7 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3571,8 +3571,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const if (linphone_call_params_get_local_conference_mode(params) == FALSE) lc->current_call=call; linphone_call_set_state (call,LinphoneCallOutgoingInit,"Starting outgoing call"); call->log->start_date_time=ms_time(NULL); - linphone_call_init_media_streams(call); - + if (linphone_nat_policy_ice_enabled(call->nat_policy)) { if (lc->sip_conf.sdp_200_ack){ ms_warning("ICE is not supported when sending INVITE without SDP");