From 6ccfd1453097b423b2bbad4b2040a3584dae3f9f Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 29 Sep 2020 16:23:56 -0400 Subject: [PATCH] TT#94201 change default ICE= behaviour, add new =optional flag Change-Id: Ie510bc05879c91eb1a0c7d7351461a63056ba410 --- README.md | 8 +++++--- daemon/call_interfaces.c | 3 +++ include/call_interfaces.h | 4 ++-- t/auto-daemon-tests.pl | 14 +++++++------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9d00aed29..c9838d7c5 100644 --- a/README.md +++ b/README.md @@ -888,10 +888,12 @@ Optionally included keys are: type candidates, and *rtpengine* inserts itself as a `relay` candidate. It will also leave SDP 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 + With `optional`, 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. + low-priority candidate. This used to be the default behaviour in previous versions of + *rtpengine*. + + The default behaviour (no `ICE` key present at all) is the same as `default`. This flag operates independently of the `replace` flags. diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 7252dca7f..06dbf9e34 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -935,6 +935,9 @@ static void call_ng_process_flags(struct sdp_ng_flags *out, bencode_item_t *inpu case CSH_LOOKUP("default"): out->ice_option = ICE_DEFAULT; break; + case CSH_LOOKUP("optional"): + out->ice_option = ICE_OPTIONAL; + break; case CSH_LOOKUP("force_relay"): case CSH_LOOKUP("force-relay"): case CSH_LOOKUP("force relay"): diff --git a/include/call_interfaces.h b/include/call_interfaces.h index 2c6980709..88ccc0677 100644 --- a/include/call_interfaces.h +++ b/include/call_interfaces.h @@ -48,11 +48,11 @@ struct sdp_ng_flags { GHashTable *sdes_no; str dtls_fingerprint; enum { - ICE_NONE = 0, + ICE_DEFAULT = 0, ICE_REMOVE, ICE_FORCE, ICE_FORCE_RELAY, - ICE_DEFAULT, + ICE_OPTIONAL, } ice_option:3; int asymmetric:1, protocol_accept:1, diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 97fe6c092..3632f619b 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -6200,7 +6200,7 @@ SDP new_call; -offer('plain SDP, add default ICE', { }, < 'optional' }, < 'optional' }, < '3.4.5.6', - flags => ['full-rtcp-attribute'], }, < ['full-rtcp-attribute'], ICE => 'optional', }, < 'optional' }, < 'optional' }, < 'optional' }, < 'optional' }, <