#!/usr/bin/perl use strict; use warnings; use NGCP::Rtpengine::Test; use NGCP::Rtpclient::SRTP; use NGCP::Rtpengine::AutoTest; use Test::More; use NGCP::Rtpclient::ICE; use POSIX; use Data::Dumper; autotest_start(qw(--config-file=none -t -1 -i 203.0.113.1 -n 2223 -f -L 7 -E --log-level-internals=7)) or die; my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $ssrc_b, $resp, $sock_ax, $sock_bx, $port_ax, $port_bx, $srtp_ctx_a, $srtp_ctx_b, $srtp_ctx_a_rev, $srtp_ctx_b_rev, $ufrag_a, $ufrag_b, @ret1, @ret2, @ret3, @ret4, $srtp_key_a, $srtp_key_b, $ts, $seq, $has_recv); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.100.1 7000)], [qw(198.51.100.1 7001)], [qw(198.51.100.3 7002)], [qw(198.51.100.3 7003)], ); ($port_a, $port_ax) = offer('control', { }, < { transcode => ['PCMU'] } }, < { transcode => ['PCMU'] } }, < { transcode => ['PCMU'] } }, < { strip => ['blah'] } }, < { strip => ['foo'] } }, < { mask => ['blah'] } }, < { mask => ['foo'] } }, < { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, }, < { mask => ['foo'] }, }, < { mask => ['blah'] } }, < { mask => ['foo'] } }, < { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, }, < { mask => ['foo'] }, }, < { mask => ['blah'] } }, < { mask => ['foo'] } }, < { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, }, < { mask => ['foo'] }, }, < { mask => ['blah'] } }, < { mask => ['foo'] } }, < { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, }, < { mask => ['foo'] }, }, < { mask => ['all'] } }, < { mask => ['all'] } }, < { mask => ['all'] }, codec => { transcode => [ 'PCMU' ] }, }, < { mask => ['all'] }, }, < 'RTP/AVP' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50"), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50")); snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50")); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50"), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7004)], [qw(198.51.101.1 7005)], [qw(198.51.101.3 7006)], [qw(198.51.101.3 7007)], ); ($port_a, $port_ax) = offer('unsolicited exts', { 'transport-protocol' => 'RTP/AVP' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]])); snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7008)], [qw(198.51.101.1 7009)], [qw(198.51.101.3 7010)], [qw(198.51.101.3 7011)], ); ($port_a, $port_ax) = offer('dummy extmap', { 'transport-protocol' => 'RTP/AVP' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]])); snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7016)], [qw(198.51.101.1 7017)], [qw(198.51.101.3 7018)], [qw(198.51.101.3 7019)], ); ($port_a, $port_ax) = offer('control w tc', { codec => { transcode => ['PCMU'] }, 'transport-protocol' => 'RTP/AVP' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50"), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74")); snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74")); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50"), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7020)], [qw(198.51.101.1 7021)], [qw(198.51.101.3 7022)], [qw(198.51.101.3 7023)], ); ($port_a, $port_ax) = offer('unsolicited exts w tc', { codec => { transcode => ['PCMU'] }, 'transport-protocol' => 'RTP/AVP' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"]])); snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[2, "blah"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7024)], [qw(198.51.101.1 7025)], [qw(198.51.101.3 7026)], [qw(198.51.101.3 7027)], ); ($port_a, $port_ax) = offer('dummy extmap w tc', { codec => { transcode => ['PCMU'] }, 'transport-protocol' => 'RTP/AVP' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"]])); snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[2, "blah"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7122)], [qw(198.51.101.1 7123)], [qw(198.51.101.3 7124)], [qw(198.51.101.3 7125)], ); ($port_a, $port_ax) = offer('extmap-strip', { extmap => { strip => ['blah'] }, 'transport-protocol' => 'RTP/AVP' }, < { strip => ['foo'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"], [2, "woot"], [3, "meh"], [4, "yugh"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[2, "woot"]])); snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"], [2, "woot"], [3, "meh"], [4, "yugh"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "woot"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7040)], [qw(198.51.101.1 7041)], [qw(198.51.101.3 7042)], [qw(198.51.101.3 7043)], ); ($port_a, $port_ax) = offer('extmap-mask', { extmap => { mask => ['blah'] }, 'transport-protocol' => 'RTP/AVP' }, < { mask => ['foo'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"]])); snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7048)], [qw(198.51.101.1 7049)], [qw(198.51.101.3 7050)], [qw(198.51.101.3 7051)], ); ($port_a, $port_ax) = offer('extmap-mask w tc', { extmap => { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, 'transport-protocol' => 'RTP/AVP', }, < { mask => ['foo'] }, }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x13" . ("\x03" x 158) . "\x5a", [[1, "foo"], [2, "blah"]])); snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"], [2, "blah"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7166)], [qw(198.51.101.1 7167)], [qw(198.51.101.3 7168)], [qw(198.51.101.3 7169)], ); ($port_a, $port_ax) = offer('extmap-mask long', { extmap => { mask => ['blah'] }, 'transport-protocol' => 'RTP/AVP' }, < { mask => ['foo'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"], [21, "argh"], [20, "yikes"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"]])); snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"], [21, "argh"], [20, "yikes"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7174)], [qw(198.51.101.1 7175)], [qw(198.51.101.3 7176)], [qw(198.51.101.3 7177)], ); ($port_a, $port_ax) = offer('extmap-mask w tc long', { extmap => { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, 'transport-protocol' => 'RTP/AVP', }, < { mask => ['foo'] }, }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"], [21, "argh"], [20, "yikes"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x13" . ("\x03" x 158) . "\x5a", [[18, "foo"], [19, "blah"]])); snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"], [21, "argh"], [20, "yikes"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[18, "foo"], [19, "blah"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7134)], [qw(198.51.101.1 7135)], [qw(198.51.101.3 7136)], [qw(198.51.101.3 7137)], ); ($port_a, $port_ax) = offer('extmap-mask too long', { extmap => { mask => ['blah'] }, 'transport-protocol' => 'RTP/AVP' }, < { mask => ['foo'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "oh no this is too long"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"]])); snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "oh no this is too long"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7142)], [qw(198.51.101.1 7143)], [qw(198.51.101.3 7144)], [qw(198.51.101.3 7145)], ); ($port_a, $port_ax) = offer('extmap-mask w tc too long', { extmap => { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, 'transport-protocol' => 'RTP/AVP', }, < { mask => ['foo'] }, }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "oh no this is too long"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x13" . ("\x03" x 158) . "\x5a", [[1, "foo"], [2, "blah"]])); snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "oh no this is too long"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7134)], [qw(198.51.101.1 7135)], [qw(198.51.101.3 7136)], [qw(198.51.101.3 7137)], ); ($port_a, $port_ax) = offer('extmap-mask mixed', { extmap => { mask => ['blah'] }, 'transport-protocol' => 'RTP/AVP' }, < { mask => ['foo'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "way too long of an attribute"], [4, "argh"], [3, "oh no this is too long"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "way too long of an attribute"]])); snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "oh no this is too long"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "oh no this is too long"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7142)], [qw(198.51.101.1 7143)], [qw(198.51.101.3 7144)], [qw(198.51.101.3 7145)], ); ($port_a, $port_ax) = offer('extmap-mask w tc mixed', { extmap => { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, 'transport-protocol' => 'RTP/AVP', }, < { mask => ['foo'] }, }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "way too long of an attribute"], [4, "argh"], [3, "oh no this is too long"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x13" . ("\x03" x 158) . "\x5a", [[1, "foo"], [2, "way too long of an attribute"]])); snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "oh no this is too long"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"], [2, "oh no this is too long"]]), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7678)], [qw(198.51.101.1 7679)], [qw(198.51.101.3 7680)], [qw(198.51.101.3 7681)], ); ($port_a, $port_ax) = offer('extmap-mask all', { extmap => { mask => ['all'] }, 'transport-protocol' => 'RTP/AVP' }, < { mask => ['all'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74")); snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74"), $srtp_ctx_b); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.101.1 7686)], [qw(198.51.101.1 7687)], [qw(198.51.101.3 7688)], [qw(198.51.101.3 7689)], ); ($port_a, $port_ax) = offer('extmap-mask all w tc', { extmap => { mask => ['all'] }, codec => { transcode => [ 'PCMU' ] }, 'transport-protocol' => 'RTP/AVP', }, < { mask => ['all'] }, }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; srtp_snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x13" . ("\x03" x 158) . "\x5a")); snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50"), $srtp_ctx_b); # SRTP on B side ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7000)], [qw(198.51.105.1 7001)], [qw(198.51.105.3 7002)], [qw(198.51.105.3 7003)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('control', { 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50")); srtp_rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50"), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50"), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50")); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7004)], [qw(198.51.105.1 7005)], [qw(198.51.105.3 7006)], [qw(198.51.105.3 7007)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('unsolicited exts', { 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]])); srtp_rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7008)], [qw(198.51.105.1 7009)], [qw(198.51.105.3 7010)], [qw(198.51.105.3 7011)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('dummy extmap', { 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]])); srtp_rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7016)], [qw(198.51.105.1 7017)], [qw(198.51.105.3 7018)], [qw(198.51.105.3 7019)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('control w tc', { codec => { transcode => ['PCMU'] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50")); srtp_rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74"), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74"), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50")); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7020)], [qw(198.51.105.1 7021)], [qw(198.51.105.3 7022)], [qw(198.51.105.3 7023)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('unsolicited exts w tc', { codec => { transcode => ['PCMU'] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]])); srtp_rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[2, "blah"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7024)], [qw(198.51.105.1 7025)], [qw(198.51.105.3 7026)], [qw(198.51.105.3 7027)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('dummy extmap w tc', { codec => { transcode => ['PCMU'] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]])); srtp_rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[2, "blah"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "blah"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7122)], [qw(198.51.105.1 7123)], [qw(198.51.105.3 7124)], [qw(198.51.105.3 7125)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-strip', { extmap => { strip => ['blah'] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < { strip => ['foo'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"], [2, "woot"], [3, "meh"], [4, "yugh"]])); srtp_rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x10" . ("\x00" x 158) . "\x50", [[2, "woot"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"], [2, "woot"], [3, "meh"], [4, "yugh"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[2, "woot"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7040)], [qw(198.51.105.1 7041)], [qw(198.51.105.3 7042)], [qw(198.51.105.3 7043)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-mask', { extmap => { mask => ['blah'] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < { mask => ['foo'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7048)], [qw(198.51.105.1 7049)], [qw(198.51.105.3 7050)], [qw(198.51.105.3 7051)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-mask w tc', { extmap => { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off', }, < { mask => ['foo'] }, }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x13" . ("\x03" x 158) . "\x5a", [[1, "foo"], [2, "blah"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"], [2, "blah"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7166)], [qw(198.51.105.1 7167)], [qw(198.51.105.3 7168)], [qw(198.51.105.3 7169)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-mask long', { extmap => { mask => ['blah'] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < { mask => ['foo'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"], [21, "argh"], [20, "yikes"]])); srtp_rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"], [21, "argh"], [20, "yikes"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7174)], [qw(198.51.105.1 7175)], [qw(198.51.105.3 7176)], [qw(198.51.105.3 7177)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-mask w tc long', { extmap => { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off', }, < { mask => ['foo'] }, }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"], [21, "argh"], [20, "yikes"]])); srtp_rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x13" . ("\x03" x 158) . "\x5a", [[18, "foo"], [19, "blah"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[18, "foo"], [19, "blah"], [21, "argh"], [20, "yikes"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[18, "foo"], [19, "blah"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7134)], [qw(198.51.105.1 7135)], [qw(198.51.105.3 7136)], [qw(198.51.105.3 7137)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-mask too long', { extmap => { mask => ['blah'] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < { mask => ['foo'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "oh no this is too long"]])); srtp_rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "oh no this is too long"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7142)], [qw(198.51.105.1 7143)], [qw(198.51.105.3 7144)], [qw(198.51.105.3 7145)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-mask w tc too long', { extmap => { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off', }, < { mask => ['foo'] }, }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "oh no this is too long"]])); srtp_rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x13" . ("\x03" x 158) . "\x5a", [[1, "foo"], [2, "blah"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "oh no this is too long"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7134)], [qw(198.51.105.1 7135)], [qw(198.51.105.3 7136)], [qw(198.51.105.3 7137)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-mask mixed', { extmap => { mask => ['blah'] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < { mask => ['foo'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "way too long of an attribute"], [4, "argh"], [3, "oh no this is too long"]])); srtp_rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "way too long of an attribute"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "oh no this is too long"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "oh no this is too long"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7142)], [qw(198.51.105.1 7143)], [qw(198.51.105.3 7144)], [qw(198.51.105.3 7145)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-mask w tc mixed', { extmap => { mask => ['blah'] }, codec => { transcode => [ 'PCMU' ] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off', }, < { mask => ['foo'] }, }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "way too long of an attribute"], [4, "argh"], [3, "oh no this is too long"]])); srtp_rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x13" . ("\x03" x 158) . "\x5a", [[1, "foo"], [2, "way too long of an attribute"]]), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "oh no this is too long"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50", [[1, "foo"], [2, "oh no this is too long"]])); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7678)], [qw(198.51.105.1 7679)], [qw(198.51.105.3 7680)], [qw(198.51.105.3 7681)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-mask all', { extmap => { mask => ['all'] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off' }, < { mask => ['all'] } }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74"), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74")); ($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( [qw(198.51.105.1 7686)], [qw(198.51.105.1 7687)], [qw(198.51.105.3 7688)], [qw(198.51.105.3 7689)], ); ($port_a, $port_ax, undef, undef, undef, undef, undef, undef, $srtp_key_b) = offer('extmap-mask all w tc', { extmap => { mask => ['all'] }, codec => { transcode => [ 'PCMU' ] }, 'transport-protocol' => 'RTP/SAVP', DTLS => 'off', }, < { mask => ['all'] }, }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => 'cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv', }; $srtp_ctx_b = { cs => $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, key => $srtp_key_b, }; snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]])); srtp_rcv($sock_b, $port_a, rtpm(0, 1000, 3000+160*0, 0x1234, "\x13" . ("\x03" x 158) . "\x5a"), $srtp_ctx_b); srtp_snd($sock_b, $port_a, rtp( 0, 8000, 7000+160*0, 0x6543, "\x39" . ("\x29" x 158) . "\x74", [[1, "foo"], [2, "blah"], [4, "argh"], [3, "yikes"]]), $srtp_ctx_a); rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x10" . ("\x00" x 158) . "\x50")); #done_testing;NGCP::Rtpengine::AutoTest::terminate('f00');exit; done_testing();