Commit cec1d35f authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Handle the case where ICE is activated locally but the remote does not support it.

parent df347a97
......@@ -396,13 +396,17 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
call->localdesc=create_local_media_description (lc,call);
call->camera_active=call->params.has_video;
switch (linphone_core_get_firewall_policy(call->core)) {
case LinphonePolicyUseStun:
linphone_core_run_stun_tests(call->core,call);
break;
case LinphonePolicyUseIce:
linphone_core_gather_ice_candidates(call->core, call);
break;
case LinphonePolicyUseStun:
linphone_core_run_stun_tests(call->core,call);
/* No break to also destroy ice session in this case. */
default:
if (sal_op_get_ice_session(call->op) != NULL) {
ice_session_destroy(sal_op_get_ice_session(call->op));
sal_op_set_ice_session(call->op, NULL);
}
break;
}
discover_mtu(lc,linphone_address_get_domain(from));
......
......@@ -689,6 +689,11 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc, IceS
ice_session_set_remote_credentials(*ice_session, ice_ufrag, ice_pwd);
ice_dump_session(*ice_session);
}
if ((ice_session_just_created == FALSE) && ((ice_ufrag == NULL) || (ice_pwd == NULL))) {
/* We started with ICE activated but the peer apparently do not support ICE, so stop using it. */
ice_session_destroy(*ice_session);
*ice_session = NULL;
}
}
return 0;
}
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