TT#37400 do not answer with ICE attributes if no ICE was offered

fixes #561

Change-Id: Ia660f19109404f8edc1dd5c143e797a82d25276d
changes/74/25974/3
Richard Fuchs 7 years ago
parent e1d6c83319
commit b593d57e21

@ -1232,13 +1232,23 @@ static void __ice_offer(const struct sdp_ng_flags *flags, struct call_media *thi
if (flags->ice_remove)
MEDIA_CLEAR(this, ICE);
/* special case: if doing ICE on both sides and ice_force is not set, we cannot
* be sure that media will pass through us, so we have to disable certain features */
if (MEDIA_ISSET(this, ICE) && MEDIA_ISSET(other, ICE) && !flags->ice_force) {
ilog(LOG_DEBUG, "enabling passthrough mode");
MEDIA_SET(this, PASSTHRU);
MEDIA_SET(other, PASSTHRU);
return;
if (!flags->ice_force) {
/* special case: if doing ICE on both sides and ice_force is not set, we cannot
* be sure that media will pass through us, so we have to disable certain features */
if (MEDIA_ISSET(this, ICE) && MEDIA_ISSET(other, ICE)) {
ilog(LOG_DEBUG, "enabling passthrough mode");
MEDIA_SET(this, PASSTHRU);
MEDIA_SET(other, PASSTHRU);
return;
}
// if this is an answer, may see our ICE offer being rejected. if the original offer
// wasn't forcing ICE, then we're only acting as a passthrough and so we must disable
// ICE on the remote side as well. we can use the presence of an ICE agent as a test
// to see whether ICE was originally forced or not.
if (flags->opmode == OP_ANSWER && !MEDIA_ISSET(other, ICE) && !this->ice_agent) {
MEDIA_CLEAR(this, ICE);
return;
}
}
/* determine roles (even if we don't actually do ICE) */

@ -2151,7 +2151,7 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu
if (MEDIA_ISSET(call_media, TRICKLE_ICE) && call_media->ice_agent)
chopper_append_c(chop, "a=ice-options:trickle\r\n");
if (!flags->ice_remove)
if (MEDIA_ISSET(call_media, ICE))
insert_candidates(chop, ps, ps_rtcp, flags, sdp_media);
next:

Loading…
Cancel
Save