Commit 884cc808 authored by Simon Morlat's avatar Simon Morlat

fix issue with video stream not started if ICE gathering is not performed.

parent 51650875
......@@ -2370,11 +2370,13 @@ int linphone_call_prepare_ice(LinphoneCall *call, bool_t incoming_offer){
if (call->params->realtimetext_enabled && call->textstream->ms.state==MSStreamInitialized) {
text_stream_prepare_text(call->textstream);
}
if ((err=linphone_core_gather_ice_candidates(call->core,call))<0) {
/* Ice candidates gathering failed, proceed with the call anyway. */
linphone_call_delete_ice_session(call);
err = linphone_core_gather_ice_candidates(call->core,call);
if (err == 0) {
/* Ice candidates gathering wasn't started, but we can proceed with the call anyway. */
linphone_call_stop_media_streams_for_ice_gathering(call);
}else if (err == -1) {
linphone_call_stop_media_streams_for_ice_gathering(call);
linphone_call_delete_ice_session(call);
}
return err;/* 1= gathering in progress, wait; 0=proceed*/
}
......
......@@ -726,6 +726,11 @@ static const struct addrinfo * get_preferred_stun_server_addrinfo(const struct a
return preferred_ai;
}
/* Return values:
* 1 : STUN gathering is started
* 0 : no STUN gathering is started, but it's ok to proceed with ICE anyway (with local candidates only or because STUN gathering was already done before)
* -1: no gathering started and something went wrong with local candidates. There is no way to start the ICE session.
*/
int linphone_core_gather_ice_candidates(LinphoneCore *lc, LinphoneCall *call){
char local_addr[64];
const struct addrinfo *ai = NULL;
......
......@@ -883,6 +883,9 @@ static void _call_with_ice_video(LinphoneVideoPolicy caller_policy, LinphoneVide
linphone_core_set_video_policy(marie->lc, &callee_policy);
linphone_core_set_firewall_policy(marie->lc, LinphonePolicyUseIce);
linphone_core_set_firewall_policy(pauline->lc, LinphonePolicyUseIce);
linphone_core_manager_wait_for_stun_resolution(marie);
linphone_core_manager_wait_for_stun_resolution(pauline);
/* This is to activate media relay on Flexisip server.
* Indeed, we want to test ICE with relay candidates as well, even though
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment