diff --git a/t/auto-daemon-tests-dtx.pl b/t/auto-daemon-tests-dtx.pl index a2f932203..1b791ffbe 100755 --- a/t/auto-daemon-tests-dtx.pl +++ b/t/auto-daemon-tests-dtx.pl @@ -30,6 +30,387 @@ my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $ssrc_b, $resp, if ($amr_tests) { +($sock_a, $sock_b) = new_call([qw(198.51.100.10 5128)], [qw(198.51.100.10 5130)]); + +($port_a) = offer('G.711/AMR-WB codec change reverse', + { replace => ['origin'], codec => { + transcode => ['AMR-WB'], + } }, < ['origin'] }, < silence +rcv($sock_b, $port_a, rtpm(96, $seq + 2, 4640, $ssrc, "\xf0\x1c\xe0\xd2\x00\xb3\xbc\xed\x24\xe1\xd1\x79\x49\x06\xa4\xa0\x3c\x1f\x42\xe1\x06\xbb\x5c\x60\x68\x99\xc5\x18\x55\x81\x0d\x41\x03\xc1\x00\xcf\xd4\x20")); +rcv($sock_b, $port_a, rtpm(96, $seq + 3, 4960, $ssrc, "\xf0\x1c\x61\x06\x40\xbb\xba\xec\x31\xe2\x59\xed\xd8\x6f\x37\x5c\xff\x31\x88\x8d\xf3\x3a\x5c\x90\x6d\x40\x82\x12\x88\x86\xf8\xb8\x4e\x88\x12\x20\xd9\xe8")); +# start audio again +snd($sock_a, $port_b, rtp(0, 2002, 4640, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(96, $seq + 4, 5280, $ssrc, "\xf0\x1c\x60\x06\x00\xbb\xb6\xee\xe3\xe1\x71\xc3\x1a\x12\x37\x62\x61\x0b\x5a\x58\xf1\xe1\xc8\x70\x4b\xe9\x88\xe0\x00\x8b\xc8\x0c\x81\x42\x65\x88\xe4\xf0")); +# interject unknown payload type +snd($sock_a, $port_b, rtp(9, 2003, 4800, 0x5678, "\x40" x 160)); +# no passthrough, get more DTX +rcv($sock_b, $port_a, rtpm(96, $seq + 5, 5600, $ssrc, "\xf0\x1c\x40\x40\x30\xff\xf3\xfe\x44\xf1\x2f\x69\xa0\x9b\x22\xb8\x49\x98\x45\xc5\xd9\x11\x30\x20\x1c\x50\x00\xe5\x00\x01\x23\x90\x03\xeb\xa0\x00\x07\x30")); +snd($sock_a, $port_b, rtp(9, 2004, 4960, 0x5678, "\x40" x 160)); +# back to normal media +snd($sock_a, $port_b, rtp(0, 2003, 4960, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(96, $seq + 6, 5920, $ssrc, "\xf0\x1c\x60\x40\x30\xee\xe3\xb8\xa7\x31\x33\x86\x17\x42\x07\x48\x3d\xd5\x5d\xd8\x0a\xd2\x88\x20\x0e\x40\x80\x4a\x38\x44\x73\x64\x80\x7e\x6c\xc4\x1b\x78")); + +# reinvite to PCMA + +($port_a) = offer('G.711/AMR-WB codec change reverse', + { replace => ['origin'], codec => { + transcode => ['AMR-WB'], + } }, < ['origin'] }, < silence +rcv($sock_b, $port_a, rtpm(96, $seq + 9, 6880, 0x5678, "\xf0\x1c\xe2\xd0\x10\xc0\xd9\x63\x84\xb1\x73\xa1\x9a\x8a\x97\x36\x46\x16\x24\x03\x54\x22\x14\x52\x03\xe1\x0a\x40\x10\x45\x54\x15\x23\x72\xcc\xea\x16\x00")); +rcv($sock_b, $port_a, rtpm(96, $seq + 10, 7200, 0x5678, "\xf0\x1c\x50\x54\x30\x77\xf3\xdd\x1d\xd3\x57\x6b\xce\xc7\xcd\x7a\x17\x71\x05\x36\x04\x42\x70\x72\x73\x25\x0c\x14\x26\x2a\x05\x72\x03\x90\xf2\x5c\x48\xd8")); + +# inject old PCM +snd($sock_a, $port_b, rtp(0, 2004, 5120, 0x5678, "\x40" x 160)); +snd($sock_a, $port_b, rtp(0, 2006, 5440, 0x5678, "\x40" x 160)); +# packet dropped +rcv_no($sock_b); + +# reinvite back to PCMU + +($port_a) = offer('G.711/AMR-WB codec change reverse', + { replace => ['origin'], codec => { + transcode => ['AMR-WB'], + } }, < ['origin'] }, < ft() }); + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.10 5098)], [qw(198.51.100.10 5100)]); + +($port_a) = offer('G.711/AMR-WB codec change with timing', + { replace => ['origin'], codec => { + transcode => ['PCMA'], + } }, < ['origin'] }, < silence +rcv($sock_b, $port_a, rtpm(8, $seq + 2, 4320, $ssrc, "\xd5" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 3, 4480, $ssrc, "\xd5" x 160)); +# start audio again +snd($sock_a, $port_b, rtp(0, 2002, 4640, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 4, 4640, $ssrc, "\x68" x 160)); +# interject unknown payload type +snd($sock_a, $port_b, rtp(9, 2003, 4800, 0x5678, "\x40" x 160)); +# no passthrough, get more DTX +rcv($sock_b, $port_a, rtpm(8, $seq + 5, 4800, $ssrc, "\xd5" x 160)); +snd($sock_a, $port_b, rtp(9, 2004, 4960, 0x5678, "\x40" x 160)); +# back to normal media +snd($sock_a, $port_b, rtp(0, 2003, 4960, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 6, 4960, $ssrc, "\x68" x 160)); + +# reinvite to AMR-WB + +($port_a) = offer('G.711/AMR-WB codec change with timing', + { replace => ['origin'], codec => { + transcode => ['PCMA'], + } }, < ['origin'] }, < silence +rcv($sock_b, $port_a, rtpm(8, $seq + 9, 5440, 0x5678, "\x54\x54\x54\x54\x54\x54\x54\x54\x54\x55\x54\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\xd5\x55\x55\xd5\x55\xd5\xd5\xd5\x55\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\x55\x55\x55\x55\xd5\x55\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\x55\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\x55\xd5\xd5\xd5\x55\x55\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5")); +rcv($sock_b, $port_a, rtpm(8, $seq + 10, 5600, 0x5678, "\xd5\xd5\xd5\xd5\x55\x55\xd5\x55\x55\xd5\x55\x55\x55\x55\xd5\x55\x55\xd5\x55\xd5\x55\xd5\x55\x55\xd5\xd5\xd5\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\xd5\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\xd5\x55\x55\xd5\x55\x55\x55\x55\x55\x55\x55\xd5\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\xd5\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\xd5\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\xd5\xd5\xd5\xd5\xd5\xd5\xd5\x55\x55\x55\x55\x55\x55\x55")); + +# inject old PCM +snd($sock_a, $port_b, rtp(0, 2006, 5760, 0x5678, "\x40" x 160)); +# packet dropped +rcv_no($sock_b); + +# reinvite back to PCM + +($port_a) = offer('G.711/AMR-WB codec change with timing', + { replace => ['origin'], codec => { + transcode => ['PCMA'], + } }, < ['origin'] }, < ft() }); + + + + + ($sock_a, $sock_b) = new_call([qw(198.51.100.10 5068)], [qw(198.51.100.10 5070)]); ($port_a) = offer('G.711/AMR codec change with timing',