Browse Source

TT#14008 test correct port for rejected stream

When doing the initial answer, the packet_stream endpoint port isn't
filled in yet. Use the stream_params port instead to test for rejected
streams.

closes #1499

Change-Id: I8f315d95521f874fb8c5e6222263d017800b5fc9
pull/1501/head
Richard Fuchs 4 years ago
parent
commit
447f0f52d0
3 changed files with 150 additions and 5 deletions
  1. +2
    -5
      daemon/call.c
  2. +147
    -0
      t/auto-daemon-tests.pl
  3. +1
    -0
      t/test-transcode.c

+ 2
- 5
daemon/call.c View File

@ -2480,11 +2480,8 @@ void codecs_offer_answer(struct call_media *media, struct call_media *other_medi
// don't do codec answer for a rejected media section
if (other_media->streams.length == 0)
codec_answer_only = false;
else {
struct packet_stream *ps = other_media->streams.head->data;
if (ps->endpoint.port == 0)
codec_answer_only = false;
}
else if (sp->rtp_endpoint.port == 0)
codec_answer_only = false;
if (flags->reuse_codec)
codec_store_populate_reuse(&other_media->codecs, &sp->codecs, flags->codec_set,


+ 147
- 0
t/auto-daemon-tests.pl View File

@ -78,6 +78,152 @@ sub stun_succ {
};
new_call;
offer('GH 1499',
{ }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 172.17.0.2
m=audio 4024 RTP/AVP 0 9 8
----------------------------------
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 203.0.113.1
m=audio PORT RTP/AVP 0 9 8
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP
answer('GH 1499',
{ }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 172.17.0.2
m=audio 4026 RTP/AVP 8 101
a=rtpmap:101 telephone-event/8000
----------------------------------
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 203.0.113.1
m=audio PORT RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP
new_call;
offer('GH 1499 corollary',
{ }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 172.17.0.2
m=audio 4024 RTP/AVP 0 8
----------------------------------
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 203.0.113.1
m=audio PORT RTP/AVP 0 8
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP
answer('GH 1499 corollary',
{ }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 172.17.0.2
m=audio 4026 RTP/AVP 8 9
----------------------------------
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 203.0.113.1
m=audio PORT RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP
new_call;
offer('GH 1499 control',
{ }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 172.17.0.2
m=audio 4024 RTP/AVP 0 8
m=audio 4026 RTP/AVP 8 9
----------------------------------
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 203.0.113.1
m=audio PORT RTP/AVP 0 8
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
m=audio PORT RTP/AVP 8 9
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=sendrecv
a=rtcp:PORT
SDP
answer('GH 1499 control',
{ }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 172.17.0.2
m=audio 4026 RTP/AVP 8 9
m=audio 0 RTP/AVP 0
----------------------------------
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
c=IN IP4 203.0.113.1
m=audio PORT RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
m=audio 0 RTP/AVP 8
SDP
# ^ technically fishy - rejected stream should not do offer/answer and should just
# pass through 0 instead
($sock_a, $sock_b, $sock_c, $sock_d) = new_call([qw(198.51.100.4 2412)], [qw(198.51.100.4 2413)], [qw(198.51.100.8 3412)], [qw(198.51.100.8 3413)]);
offer('ICE with just peer reflexive',
@ -15471,4 +15617,5 @@ SDP
#done_testing;NGCP::Rtpengine::AutoTest::terminate('f00');exit;
done_testing();

+ 1
- 0
t/test-transcode.c View File

@ -69,6 +69,7 @@ static void __cleanup(void) {
static void __init(void) {
__cleanup();
codec_store_init(&rtp_types_sp.codecs, NULL);
rtp_types_sp.rtp_endpoint.port = 9;
flags.codec_except = g_hash_table_new_full(str_case_hash, str_case_equal, free, NULL);
flags.codec_set = g_hash_table_new_full(str_case_hash, str_case_equal, free, free);
ml_A.ssrc_hash = create_ssrc_hash_call();


Loading…
Cancel
Save