Browse Source

MT#56447 fix ICE role selection

We're also in controlling role for subscribe answers.

Make sure we don't clobber the source media's ICE options when adding a
subcriptions.

Change-Id: I5361462aefdbbe6411841332b69a8dc4b0e1e013
pull/1642/head
Richard Fuchs 3 years ago
parent
commit
ef99d30754
4 changed files with 17 additions and 14 deletions
  1. +6
    -3
      daemon/call.c
  2. +1
    -1
      t/auto-daemon-tests-pubsub.pl
  3. +9
    -9
      t/auto-daemon-tests-redis.pl
  4. +1
    -1
      t/auto-daemon-tests-websocket.py

+ 6
- 3
daemon/call.c View File

@ -1620,7 +1620,7 @@ static void __ice_offer(const struct sdp_ng_flags *flags, struct call_media *thi
}
}
if (flags->opmode == OP_OFFER || flags->opmode == OP_REQUEST) {
if (flags->opmode == OP_OFFER) {
switch (flags->ice_lite_option) {
case ICE_LITE_OFF:
MEDIA_CLEAR(this, ICE_LITE_SELF);
@ -1659,6 +1659,9 @@ static void __ice_offer(const struct sdp_ng_flags *flags, struct call_media *thi
default:
break;
}
if (flags->trickle_ice)
MEDIA_SET(this, TRICKLE_ICE);
}
/* determine roles (even if we don't actually do ICE) */
@ -1669,13 +1672,13 @@ static void __ice_offer(const struct sdp_ng_flags *flags, struct call_media *thi
else if (!MEDIA_ISSET(this, INITIALIZED) || ice_restart) {
if (MEDIA_ISSET(this, ICE_LITE_SELF))
MEDIA_CLEAR(this, ICE_CONTROLLING);
else if (flags->opmode == OP_OFFER)
else if (flags->opmode == OP_OFFER || flags->opmode == OP_REQUEST)
MEDIA_SET(this, ICE_CONTROLLING);
else
MEDIA_CLEAR(this, ICE_CONTROLLING);
}
if (flags->opmode == OP_OFFER || flags->opmode == OP_ANSWER) {
if (flags->opmode == OP_OFFER) {
/* roles are reversed for the other side */
if (MEDIA_ISSET(other, ICE_LITE_PEER) && !MEDIA_ISSET(other, ICE_LITE_SELF))
MEDIA_SET(other, ICE_CONTROLLING);


+ 1
- 1
t/auto-daemon-tests-pubsub.pl View File

@ -3147,7 +3147,7 @@ a=candidate:keutydghfbhdcfsb 1 UDP 2130706431 198.51.100.14 6028 typ host
a=candidate:keutydghfbhdcfsb 2 UDP 2130706430 198.51.100.14 6029 typ host
SDP
@ret1 = rcv($sock_c, -1, qr/^\x00\x01\x00.\x21\x12\xa4\x42(............)\x80\x22\x00.rtpengine.*?\x00\x06\x00\x11q2758e93:(........)\x00\x00\x00\x80\x29\x00\x08........\x00\x24\x00\x04\x6e\xff\xff\xff\x00\x08\x00\x14....................\x80\x28\x00\x04....$/s);
@ret1 = rcv($sock_c, -1, qr/^\x00\x01\x00.\x21\x12\xa4\x42(............)\x80\x22\x00.rtpengine.*?\x00\x06\x00\x11q2758e93:(........)\x00\x00\x00\x80\x2a\x00\x08........\x00\x24\x00\x04\x6e\xff\xff\xff\x00\x08\x00\x14....................\x80\x28\x00\x04....$/s);
snd($sock_b, $port_a, rtp(0, 2001, 4160, 0x3456, "\x00" x 160));
rcv($sock_a, $port_b, rtpm(0, 2001, 4160, $ssrc_a, "\x00" x 160));
snd($sock_a, $port_b, rtp(0, 4001, 7160, 0x6543, "\x00" x 160));


+ 9
- 9
t/auto-daemon-tests-redis.pl View File

@ -1240,7 +1240,7 @@ $json_exp = {
'format_str' => '0 8',
'index' => '1',
'logical_intf' => 'foo',
'media_flags' => '4',
'media_flags' => '2097156',
'protocol' => 'RTP/AVP',
'ptime' => '0',
'tag' => '2',
@ -1251,7 +1251,7 @@ $json_exp = {
'format_str' => '0 8',
'index' => '2',
'logical_intf' => 'foo',
'media_flags' => '4',
'media_flags' => '2097156',
'protocol' => 'RTP/AVP',
'ptime' => '0',
'tag' => '2',
@ -1582,9 +1582,9 @@ SDP
$json_exp->{'media-0'}{media_flags} = '10682380';
$json_exp->{'media-1'}{media_flags} = '8454156';
$json_exp->{'media-2'}{format_str} = '8';
$json_exp->{'media-2'}{media_flags} = '65540';
$json_exp->{'media-2'}{media_flags} = '2162692';
$json_exp->{'media-3'}{format_str} = '8';
$json_exp->{'media-3'}{media_flags} = '65540';
$json_exp->{'media-3'}{media_flags} = '2162692';
$json_exp->{'payload_types-2'}[0] = '8/PCMA/8000///0/20';
$#{$json_exp->{'payload_types-2'}} = 0;
$json_exp->{'payload_types-3'}[0] = '8/PCMA/8000///0/20';
@ -1835,7 +1835,7 @@ $json_exp = {
'format_str' => '0 8 9',
'index' => '1',
'logical_intf' => 'foo',
'media_flags' => '4',
'media_flags' => '2097156',
'protocol' => 'RTP/AVP',
'ptime' => '0',
'tag' => '1',
@ -2074,7 +2074,7 @@ $json_exp = {
'format_str' => '0',
'index' => '1',
'logical_intf' => 'foo',
'media_flags' => '65540',
'media_flags' => '2162692',
'protocol' => 'RTP/AVP',
'ptime' => '0',
'tag' => '1',
@ -2327,7 +2327,7 @@ $json_exp = {
'format_str' => '0',
'index' => '1',
'logical_intf' => 'foo',
'media_flags' => '65540',
'media_flags' => '2162692',
'protocol' => 'RTP/AVP',
'ptime' => '0',
'tag' => '1',
@ -2338,7 +2338,7 @@ $json_exp = {
'format_str' => '0 8 9',
'index' => '1',
'logical_intf' => 'foo',
'media_flags' => '4',
'media_flags' => '2097156',
'protocol' => 'RTP/AVP',
'ptime' => '0',
'tag' => '2',
@ -2586,7 +2586,7 @@ a=rtcp:PORT
SDP
$json_exp->{'media-2'}{format_str} = '0';
$json_exp->{'media-2'}{media_flags} = '65540';
$json_exp->{'media-2'}{media_flags} = '2162692';
$json_exp->{'stream-1'}{ps_flags} = '1179649';
$json_exp->{'stream-4'}{advertised_endpoint} = '198.51.100.14:6046';
$json_exp->{'stream-4'}{endpoint} = '198.51.100.14:6046';


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

@ -2071,7 +2071,7 @@ class TestVideoroom(unittest.TestCase):
self.assertRegex(
m,
re.compile(
b"^\x00\x01\x00.\x21\x12\xa4\x42(............)\x80\x22\x00.rtpengine.*?\x00\x06\x00\x0dabcd:(........)\x00\x00\x00\x80\\\x29\x00\x08........\x00\\\x24\x00\x04\x6e\xff\xff\xff\x00\x08\x00\x14....................\x80\\\x28\x00\x04....$",
b"^\x00\x01\x00.\x21\x12\xa4\x42(............)\x80\x22\x00.rtpengine.*?\x00\x06\x00\x0dabcd:(........)\x00\x00\x00\x80\\\x2a\x00\x08........\x00\\\x24\x00\x04\x6e\xff\xff\xff\x00\x08\x00\x14....................\x80\\\x28\x00\x04....$",
re.DOTALL,
),
)


Loading…
Cancel
Save