From 97b55f30bb12c093497145599e13b6e7ba392d6d Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 23 May 2025 10:16:20 -0400 Subject: [PATCH] MT#55283 add tests for dtx-shift=0 Change-Id: Ib7df44b251e35ffb02f19be2eb883d9d86f9720b --- t/Makefile | 6 +- t/auto-daemon-tests-dtx-no-shift.pl | 1822 +++++++++++++++++++++++++++ 2 files changed, 1827 insertions(+), 1 deletion(-) create mode 100755 t/auto-daemon-tests-dtx-no-shift.pl diff --git a/t/Makefile b/t/Makefile index 1d551366f..53a4af910 100644 --- a/t/Makefile +++ b/t/Makefile @@ -107,7 +107,8 @@ include ../lib/common.Makefile daemon-tests-evs daemon-tests-player-cache daemon-tests-redis daemon-tests-redis-json \ daemon-tests-measure-rtp daemon-tests-mos-legacy daemon-tests-mos-fullband daemon-tests-config-file \ daemon-tests-templ-def daemon-tests-templ-def-offer daemon-tests-t38 daemon-tests-evs-dtx \ - daemon-tests-transform daemon-tests-http daemon-tests-heuristic daemon-tests-asymmetric + daemon-tests-transform daemon-tests-http daemon-tests-heuristic daemon-tests-asymmetric \ + daemon-tests-dtx-no-shift TESTS= test-bitstr aes-crypt aead-aes-crypt test-const_str_hash.strhash ifeq ($(with_transcoding),yes) @@ -171,6 +172,9 @@ daemon-tests-asymmetric: daemon-test-deps daemon-tests-dtx: daemon-test-deps ./auto-test-helper "$@" perl -I../perl auto-daemon-tests-dtx.pl +daemon-tests-dtx-no-shift: daemon-test-deps + ./auto-test-helper "$@" perl -I../perl auto-daemon-tests-dtx-no-shift.pl + daemon-tests-dtx-cn: daemon-test-deps ./auto-test-helper "$@" perl -I../perl auto-daemon-tests-dtx-cn.pl diff --git a/t/auto-daemon-tests-dtx-no-shift.pl b/t/auto-daemon-tests-dtx-no-shift.pl new file mode 100755 index 000000000..a3adf3f9c --- /dev/null +++ b/t/auto-daemon-tests-dtx-no-shift.pl @@ -0,0 +1,1822 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use NGCP::Rtpengine::Test; +use NGCP::Rtpclient::SRTP; +use NGCP::Rtpengine::AutoTest; +use Test::More; +use POSIX; + + +autotest_start(qw(--config-file=none -t -1 -i 203.0.113.1 -i 2001:db8:4321::1 + -n 2223 -c 12345 -f -L 7 -E -u 2222 --silence-detect=1 --dtx-delay=10 + --dtx-shift=0)) + or die; + + +my $amr_tests = $ENV{RTPENGINE_EXTENDED_TESTS}; +#my $amr_tests = 0; + + + +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, + @ret1, @ret2, @ret3, @ret4, $srtp_key_a, $srtp_key_b, $ts, $seq); + + + + +if ($amr_tests) { + +($sock_a, $sock_b) = new_call([qw(198.51.100.10 5210)], [qw(198.51.100.10 5212)]); + +($port_a) = offer('packet loss', + { codec => { transcode => ['L16/16000/1'], } }, < { transcode => ['L16/16000/1'], } }, < { transcode => ['L16/16000/1'], } }, < { transcode => ['L16/16000/1'], } }, < ['origin'], codec => { + transcode => ['AMR-WB'], + } }, < ['origin'] }, < silence +rcv($sock_b, $port_a, rtpm(96, $seq + 2, 4640, $ssrc, "\xf0\x1c\xc6\x84\x08\x40\x76\xe2\x23\x4d\x50\x5a\x76\x65\xf8\xc4\xeb\x7d\x0c\xce\xef\xcc\xd5\x4c\xd5\xdc\x17\x36\x45\xdd\xdf\xd5\x19\x56\xe5\x1b\x6d\xf0")); +rcv($sock_b, $port_a, rtpm(96, $seq + 3, 4960, $ssrc, "\xf0\x1c\xd2\x80\x02\x4a\x32\xe2\x4b\x5d\x50\x1c\x67\x71\x20\xc4\x45\x4b\x53\xb4\xf4\x4d\x5c\x64\x7e\x61\xc9\x8e\xec\xc7\x45\x64\xcf\x75\x7d\x02\xce\xf8")); +# 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\xe4\xd0\x00\xd9\xf3\xe5\x96\xf1\x71\xa5\x82\x8e\xea\x20\x5f\x58\xa0\xf5\x92\x97\x34\x82\x69\x98\x62\x13\x36\x06\x16\x0c\xc7\xcc\x4f\xa3\x4e\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\xc1\x46\x30\xff\xf7\xff\x22\x56\x7f\xf7\x0a\xf3\xde\x0a\x80\xb0\xfa\xbe\xcb\xd8\xb6\xb4\x1a\x0d\xce\x92\xd2\x86\x50\xe4\x9b\x50\x31\x32\x34\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\x90\xc6\x08\x73\x3a\xff\x06\x0c\x65\x1c\xe4\x51\xb9\xc4\x66\xfa\x8d\xdb\xc2\xcd\xd5\xcd\xed\x65\x94\xd7\x65\xdd\xf6\xf4\x45\xcc\x5c\xdc\x5c\xc8")); + +# 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\xd6\x84\x0a\x42\x3f\x62\x23\x4d\x50\x9f\x6e\x75\xc8\xc0\xc7\xac\x85\xd2\xe5\xd2\x7c\xc9\x53\xf5\x92\xa4\xe5\xdf\xdd\xcd\xda\x6e\xe0\x12\x44\xe8")); +rcv($sock_b, $port_a, rtpm(96, $seq + 10, 7200, 0x5678, "\xf0\x1c\xd2\x86\x0a\x40\x39\x61\x8e\xcd\x70\x5c\x4e\x53\xa0\xe4\x4d\xda\xf3\x34\xc4\xcc\x4c\x54\x46\xd1\xcb\x2e\xed\x55\x5d\xc0\x5b\x4e\xfd\x18\xce\x70")); + +# 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\xd4\xd6\xd0\xd0\xd3\xd0\xd0\xd7\x55\xf5\xe1\xef\xea\x94\x94\xef\xe4\xc9\x44\x78\x63\x6e\x68\x6e\x6d\x64\x7d\x46\xd7\xc1\xca\xf5\xf4\xc3\xd8\xda\xed\x97\x9d\x9e\x98\x9f\x96\xed\xda\x70\x6e\x14\x10\x13\x11\x17\x69\x60\x73\x47\xdd\xc7\xce\xcc\xd8\xdb\xe7\x97\x9d\x98\x85\x84\x99\x90\xe3\xd6\x61\x17\x1f\x1b\x1a\x1b\x1f\x10\x15\x63\x70\x5f\xcd\xf9\xe7\xe3\xe2\xe3\xe4\xfd\xc2\xdc\x58\x76\x78\x64\x60\x62\x6d\x6c\x62\x63\x61\x64\x7a\x7d\x71\x4d\x51\xdb\xf7\xff\xe5\xe5\xfa\xfe\xfc\xca\xd8\xd4\xd7\x51\x44\x47\x41\x4b\x7d\x66\x69\x14\x16\x10\x10\x17\x6b\x60\x73\xd8\xfb\xef\x97\x90\x90\x91\x97\xeb\xe6\xf1\xd0\x5a")); +rcv($sock_b, $port_a, rtpm(8, $seq + 10, 5600, 0x5678, "\x77\x72\x7c\x70\x5b\xde\xc1\xd3\xd4\x40\x73\x67\x63\x6c\x6f\x6c\x63\x64\x7f\x48\x5e\xd0\xdb\xc1\xc1\xda\xd2\x56\x59\x42\x4b\x77\x77\x77\x75\x4e\x41\x59\x53\xd5\xd1\xd2\xdd\xdd\xd3\xd6\xd5\x57\x51\x53\x52\x52\x53\x51\x57\xd5\xd7\xd0\xd3\xdd\xdc\xdc\xdc\xdd\xd2\xd2\xd3\xd0\xd0\xd0\xd0\xd3\xd3\xd2\xdd\xdc\xdc\xdf\xdf\xdf\xde\xdf\xdf\xdf\xdf\xdf\xdc\xdc\xdc\xdc\xdf\xdf\xdf\xdf\xdf\xdf\xdf\xdf\xdf\xdf\xdf\xdf\xdf\xdf\xdf\xdf\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xd2\xd2\xd2\xd2\xd2\xd2\xd2\xd2\xd3\xd3\xd3\xd3\xd3\xd3\xd3\xd3\xd0\xd0\xd0\xd0\xd0\xd0\xd0\xd0\xd0\xd1\xd1\xd1\xd1\xd1\xd1")); + +# 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', + { 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 + +($port_a) = offer('G.711/AMR codec change with timing', + { replace => ['origin'], codec => { + transcode => ['PCMA'], + } }, < ['origin'] }, < silence +rcv($sock_b, $port_a, rtpm(8, $seq + 9, 5440, 0x5678, "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\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\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\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\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\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\xd5\xd5\xd5\xd5\xd5\xd5")); +rcv($sock_b, $port_a, rtpm(8, $seq + 10, 5600, 0x5678, "\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\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\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\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\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\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5")); + +# inject old PCM +snd($sock_a, $port_b, rtp(0, 2006, 5600, 0x5678, "\x40" x 160)); +# packet dropped +rcv_no($sock_b); + +# reinvite back to PCM + +($port_a) = offer('G.711/AMR codec change with timing', + { replace => ['origin'], codec => { + transcode => ['PCMA'], + } }, < ['origin'] }, < ft() }); + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.10 4024)], [qw(198.51.100.10 4026)]); + +($port_a) = offer('AMR SID', + { ICE => 'remove', replace => ['origin'], codec => { transcode => ['PCMA'], + 'set' => ['AMR-WB/16000/1/23850'] } }, < 'remove', replace => ['origin'] }, < ft() }); + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.10 4026)], [qw(198.51.100.10 4028)]); + +($port_a) = offer('AMR SID TS gap', + { ICE => 'remove', replace => ['origin'], codec => { transcode => ['PCMA'], + 'set' => ['AMR-WB/16000/1/23850'] } }, < 'remove', replace => ['origin'] }, < ft() }); + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.10 4034)], [qw(198.51.100.10 4036)]); + +($port_a) = offer('AMR w DTMF', + { + codec => { + mask => ['all'], + transcode => [ + 'G722', + 'AMR-WB/16000/1///mode-set--0,1,2;mode-change-period--2;mode-change-capability--2', + 'AMR', + 'PCMA', + 'telephone-event' + ], + } }, < ['single codec'] }, < ft() }); + + + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.10 4042)], [qw(198.51.100.10 4044)]); + +($port_a) = offer('AMR w reverse DTMF', + { + codec => { + mask => ['all'], + transcode => [ + 'AMR-WB/16000/1///mode-set--0,1,2;mode-change-period--2;mode-change-capability--2/dtx--1', + 'PCMA', + 'telephone-event' + ], + } }, < [] }, < ft() }); + +} + + +($sock_a, $sock_b) = new_call([qw(198.51.100.10 5000)], [qw(198.51.100.10 5002)]); + +($port_a) = offer('G.711 DTX', + { 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)); + +rtpe_req('delete', 'G.711 DTX', { 'from-tag' => ft() }); + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.10 5032)], [qw(198.51.100.10 5034)]); + +($port_a) = offer('G.711 DTX with seq skips', + { replace => ['origin'], codec => { + transcode => ['PCMA'], + } }, < ['origin'] }, < silence +rcv($sock_b, $port_a, rtpm(8, $seq + 2, $ts + 320, $ssrc, "\xd5" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 3, $ts + 480, $ssrc, "\xd5" x 160)); +# start audio again +snd($sock_a, $port_b, rtp(0, 4002, $ts + 640, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 4, $ts + 640, $ssrc, "\x68" x 160)); +snd($sock_a, $port_b, rtp(0, 4003, $ts + 800, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 5, $ts + 800, $ssrc, "\x68" x 160)); +snd($sock_a, $port_b, rtp(0, 4004, $ts + 960, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 6, $ts + 960, $ssrc, "\x68" x 160)); +snd($sock_a, $port_b, rtp(0, 4005, $ts + 1120, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 7, $ts + 1120, $ssrc, "\x68" x 160)); +snd($sock_a, $port_b, rtp(0, 4006, $ts + 1280, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 8, $ts + 1280, $ssrc, "\x68" x 160)); +snd($sock_a, $port_b, rtp(0, 4007, $ts + 1440, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 9, $ts + 1440, $ssrc, "\x68" x 160)); +# lost packet 4008 (skip seq), trigger DTX +rcv($sock_b, $port_a, rtpm(8, $seq + 10, $ts + 1600, $ssrc, "\xd5" x 160)); +# resume +snd($sock_a, $port_b, rtp(0, 4009, $ts + 1760, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 11, $ts + 1760, $ssrc, "\xd5" x 160)); +snd($sock_a, $port_b, rtp(0, 4010, $ts + 1920, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 12, $ts + 1920, $ssrc, "\x68" x 160)); +snd($sock_a, $port_b, rtp(0, 4011, $ts + 2080, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 13, $ts + 2080, $ssrc, "\xd5" x 160)); +snd($sock_a, $port_b, rtp(0, 4012, $ts + 2240, 0x5678, "\x40" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 14, $ts + 2240, $ssrc, "\x68" x 160)); + +rtpe_req('delete', 'G.711 DTX with seq skips', { 'from-tag' => ft() }); + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.10 5004)], [qw(198.51.100.10 5006)]); + +($port_a) = offer('G.711 DTX ptime=30', + { replace => ['origin'], codec => { + transcode => ['PCMA'], + } }, < ['origin'] }, < silence +rcv($sock_b, $port_a, rtpm(8, $seq + 2, 4480, $ssrc, "\xd5" x 240)); +rcv($sock_b, $port_a, rtpm(8, $seq + 3, 4720, $ssrc, "\xd5" x 240)); +# start audio again +snd($sock_a, $port_b, rtp(0, 2002, 4960, 0x5678, "\x40" x 240)); +rcv($sock_b, $port_a, rtpm(8, $seq + 4, 4960, $ssrc, "\x68" x 240)); + +rtpe_req('delete', 'G.711 DTX ptime=30', { 'from-tag' => ft() }); + + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.10 5008)], [qw(198.51.100.10 5010)]); + +($port_a) = offer('G.711 DTX ptime change', + { replace => ['origin'], codec => { + transcode => ['PCMA'], + } }, < ['origin'] }, < silence +rcv($sock_b, $port_a, rtpm(8, $seq + 3, 4480, $ssrc, "\xd5" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 4, 4640, $ssrc, "\xd5" x 160)); +rcv($sock_b, $port_a, rtpm(8, $seq + 5, 4800, $ssrc, "\xd5" x 160)); +# start audio again +snd($sock_a, $port_b, rtp(0, 2002, 4960, 0x5678, "\x40" x 240)); +rcv($sock_b, $port_a, rtpm(8, $seq + 6, 4960, $ssrc, "\x68" x 160)); + +rtpe_req('delete', 'G.711 DTX ptime change', { 'from-tag' => ft() }); + + + +#done_testing;NGCP::Rtpengine::AutoTest::terminate('f00');exit; +done_testing();