Browse Source

MT#63317 support bundle-accept

Change-Id: Ie436bd0e709a87379a647439bc09c167619620aa
rfuchs/dtls-ice
Richard Fuchs 3 months ago
parent
commit
77776f185c
3 changed files with 228 additions and 4 deletions
  1. +2
    -2
      daemon/call.c
  2. +1
    -0
      daemon/call_interfaces.c
  3. +225
    -2
      t/auto-daemon-tests-bundle.pl

+ 2
- 2
daemon/call.c View File

@ -2797,9 +2797,9 @@ static void __call_monologue_init_from_flags(struct call_monologue *ml, struct c
for (__auto_type ll = flags->groups_other.head; ll; ll = ll->next)
t_queue_push_tail(&ml->groups_other, call_str_dup(ll->data));
if (t_hash_table_is_set(flags->bundles))
if (t_hash_table_is_set(flags->bundles) && flags->bundle_accept)
ML_SET(ml, BUNDLE);
else
else if (flags->bundle_reject)
ML_CLEAR(ml, BUNDLE);
ml->sdp_session_uri = call_str_cpy(&flags->session_uri);


+ 1
- 0
daemon/call_interfaces.c View File

@ -853,6 +853,7 @@ static void call_ng_flags_bundle(str *s, unsigned int idx, helper_arg arg) {
out->bundle_reject = true;
break;
case CSH_LOOKUP("require"):
out->bundle_offer = true;
out->bundle_require = true;
break;
default:


+ 225
- 2
t/auto-daemon-tests-bundle.pl View File

@ -216,10 +216,12 @@ rcv($sock_b, $port_d, rtpm(105, 7000, 9000, 0x8741, "\x22" x 800));
# mix up bundle ports
snd($sock_a, $port_d, rtp(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv($sock_c, $port_a, rtpm(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv($sock_d, $port_b, rtpm(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv_no($sock_c);
snd($sock_b, $port_c, rtp(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv($sock_d, $port_b, rtpm(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv($sock_c, $port_a, rtpm(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv_no($sock_d);
@ -322,11 +324,232 @@ rcv($sock_a, $port_d, rtpm(105, 7000, 9000, 0x8741, "\x22" x 800));
# mix up bundle ports
snd($sock_a, $port_d, rtp(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv($sock_d, $port_b, rtpm(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv_no($sock_c);
snd($sock_a, $port_c, rtp(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv($sock_c, $port_a, rtpm(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv_no($sock_d);
($sock_a, $sock_b, $sock_c, $sock_d) =
new_call([qw(198.51.100.14 6200)],
[qw(198.51.100.14 6202)],
[qw(198.51.100.14 6204)],
[qw(198.51.100.14 6206)]);
($port_a, undef, $port_b) = offer('optional bundle offer w bundle-accept',
{ bundle => ['accept'] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
a=group:BUNDLE a v
m=audio 6200 RTP/AVP 0
c=IN IP4 198.51.100.14
a=sendrecv
a=mid:a
m=video 6202 RTP/AVP 105
c=IN IP4 198.51.100.14
a=rtpmap:105 H264/90000
a=sendrecv
a=mid:v
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/AVP 0
c=IN IP4 203.0.113.1
a=mid:a
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
m=video PORT RTP/AVP 105
c=IN IP4 203.0.113.1
a=mid:v
a=rtpmap:105 H264/90000
a=sendrecv
a=rtcp:PORT
SDP
($port_c, undef, $port_d) = answer('optional bundle offer w bundle-accept',
{ }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio 6204 RTP/AVP 0
c=IN IP4 198.51.100.14
a=sendrecv
a=mid:a
m=video 6206 RTP/AVP 105
c=IN IP4 198.51.100.14
a=rtpmap:105 H264/90000
a=sendrecv
a=mid:v
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/AVP 0
c=IN IP4 203.0.113.1
a=mid:a
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
m=video PORT RTP/AVP 105
c=IN IP4 203.0.113.1
a=mid:v
a=rtpmap:105 H264/90000
a=sendrecv
a=rtcp:PORT
SDP
isnt($port_a, $port_b, 'different ports');
isnt($port_a, $port_c, 'different ports');
isnt($port_a, $port_d, 'different ports');
isnt($port_b, $port_c, 'different ports');
isnt($port_b, $port_d, 'different ports');
isnt($port_c, $port_d, 'different ports');
snd($sock_a, $port_c, rtp(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv($sock_c, $port_a, rtpm(0, 2000, 6000, 0x1234, "\x44" x 160));
snd($sock_c, $port_a, rtp(0, 6000, 8000, 0x5678, "\x77" x 160));
rcv($sock_a, $port_c, rtpm(0, 6000, 8000, 0x5678, "\x77" x 160));
rcv_no($sock_b);
snd($sock_b, $port_d, rtp(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv($sock_d, $port_b, rtpm(105, 3000, 4000, 0x6321, "\x33" x 800));
snd($sock_d, $port_b, rtp(105, 7000, 9000, 0x8741, "\x22" x 800));
rcv($sock_b, $port_d, rtpm(105, 7000, 9000, 0x8741, "\x22" x 800)); # XXX wrong port
rcv_no($sock_a);
# mix up bundle ports
snd($sock_a, $port_d, rtp(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv($sock_c, $port_a, rtpm(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv_no($sock_d);
snd($sock_b, $port_c, rtp(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv($sock_d, $port_b, rtpm(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv_no($sock_c);
undef($sock_b);
($sock_a, $sock_c, $sock_d) =
new_call([qw(198.51.100.14 6208)],
[qw(198.51.100.14 6210)],
[qw(198.51.100.14 6212)]);
($port_a, undef, $port_b) = offer('same-port bundle offer w bundle-accept',
{ bundle => ['accept'] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
a=group:BUNDLE a v
m=audio 6208 RTP/AVP 0
c=IN IP4 198.51.100.14
a=sendrecv
a=mid:a
m=video 6208 RTP/AVP 105
c=IN IP4 198.51.100.14
a=rtpmap:105 H264/90000
a=sendrecv
a=mid:v
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/AVP 0
c=IN IP4 203.0.113.1
a=mid:a
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
m=video PORT RTP/AVP 105
c=IN IP4 203.0.113.1
a=mid:v
a=rtpmap:105 H264/90000
a=sendrecv
a=rtcp:PORT
SDP
($port_c, undef, $port_d) = answer('same-port bundle offer w bundle-accept',
{ }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio 6210 RTP/AVP 0
c=IN IP4 198.51.100.14
a=sendrecv
a=mid:a
m=video 6212 RTP/AVP 105
c=IN IP4 198.51.100.14
a=rtpmap:105 H264/90000
a=sendrecv
a=mid:v
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/AVP 0
c=IN IP4 203.0.113.1
a=mid:a
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
m=video PORT RTP/AVP 105
c=IN IP4 203.0.113.1
a=mid:v
a=rtpmap:105 H264/90000
a=sendrecv
a=rtcp:PORT
SDP
isnt($port_a, $port_b, 'different ports');
isnt($port_a, $port_c, 'different ports');
isnt($port_a, $port_d, 'different ports');
isnt($port_b, $port_c, 'different ports');
isnt($port_b, $port_d, 'different ports');
isnt($port_c, $port_d, 'different ports');
snd($sock_a, $port_c, rtp(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv($sock_c, $port_a, rtpm(0, 2000, 6000, 0x1234, "\x44" x 160));
snd($sock_c, $port_a, rtp(0, 6000, 8000, 0x5678, "\x77" x 160));
rcv($sock_a, $port_c, rtpm(0, 6000, 8000, 0x5678, "\x77" x 160));
snd($sock_a, $port_d, rtp(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv($sock_d, $port_b, rtpm(105, 3000, 4000, 0x6321, "\x33" x 800));
snd($sock_d, $port_b, rtp(105, 7000, 9000, 0x8741, "\x22" x 800));
rcv($sock_a, $port_d, rtpm(105, 7000, 9000, 0x8741, "\x22" x 800));
# mix up bundle ports
snd($sock_a, $port_d, rtp(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv($sock_c, $port_a, rtpm(0, 2000, 6000, 0x1234, "\x44" x 160));
rcv_no($sock_d);
snd($sock_a, $port_c, rtp(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv($sock_d, $port_b, rtpm(105, 3000, 4000, 0x6321, "\x33" x 800));
rcv_no($sock_c);


Loading…
Cancel
Save