diff --git a/t/auto-daemon-tests-dtls.pl b/t/auto-daemon-tests-dtls.pl index cea99d7e4..fb508b0d0 100644 --- a/t/auto-daemon-tests-dtls.pl +++ b/t/auto-daemon-tests-dtls.pl @@ -54,6 +54,1471 @@ sub mux_input { +($sock_a) = new_call([qw(198.51.100.35 3060)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change B', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change B', { + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_a); +@components = ([$sock_a, $port_b]); +$dtls->connect(); +$mux->loop(); + + +rtpe_req('delete', 'delete'); + + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.35 3056)], [qw(198.51.100.35 3058)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change A/B', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_b]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change A/B', { + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_b); +@components = ([$sock_b, $port_b]); +$dtls->connect(); +$mux->loop(); + + +rtpe_req('delete', 'delete'); + + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.35 3052)], [qw(198.51.100.35 3054)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change A', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_b]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change A', { + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_b); +@components = ([$sock_b, $port_b]); +$dtls->connect(); +$mux->loop(); + + +rtpe_req('delete', 'delete'); + + + + +($sock_a) = new_call([qw(198.51.100.35 3050)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw force passive', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +offer('re-invite bkw force passive', { + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +offer('re-invite bkw passive', { + 'rtcp-mux' => 'demux', +}, <new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->accept(); +$mux->loop(); + + +offer('re-invite bkw', { + 'rtcp-mux' => 'demux', +}, <new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a) = offer('re-invite fwd with B port change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + + +($port_b, $port_bx, undef, $tls_id_b) = offer('re-invite fwd with B port change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +answer('re-invite fwd with B port change', { }, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +rtpe_req('delete', 'delete'); + + + +($sock_a) = new_call([qw(198.51.100.35 3040)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a) = offer('re-invite fwd with role change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + + +($port_b, $port_bx, undef, $tls_id_b) = offer('re-invite fwd with role change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +answer('re-invite fwd with role change', { }, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->accept(); +$mux->loop(); + + + +rtpe_req('delete', 'delete'); + + + +($sock_a) = new_call([qw(198.51.100.35 3038)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a) = offer('re-invite fwd passive', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->accept(); +$mux->loop(); + + + +($port_b, $port_bx, undef, $tls_id_b) = offer('re-invite fwd passive', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a) = offer('re-invite fwd', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + + +($port_b, $port_bx, undef, $tls_id_b) = offer('re-invite fwd', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a) = offer('re-invite fwd with A port change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + + +($port_b, $port_bx, undef, $tls_id_b) = offer('re-invite fwd with A port change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + + +answer('re-invite fwd with A port change', { }, <add($sock_a); +@components = ([$sock_a, $port_b]); +$dtls->connect(); +$mux->loop(); + + + + +rtpe_req('delete', 'delete'); + + + ($sock_a) = new_call([qw(198.51.100.35 3032)]); $mux = IO::Multiplex->new(); @@ -70,7 +1535,7 @@ $fingerprint = $dtls->[0]->fingerprint(); v=0 o=- 1545997027 1 IN IP4 198.51.100.23 s=tester -c=IN IP4 198.51.100.35 +c=IN IP4 198.51.100.99 t=0 0 m=audio 3000 RTP/AVP 0 ----------------------------------- @@ -110,7 +1575,6 @@ rtpe_req('delete', 'delete'); -done_testing;NGCP::Rtpengine::AutoTest::terminate('f00');exit; ($sock_a) = new_call([qw(198.51.100.35 3028)]);