Browse Source

MT#56447 fix trickle ICE detection

1) a=ice-options can be a session-level attribute. Use the correct
   lookup function to check for both media-level and session-level
   attributes.

2) The RTP endpoint address must be filled in before we do the trickle
   ICE check, which uses 0.0.0.0:9 as determining factor.

3) Adapt a test case.

Change-Id: Ic0caffc85791131173848d28f5a652ad9d9124db
pull/1642/head
Richard Fuchs 3 years ago
parent
commit
2f983cd8b4
2 changed files with 7 additions and 8 deletions
  1. +6
    -6
      daemon/sdp.c
  2. +1
    -2
      t/auto-daemon-tests-websocket.py

+ 6
- 6
daemon/sdp.c View File

@ -1639,7 +1639,7 @@ static void __sdp_ice(struct stream_params *sp, struct sdp_media *media) {
} }
no_cand: no_cand:
if ((attr = attr_get_by_id(&media->attributes, ATTR_ICE_OPTIONS))) {
if ((attr = attr_get_by_id_m_s(media, ATTR_ICE_OPTIONS))) {
if (str_str(&attr->value, "trickle") >= 0) if (str_str(&attr->value, "trickle") >= 0)
SP_SET(sp, TRICKLE_ICE); SP_SET(sp, TRICKLE_ICE);
} }
@ -1822,17 +1822,17 @@ int sdp_streams(const GQueue *sessions, GQueue *streams, struct sdp_ng_flags *fl
sp->index = ++num; sp->index = ++num;
codec_store_init(&sp->codecs, NULL); codec_store_init(&sp->codecs, NULL);
errstr = "No address info found for stream";
if (!flags->fragment
&& fill_endpoint(&sp->rtp_endpoint, media, flags, NULL, media->port_num))
goto error;
__sdp_ice(sp, media); __sdp_ice(sp, media);
if (SP_ISSET(sp, ICE)) { if (SP_ISSET(sp, ICE)) {
// ignore "received from" (SIP-source-address) when ICE is in use // ignore "received from" (SIP-source-address) when ICE is in use
flags->trust_address = 1; flags->trust_address = 1;
} }
errstr = "No address info found for stream";
if (!flags->fragment
&& fill_endpoint(&sp->rtp_endpoint, media, flags, NULL, media->port_num))
goto error;
sp->consecutive_ports = media->port_count; sp->consecutive_ports = media->port_count;
sp->num_ports = sp->consecutive_ports * 2; // only do *=2 for RTP streams? sp->num_ports = sp->consecutive_ports * 2; // only do *=2 for RTP streams?
sp->protocol_str = media->transport; sp->protocol_str = media->transport;


+ 1
- 2
t/auto-daemon-tests-websocket.py View File

@ -1422,12 +1422,12 @@ class TestVideoroom(unittest.TestCase):
"a=group:BUNDLE 0 1\r\n" "a=group:BUNDLE 0 1\r\n"
"a=extmap-allow-mixed\r\n" "a=extmap-allow-mixed\r\n"
"a=msid-semantic: WMS hJifdaJwqEqHxSG0pVbs1DrLAwiHqz7fKlqC\r\n" "a=msid-semantic: WMS hJifdaJwqEqHxSG0pVbs1DrLAwiHqz7fKlqC\r\n"
"a=ice-options:trickle\r\n"
"m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126\r\n" "m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126\r\n"
"c=IN IP4 0.0.0.0\r\n" "c=IN IP4 0.0.0.0\r\n"
"a=rtcp:9 IN IP4 0.0.0.0\r\n" "a=rtcp:9 IN IP4 0.0.0.0\r\n"
"a=ice-ufrag:+JrN\r\n" "a=ice-ufrag:+JrN\r\n"
"a=ice-pwd:TMWORlSHr9fd+0bUNXnlBs5D\r\n" "a=ice-pwd:TMWORlSHr9fd+0bUNXnlBs5D\r\n"
"a=ice-options:trickle\r\n"
"a=fingerprint:sha-256 FD:56:1A:DB:3E:7B:8E:0B:75:4E:2E:49:1A:91:52:E4:69:9E:66:91:FF:34:A2:50:58:72:C0:8E:C2:87:CA:1F\r\n" "a=fingerprint:sha-256 FD:56:1A:DB:3E:7B:8E:0B:75:4E:2E:49:1A:91:52:E4:69:9E:66:91:FF:34:A2:50:58:72:C0:8E:C2:87:CA:1F\r\n"
"a=setup:actpass\r\n" "a=setup:actpass\r\n"
"a=mid:0\r\n" "a=mid:0\r\n"
@ -1464,7 +1464,6 @@ class TestVideoroom(unittest.TestCase):
"a=rtcp:9 IN IP4 0.0.0.0\r\n" "a=rtcp:9 IN IP4 0.0.0.0\r\n"
"a=ice-ufrag:+JrN\r\n" "a=ice-ufrag:+JrN\r\n"
"a=ice-pwd:TMWORlSHr9fd+0bUNXnlBs5D\r\n" "a=ice-pwd:TMWORlSHr9fd+0bUNXnlBs5D\r\n"
"a=ice-options:trickle\r\n"
"a=fingerprint:sha-256 FD:56:1A:DB:3E:7B:8E:0B:75:4E:2E:49:1A:91:52:E4:69:9E:66:91:FF:34:A2:50:58:72:C0:8E:C2:87:CA:1F\r\n" "a=fingerprint:sha-256 FD:56:1A:DB:3E:7B:8E:0B:75:4E:2E:49:1A:91:52:E4:69:9E:66:91:FF:34:A2:50:58:72:C0:8E:C2:87:CA:1F\r\n"
"a=setup:actpass\r\n" "a=setup:actpass\r\n"
"a=mid:1\r\n" "a=mid:1\r\n"


Loading…
Cancel
Save