TT#94201 add ICE=default option

Change-Id: If10e0aa284cc7cc5c1e69855733835bd5b52da31
pull/1099/head
Richard Fuchs 5 years ago
parent e67eb7b57f
commit 95b814553b

@ -873,18 +873,26 @@ Optionally included keys are:
* `ICE` * `ICE`
Contains a string, valid values are `remove`, `force` or `force-relay`. Contains a string which must be one of the following values:
With `remove`, any ICE attributes are
stripped from the SDP body. With `force`, ICE attributes are first stripped, then new attributes are With `remove`, any ICE attributes are stripped from the SDP body.
generated and inserted, which leaves the media proxy as the only ICE candidate. The default behavior
(no `ICE` key present at all) is: if no ICE attributes are present, a new set is generated and the With `force`, ICE attributes are first stripped, then new attributes are
media proxy lists itself as ICE candidate; otherwise, the media proxy inserts itself as a generated and inserted, which leaves the media proxy as the only ICE candidate.
low-priority candidate.
With `default`, the behaviour will be the same as with `force` if the incoming SDP already
had ICE attributes listed. If the incoming SDP did not contain ICE attributes, then no
ICE attributes are added.
With `force-relay`, existing ICE candidates are left in place except `relay` With `force-relay`, existing ICE candidates are left in place except `relay`
type candidates, and *rtpengine* inserts itself as a `relay` candidate. It will also leave SDP type candidates, and *rtpengine* inserts itself as a `relay` candidate. It will also leave SDP
c= and m= lines unchanged. c= and m= lines unchanged.
The default behavior
(no `ICE` key present at all) is: if no ICE attributes are present, a new set is generated and the
media proxy lists itself as ICE candidate; otherwise, the media proxy inserts itself as a
low-priority candidate.
This flag operates independently of the `replace` flags. This flag operates independently of the `replace` flags.
* `transport protocol` * `transport protocol`

@ -1242,7 +1242,12 @@ static void __ice_offer(const struct sdp_ng_flags *flags, struct call_media *thi
/* we offer ICE by default */ /* we offer ICE by default */
if (!MEDIA_ISSET(this, INITIALIZED)) if (!MEDIA_ISSET(this, INITIALIZED))
MEDIA_SET(this, ICE); MEDIA_SET(this, ICE);
if (flags->ice_remove) // unless instructed not to
if (flags->ice_default) {
if (!MEDIA_ISSET(other, ICE))
MEDIA_CLEAR(this, ICE);
}
else if (flags->ice_remove)
MEDIA_CLEAR(this, ICE); MEDIA_CLEAR(this, ICE);
if (flags->passthrough_on) { if (flags->passthrough_on) {

@ -932,6 +932,11 @@ static void call_ng_process_flags(struct sdp_ng_flags *out, bencode_item_t *inpu
case CSH_LOOKUP("force"): case CSH_LOOKUP("force"):
out->ice_force = 1; out->ice_force = 1;
break; break;
case CSH_LOOKUP("default"):
out->ice_default = 1;
out->ice_force = 1;
out->ice_remove = 1;
break;
case CSH_LOOKUP("force_relay"): case CSH_LOOKUP("force_relay"):
case CSH_LOOKUP("force-relay"): case CSH_LOOKUP("force-relay"):
case CSH_LOOKUP("force relay"): case CSH_LOOKUP("force relay"):

@ -58,6 +58,7 @@ struct sdp_ng_flags {
ice_remove:1, ice_remove:1,
ice_force:1, ice_force:1,
ice_force_relay:1, ice_force_relay:1,
ice_default:1,
rtcp_mux_offer:1, rtcp_mux_offer:1,
rtcp_mux_require:1, rtcp_mux_require:1,
rtcp_mux_demux:1, rtcp_mux_demux:1,

Loading…
Cancel
Save