Skip to content

Commit 8121ae2

Browse files
committed
MT#55283 add even more DTX tests
Change-Id: Ic723c3979097287cbe05a1b1aacbc80e452ded9f
1 parent 940f84b commit 8121ae2

File tree

1 file changed

+381
-0
lines changed

1 file changed

+381
-0
lines changed

t/auto-daemon-tests-dtx.pl

+381
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,387 @@
3030

3131
if ($amr_tests) {
3232

33+
($sock_a, $sock_b) = new_call([qw(198.51.100.10 5128)], [qw(198.51.100.10 5130)]);
34+
35+
($port_a) = offer('G.711/AMR-WB codec change reverse',
36+
{ replace => ['origin'], codec => {
37+
transcode => ['AMR-WB'],
38+
} }, <<SDP);
39+
v=0
40+
o=- 1545997027 1 IN IP4 198.51.100.10
41+
s=tester
42+
t=0 0
43+
m=audio 5128 RTP/AVP 0
44+
c=IN IP4 198.51.100.10
45+
a=sendrecv
46+
----------------------------------
47+
v=0
48+
o=- 1545997027 1 IN IP4 203.0.113.1
49+
s=tester
50+
t=0 0
51+
m=audio PORT RTP/AVP 0 96
52+
c=IN IP4 203.0.113.1
53+
a=rtpmap:0 PCMU/8000
54+
a=rtpmap:96 AMR-WB/16000
55+
a=fmtp:96 octet-align=1;mode-change-capability=2
56+
a=sendrecv
57+
a=rtcp:PORT
58+
SDP
59+
60+
($port_b) = answer('G.711/AMR-WB codec change reverse',
61+
{ replace => ['origin'] }, <<SDP);
62+
v=0
63+
o=- 1545997027 1 IN IP4 198.51.100.10
64+
s=tester
65+
t=0 0
66+
m=audio 5130 RTP/AVP 96
67+
c=IN IP4 198.51.100.10
68+
a=rtpmap:96 AMR-WB/16000
69+
a=fmtp:96 octet-align=1;mode-change-capability=2
70+
a=sendrecv
71+
--------------------------------------
72+
v=0
73+
o=- 1545997027 1 IN IP4 203.0.113.1
74+
s=tester
75+
t=0 0
76+
m=audio PORT RTP/AVP 0
77+
c=IN IP4 203.0.113.1
78+
a=rtpmap:0 PCMU/8000
79+
a=sendrecv
80+
a=rtcp:PORT
81+
SDP
82+
83+
snd($sock_a, $port_b, rtp(0, 2000, 4000, 0x5678, "\x40" x 160));
84+
($seq, $ssrc) = rcv($sock_b, $port_a, rtpm(96, -1, 4000, -1, "\xf0\x1c\xd2\x46\x09\x00\xc5\x53\x22\x71\x71\x02\x0a\x16\x87\x74\x6a\xe2\x8c\x8e\xef\xe7\x6c\x7d\x6f\x6c\xd5\xe5\x55\xc4\xfc\x40\x04\x7c\x55\x44\x6c\x48"));
85+
snd($sock_a, $port_b, rtp(0, 2001, 4160, 0x5678, "\x40" x 160));
86+
rcv($sock_b, $port_a, rtpm(96, $seq + 1, 4320, $ssrc, "\xf0\x1c\xca\xe6\x0e\xa6\xbb\x59\xe3\x5d\x72\x4a\xb0\x71\x99\xc4\xc0\x97\x72\x34\xed\xf5\xed\x5c\xd7\x74\x5e\xc6\x54\x4c\xe6\x44\x86\x7f\xcc\x85\x98\xd8"));
87+
# DTX -> silence
88+
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"));
89+
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"));
90+
# start audio again
91+
snd($sock_a, $port_b, rtp(0, 2002, 4640, 0x5678, "\x40" x 160));
92+
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"));
93+
# interject unknown payload type
94+
snd($sock_a, $port_b, rtp(9, 2003, 4800, 0x5678, "\x40" x 160));
95+
# no passthrough, get more DTX
96+
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"));
97+
snd($sock_a, $port_b, rtp(9, 2004, 4960, 0x5678, "\x40" x 160));
98+
# back to normal media
99+
snd($sock_a, $port_b, rtp(0, 2003, 4960, 0x5678, "\x40" x 160));
100+
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"));
101+
102+
# reinvite to PCMA
103+
104+
($port_a) = offer('G.711/AMR-WB codec change reverse',
105+
{ replace => ['origin'], codec => {
106+
transcode => ['AMR-WB'],
107+
} }, <<SDP);
108+
v=0
109+
o=- 1545997027 1 IN IP4 198.51.100.10
110+
s=tester
111+
t=0 0
112+
m=audio 5128 RTP/AVP 8 0
113+
c=IN IP4 198.51.100.10
114+
a=sendrecv
115+
----------------------------------
116+
v=0
117+
o=- 1545997027 1 IN IP4 203.0.113.1
118+
s=tester
119+
t=0 0
120+
m=audio PORT RTP/AVP 8 0 96
121+
c=IN IP4 203.0.113.1
122+
a=rtpmap:8 PCMA/8000
123+
a=rtpmap:0 PCMU/8000
124+
a=rtpmap:96 AMR-WB/16000
125+
a=fmtp:96 octet-align=1;mode-change-capability=2
126+
a=sendrecv
127+
a=rtcp:PORT
128+
SDP
129+
130+
($port_b) = answer('G.711/AMR-WB codec change reverse',
131+
{ replace => ['origin'] }, <<SDP);
132+
v=0
133+
o=- 1545997027 1 IN IP4 198.51.100.10
134+
s=tester
135+
t=0 0
136+
m=audio 5130 RTP/AVP 96
137+
c=IN IP4 198.51.100.10
138+
a=rtpmap:96 AMR-WB/16000
139+
a=fmtp:96 octet-align=1;mode-change-capability=2
140+
a=sendrecv
141+
--------------------------------------
142+
v=0
143+
o=- 1545997027 1 IN IP4 203.0.113.1
144+
s=tester
145+
t=0 0
146+
m=audio PORT RTP/AVP 8
147+
c=IN IP4 203.0.113.1
148+
a=rtpmap:8 PCMA/8000
149+
a=sendrecv
150+
a=rtcp:PORT
151+
SDP
152+
153+
snd($sock_a, $port_b, rtp(8, 2004, 5120, 0x5678, "\x33" x 160));
154+
rcv($sock_b, $port_a, rtpm(96, $seq + 7, 6240, 0x5678, "\xf0\x1c\xd0\x46\x09\x29\x51\x53\x02\x71\x71\x00\x0a\x16\x87\x74\xea\x6a\x0c\x8e\x6e\x7e\x65\x64\xfe\x4d\x4c\x64\xd4\x5d\x6d\xc0\x95\x7c\xcc\xd4\x7d\x58"));
155+
snd($sock_a, $port_b, rtp(8, 2005, 5280, 0x5678, "\x33" x 160));
156+
rcv($sock_b, $port_a, rtpm(96, $seq + 8, 6560, 0x5678, "\xf0\x1c\x8a\xe6\x0e\x4c\xf8\x73\xc7\x8c\x21\xda\x7c\x43\xa9\xc4\x4d\x92\x73\x3e\xc4\x54\x54\xcd\xd6\xec\xde\xd5\xf1\x57\xdc\x7d\x0b\xc4\xc1\x12\x29\x78"));
157+
# DTX -> silence
158+
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"));
159+
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"));
160+
161+
# inject old PCM
162+
snd($sock_a, $port_b, rtp(0, 2004, 5120, 0x5678, "\x40" x 160));
163+
snd($sock_a, $port_b, rtp(0, 2006, 5440, 0x5678, "\x40" x 160));
164+
# packet dropped
165+
rcv_no($sock_b);
166+
167+
# reinvite back to PCMU
168+
169+
($port_a) = offer('G.711/AMR-WB codec change reverse',
170+
{ replace => ['origin'], codec => {
171+
transcode => ['AMR-WB'],
172+
} }, <<SDP);
173+
v=0
174+
o=- 1545997027 1 IN IP4 198.51.100.10
175+
s=tester
176+
t=0 0
177+
m=audio 5128 RTP/AVP 0
178+
c=IN IP4 198.51.100.10
179+
a=sendrecv
180+
----------------------------------
181+
v=0
182+
o=- 1545997027 1 IN IP4 203.0.113.1
183+
s=tester
184+
t=0 0
185+
m=audio PORT RTP/AVP 0 96
186+
c=IN IP4 203.0.113.1
187+
a=rtpmap:0 PCMU/8000
188+
a=rtpmap:96 AMR-WB/16000
189+
a=fmtp:96 octet-align=1;mode-change-capability=2
190+
a=sendrecv
191+
a=rtcp:PORT
192+
SDP
193+
194+
($port_b) = answer('G.711/AMR-WB codec change reverse',
195+
{ replace => ['origin'] }, <<SDP);
196+
v=0
197+
o=- 1545997027 1 IN IP4 198.51.100.10
198+
s=tester
199+
t=0 0
200+
m=audio 5130 RTP/AVP 96
201+
c=IN IP4 198.51.100.10
202+
a=rtpmap:96 AMR-WB/16000
203+
a=fmtp:96 octet-align=1;mode-change-capability=2
204+
a=sendrecv
205+
--------------------------------------
206+
v=0
207+
o=- 1545997027 1 IN IP4 203.0.113.1
208+
s=tester
209+
t=0 0
210+
m=audio PORT RTP/AVP 0
211+
c=IN IP4 203.0.113.1
212+
a=rtpmap:0 PCMU/8000
213+
a=sendrecv
214+
a=rtcp:PORT
215+
SDP
216+
217+
218+
snd($sock_a, $port_b, rtp(0, 2007, 5760, 0x5678, "\x40" x 160));
219+
rcv($sock_b, $port_a, rtpm(96, $seq + 11, 7520, $ssrc, "\xf0\x1c\x21\x40\x00\xff\xfb\xfc\x92\x17\x2f\x21\x34\xcb\x60\x28\x1b\x23\x23\x30\x04\x87\xb1\x30\x4f\x91\x04\x5e\xd9\xc6\x6c\xfc\x28\xed\xe1\xc6\xd5\xe0"));
220+
snd($sock_a, $port_b, rtp(0, 2007, 5920, 0x5678, "\x40" x 160));
221+
rcv($sock_b, $port_a, rtpm(96, $seq + 12, 7840, $ssrc, "\xf0\x1c\xc8\xc6\x04\x55\x92\x65\x07\x9c\x21\x19\x06\x71\x89\xd4\x66\xe6\x84\xe6\xc5\xc4\xc4\xcc\x5e\xc1\xc5\xf5\x4c\x55\xde\x71\x9a\x57\xc0\xde\xe4\xd0"));
222+
223+
rtpe_req('delete', 'G.711/AMR-WB codec change reverse', { 'from-tag' => ft() });
224+
225+
226+
227+
($sock_a, $sock_b) = new_call([qw(198.51.100.10 5098)], [qw(198.51.100.10 5100)]);
228+
229+
($port_a) = offer('G.711/AMR-WB codec change with timing',
230+
{ replace => ['origin'], codec => {
231+
transcode => ['PCMA'],
232+
} }, <<SDP);
233+
v=0
234+
o=- 1545997027 1 IN IP4 198.51.100.10
235+
s=tester
236+
t=0 0
237+
m=audio 5098 RTP/AVP 0
238+
c=IN IP4 198.51.100.10
239+
a=sendrecv
240+
----------------------------------
241+
v=0
242+
o=- 1545997027 1 IN IP4 203.0.113.1
243+
s=tester
244+
t=0 0
245+
m=audio PORT RTP/AVP 0 8
246+
c=IN IP4 203.0.113.1
247+
a=rtpmap:0 PCMU/8000
248+
a=rtpmap:8 PCMA/8000
249+
a=sendrecv
250+
a=rtcp:PORT
251+
SDP
252+
253+
($port_b) = answer('G.711/AMR-WB codec change with timing',
254+
{ replace => ['origin'] }, <<SDP);
255+
v=0
256+
o=- 1545997027 1 IN IP4 198.51.100.10
257+
s=tester
258+
t=0 0
259+
m=audio 5100 RTP/AVP 8
260+
c=IN IP4 198.51.100.10
261+
a=sendrecv
262+
--------------------------------------
263+
v=0
264+
o=- 1545997027 1 IN IP4 203.0.113.1
265+
s=tester
266+
t=0 0
267+
m=audio PORT RTP/AVP 0
268+
c=IN IP4 203.0.113.1
269+
a=rtpmap:0 PCMU/8000
270+
a=sendrecv
271+
a=rtcp:PORT
272+
SDP
273+
274+
snd($sock_a, $port_b, rtp(0, 2000, 4000, 0x5678, "\x40" x 160));
275+
($seq, $ts, $ssrc) = rcv($sock_b, $port_a, rtpm(8, -1, -1, -1, "\x68" x 160));
276+
snd($sock_a, $port_b, rtp(0, 2001, 4160, 0x5678, "\x40" x 160));
277+
rcv($sock_b, $port_a, rtpm(8, $seq + 1, 4160, $ssrc, "\x68" x 160));
278+
# DTX -> silence
279+
rcv($sock_b, $port_a, rtpm(8, $seq + 2, 4320, $ssrc, "\xd5" x 160));
280+
rcv($sock_b, $port_a, rtpm(8, $seq + 3, 4480, $ssrc, "\xd5" x 160));
281+
# start audio again
282+
snd($sock_a, $port_b, rtp(0, 2002, 4640, 0x5678, "\x40" x 160));
283+
rcv($sock_b, $port_a, rtpm(8, $seq + 4, 4640, $ssrc, "\x68" x 160));
284+
# interject unknown payload type
285+
snd($sock_a, $port_b, rtp(9, 2003, 4800, 0x5678, "\x40" x 160));
286+
# no passthrough, get more DTX
287+
rcv($sock_b, $port_a, rtpm(8, $seq + 5, 4800, $ssrc, "\xd5" x 160));
288+
snd($sock_a, $port_b, rtp(9, 2004, 4960, 0x5678, "\x40" x 160));
289+
# back to normal media
290+
snd($sock_a, $port_b, rtp(0, 2003, 4960, 0x5678, "\x40" x 160));
291+
rcv($sock_b, $port_a, rtpm(8, $seq + 6, 4960, $ssrc, "\x68" x 160));
292+
293+
# reinvite to AMR-WB
294+
295+
($port_a) = offer('G.711/AMR-WB codec change with timing',
296+
{ replace => ['origin'], codec => {
297+
transcode => ['PCMA'],
298+
} }, <<SDP);
299+
v=0
300+
o=- 1545997027 1 IN IP4 198.51.100.10
301+
s=tester
302+
t=0 0
303+
m=audio 5098 RTP/AVP 96 0
304+
c=IN IP4 198.51.100.10
305+
a=rtpmap:96 AMR-WB/16000
306+
a=sendrecv
307+
----------------------------------
308+
v=0
309+
o=- 1545997027 1 IN IP4 203.0.113.1
310+
s=tester
311+
t=0 0
312+
m=audio PORT RTP/AVP 96 0 8
313+
c=IN IP4 203.0.113.1
314+
a=rtpmap:96 AMR-WB/16000
315+
a=rtpmap:0 PCMU/8000
316+
a=rtpmap:8 PCMA/8000
317+
a=sendrecv
318+
a=rtcp:PORT
319+
SDP
320+
321+
($port_b) = answer('G.711/AMR-WB codec change with timing',
322+
{ replace => ['origin'] }, <<SDP);
323+
v=0
324+
o=- 1545997027 1 IN IP4 198.51.100.10
325+
s=tester
326+
t=0 0
327+
m=audio 5100 RTP/AVP 8
328+
c=IN IP4 198.51.100.10
329+
a=sendrecv
330+
--------------------------------------
331+
v=0
332+
o=- 1545997027 1 IN IP4 203.0.113.1
333+
s=tester
334+
t=0 0
335+
m=audio PORT RTP/AVP 96
336+
c=IN IP4 203.0.113.1
337+
a=rtpmap:96 AMR-WB/16000
338+
a=sendrecv
339+
a=rtcp:PORT
340+
SDP
341+
342+
snd($sock_a, $port_b, rtp(96, 2004, 5120, 0x5678, "\xf0\x1c\xd0\x46\x09\xa1\xf1\x73\x02\x71\x71\x00\x0a\x16\x87\x74\xea\x6a\x8c\x06\x67\x66\xec\xf5\x67\x6c\x54\x6d\x45\x4c\x7c\x59\x8d\x7c\x55\xc4\x6c\x50"));
343+
rcv($sock_b, $port_a, rtpm(8, $seq + 7, 5120, 0x5678, "\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\x55\xd6\xdc\xd8\xc5\xc4\xc7\xdb\xdf\xd1\x54\x53\x5e\x58\x5a\x5b\x58\x5f\x53\x56\xd5\xd7\xd1\xd1\xd1\xd6\xd7\xd4\xdf\xc4\xc2\xcf\xc8\xc9\xc1\xd8\xd1\x54\x5d\x5e\x5b\x5a\x5b\x58\x5e\x5f\x5d\x53\x51\x51\x56\x56\x51\x56\xd7\xdf\xc5\xc3\xc9\xcb\xc9\xc3\xdb\xd0\x54\x5c\x45\x41\x42\x4d\x42\x41\x45\x58\x5d\x53\xdb\xf0\xf8\xe7\xe1\xe6\xfa\xf1\xf5\xf5\xc3\xc5\xdf\xd3\x52\x44\x49\x76\x7d\x7f\x7e\x7f\x7d\x71\x74\x5d\xc6\xf1\xfe\xe5\xe5\xff\xf5\xc0\xc0\xd2\x55\xd5\xcd\xf7\xf0\xff\xf1\xf3\x65\x0f\x30\x39\x3a\x24\x3b\x32\x08\x14\x9d\xb5\xb3\xbe\xbe\xbf\xb0\x8b\x85\xe7\x63\x1f\x04\x05"));
344+
snd($sock_a, $port_b, rtp(96, 2005, 5440, 0x5678, "\xf0\x1c\xd0\x46\x09\xa1\xf1\x73\x02\x71\x71\x00\x0a\x16\x87\x74\xea\x6a\x8c\x06\x67\x66\xec\xf5\x67\x6c\x54\x6d\x45\x4c\x7c\x59\x8d\x7c\x55\xc4\x6c\x50"));
345+
rcv($sock_b, $port_a, rtpm(8, $seq + 8, 5280, 0x5678, "\x1c\x68\x71\x92\xb7\xbe\xbf\xb3\xb4\x9b\x63\x0d\x34\x33\x33\x36\x08\x04\x60\xe9\x9a\x80\x8d\x82\x86\x99\xea\xc1\x64\x14\x10\x12\x10\x14\x62\x73\xd0\xf2\xe7\xe3\xe3\xe1\xfa\xf1\xdb\x52\x4f\x76\x73\x73\x76\x48\x44\x53\xd1\xd9\xc4\xc7\xc4\xdb\xdc\xd1\x54\x50\x5c\x5f\x5e\x5f\x5c\x53\x51\x57\x55\xd5\xd4\xd4\xd4\xd5\x54\x57\x56\x56\x51\x51\x51\x51\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x56\x56\x56\x56\x56\x56\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x57\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54\x54"));
346+
# DTX -> silence
347+
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"));
348+
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"));
349+
350+
# inject old PCM
351+
snd($sock_a, $port_b, rtp(0, 2006, 5760, 0x5678, "\x40" x 160));
352+
# packet dropped
353+
rcv_no($sock_b);
354+
355+
# reinvite back to PCM
356+
357+
($port_a) = offer('G.711/AMR-WB codec change with timing',
358+
{ replace => ['origin'], codec => {
359+
transcode => ['PCMA'],
360+
} }, <<SDP);
361+
v=0
362+
o=- 1545997027 1 IN IP4 198.51.100.10
363+
s=tester
364+
t=0 0
365+
m=audio 5098 RTP/AVP 0
366+
c=IN IP4 198.51.100.10
367+
a=sendrecv
368+
----------------------------------
369+
v=0
370+
o=- 1545997027 1 IN IP4 203.0.113.1
371+
s=tester
372+
t=0 0
373+
m=audio PORT RTP/AVP 0 8
374+
c=IN IP4 203.0.113.1
375+
a=rtpmap:0 PCMU/8000
376+
a=rtpmap:8 PCMA/8000
377+
a=sendrecv
378+
a=rtcp:PORT
379+
SDP
380+
381+
($port_b) = answer('G.711/AMR-WB codec change with timing',
382+
{ replace => ['origin'] }, <<SDP);
383+
v=0
384+
o=- 1545997027 1 IN IP4 198.51.100.10
385+
s=tester
386+
t=0 0
387+
m=audio 5100 RTP/AVP 8
388+
c=IN IP4 198.51.100.10
389+
a=sendrecv
390+
--------------------------------------
391+
v=0
392+
o=- 1545997027 1 IN IP4 203.0.113.1
393+
s=tester
394+
t=0 0
395+
m=audio PORT RTP/AVP 0
396+
c=IN IP4 203.0.113.1
397+
a=rtpmap:0 PCMU/8000
398+
a=sendrecv
399+
a=rtcp:PORT
400+
SDP
401+
402+
403+
snd($sock_a, $port_b, rtp(0, 2007, 5920, 0x5678, "\x40" x 160));
404+
rcv($sock_b, $port_a, rtpm(8, $seq + 11, 5760, $ssrc, "\x68" x 160));
405+
snd($sock_a, $port_b, rtp(0, 2008, 6080, 0x5678, "\x40" x 160));
406+
rcv($sock_b, $port_a, rtpm(8, $seq + 12, 5920, $ssrc, "\x68" x 160));
407+
408+
rtpe_req('delete', 'G.711/AMR-WB codec change with timing', { 'from-tag' => ft() });
409+
410+
411+
412+
413+
33414
($sock_a, $sock_b) = new_call([qw(198.51.100.10 5068)], [qw(198.51.100.10 5070)]);
34415

35416
($port_a) = offer('G.711/AMR codec change with timing',

0 commit comments

Comments
 (0)