|
|
|
@ -26,6 +26,87 @@ my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $ssrc_b, $resp, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( |
|
|
|
[qw(198.51.100.1 7184)], |
|
|
|
[qw(198.51.100.1 7185)], |
|
|
|
[qw(198.51.100.3 7186)], |
|
|
|
[qw(198.51.100.3 7187)], |
|
|
|
); |
|
|
|
|
|
|
|
($port_a, $port_ax) = offer('unidirectional', { }, <<SDP); |
|
|
|
v=0 |
|
|
|
o=- 1545997027 1 IN IP4 198.51.100.1 |
|
|
|
s=tester |
|
|
|
t=0 0 |
|
|
|
m=audio 7184 RTP/AVP 8 |
|
|
|
c=IN IP4 198.51.100.1 |
|
|
|
a=sendrecv |
|
|
|
---------------------------------- |
|
|
|
v=0 |
|
|
|
o=- 1545997027 1 IN IP4 198.51.100.1 |
|
|
|
s=tester |
|
|
|
t=0 0 |
|
|
|
m=audio PORT RTP/AVP 8 |
|
|
|
c=IN IP4 203.0.113.1 |
|
|
|
a=rtpmap:8 PCMA/8000 |
|
|
|
a=sendrecv |
|
|
|
a=rtcp:PORT |
|
|
|
SDP |
|
|
|
|
|
|
|
($port_b, $port_bx) = answer('unidirectional', { }, <<SDP); |
|
|
|
v=0 |
|
|
|
o=- 1545997027 1 IN IP4 198.51.100.3 |
|
|
|
s=tester |
|
|
|
t=0 0 |
|
|
|
m=audio 7186 RTP/AVP 8 |
|
|
|
c=IN IP4 198.51.100.3 |
|
|
|
a=rtpmap:8 PCMA/8000 |
|
|
|
a=sendrecv |
|
|
|
-------------------------------------- |
|
|
|
v=0 |
|
|
|
o=- 1545997027 1 IN IP4 198.51.100.3 |
|
|
|
s=tester |
|
|
|
t=0 0 |
|
|
|
m=audio PORT RTP/AVP 8 |
|
|
|
c=IN IP4 203.0.113.1 |
|
|
|
a=rtpmap:8 PCMA/8000 |
|
|
|
a=sendrecv |
|
|
|
a=rtcp:PORT |
|
|
|
SDP |
|
|
|
|
|
|
|
snd($sock_a, $port_b, rtp( 8, 1000, 3000+160*0, 0x1234, "\x00" x 160)); |
|
|
|
rcv($sock_b, $port_a, rtpm(8, 1000, 3000+160*0, 0x1234, "\x00" x 160)); |
|
|
|
snd($sock_b, $port_a, rtp( 8, 8000, 7000+160*0, 0x6543, "\x00" x 160)); |
|
|
|
rcv($sock_a, $port_b, rtpm(8, 8000, 7000+160*0, 0x6543, "\x00" x 160)); |
|
|
|
|
|
|
|
# RTCP |
|
|
|
# SR LEN SSRC NTP1 NTP2 RTP PACKETS OCTETS SSRC LOST SEQ JITTER LAST SR DLSR |
|
|
|
snd($sock_bx, $port_ax, "\x81\xc8\x00\x08\x00\x00\x65\x43\x11\x22\x33\x44\x11\x22\x33\x44\x11\x22\x33\x44\x00\x00\x00\x01\x00\x00\x00\xac\x00\x00\x12\x34\x00\x00\x00\x00\x00\x00\x03\xe8\x00\x00\x00\x00\x56\x78\x9a\xbc\x00\x00\x00\x20"); |
|
|
|
rcv($sock_ax, $port_bx, qr/^.*$/s); |
|
|
|
|
|
|
|
$resp = rtpe_req('delete', 'delete', { 'delete delay' => 0 } ); |
|
|
|
#print Dumper($resp); |
|
|
|
#print Dumper($resp->{SSRC}); |
|
|
|
is($resp->{SSRC}{0x1234}{bytes}, 172, "0x1234 byte count"); |
|
|
|
is($resp->{SSRC}{0x6543}{bytes}, 172, "0x6543 byte count"); |
|
|
|
is($resp->{SSRC}{0x6543}{'highest MOS'}{MOS}, '43', "0x6543 MOS"); |
|
|
|
#print Dumper($resp->{tags}{ft()}{medias}[0]{'egress SSRCs'}); |
|
|
|
is($resp->{tags}{ft()}{medias}[0]{'egress SSRCs'}[0]{SSRC}, 0x6543, 'egress SSRC'); |
|
|
|
#print Dumper($resp->{tags}{ft()}{medias}[0]{'ingress SSRCs'}); |
|
|
|
#print Dumper($resp->{tags}{ft()}{medias}[0]{streams}[0]{SSRC}); |
|
|
|
#print Dumper($resp->{tags}{tt()}{medias}[0]{'egress SSRCs'}); |
|
|
|
#print Dumper($resp->{tags}{tt()}{medias}[0]{'ingress SSRCs'}); |
|
|
|
#print Dumper($resp->{tags}{tt()}{medias}[0]{streams}[0]{SSRC}); |
|
|
|
is($resp->{tags}{tt()}{medias}[0]{'ingress SSRCs'}[0]{SSRC}, 0x6543, 'ingress SSRC'); |
|
|
|
is($resp->{tags}{tt()}{medias}[0]{'ingress SSRCs'}[0]{'highest MOS'}{MOS}, '43', 'ingress SSRC MOS'); |
|
|
|
is($resp->{totals}{RTP}{packets}, 2, 'RTP packet count'); |
|
|
|
is($resp->{totals}{RTP}{bytes}, 344, 'RTP octet count'); |
|
|
|
is($resp->{totals}{RTCP}{packets}, 1, 'RTCP packet count'); |
|
|
|
is($resp->{totals}{RTCP}{bytes}, 52, 'RTCP octet count'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( |
|
|
|
[qw(198.51.100.1 7160)], |
|
|
|
[qw(198.51.100.1 7161)], |
|
|
|
|