<p>Friendly Automation <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10627">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua C. Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">testsuite: Added tests for correct packetization + review update<br><br>Added tests for transcode and a non transcode plus contrib/scripts<br>for verification<br>Also added the test directory to the pjsip tests.yaml<br><br>ASTERISK-28110 #close<br><br>Change-Id: I16cfb5805d2b96fdf5cdbc8f53a86522d1d251a7<br>---<br>A contrib/scripts/verify_codecs.pl<br>A contrib/scripts/verify_rtp_len.pl<br>A tests/channels/pjsip/rtp_ptime/non-transcode/configs/ast1/extensions.conf<br>A tests/channels/pjsip/rtp_ptime/non-transcode/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/rtp_ptime/non-transcode/run-test<br>A tests/channels/pjsip/rtp_ptime/non-transcode/sipp/40msalaw.pcap<br>A tests/channels/pjsip/rtp_ptime/non-transcode/sipp/uac_asterisk.xml<br>A tests/channels/pjsip/rtp_ptime/non-transcode/sipp/uas_asterisk.xml<br>A tests/channels/pjsip/rtp_ptime/non-transcode/test-config.yaml<br>A tests/channels/pjsip/rtp_ptime/tests.yaml<br>A tests/channels/pjsip/rtp_ptime/transcode/configs/ast1/extensions.conf<br>A tests/channels/pjsip/rtp_ptime/transcode/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/rtp_ptime/transcode/run-test<br>A tests/channels/pjsip/rtp_ptime/transcode/sipp/40msalaw.pcap<br>A tests/channels/pjsip/rtp_ptime/transcode/sipp/uac_asterisk.xml<br>A tests/channels/pjsip/rtp_ptime/transcode/sipp/uas_asterisk.xml<br>A tests/channels/pjsip/rtp_ptime/transcode/test-config.yaml<br>M tests/channels/pjsip/tests.yaml<br>18 files changed, 908 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/contrib/scripts/verify_codecs.pl b/contrib/scripts/verify_codecs.pl</span><br><span>new file mode 100644</span><br><span>index 0000000..5c00e60</span><br><span>--- /dev/null</span><br><span>+++ b/contrib/scripts/verify_codecs.pl</span><br><span>@@ -0,0 +1,109 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/usr/bin/perl</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+use strict;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# This perl program parses an RTP dump file and looks for the codec</span><br><span style="color: hsl(120, 100%, 40%);">+# names provided on the command line in the RTM DUMP file, if none </span><br><span style="color: hsl(120, 100%, 40%);">+# of the pref_codecs are found in RTP dump file, it exits with a status</span><br><span style="color: hsl(120, 100%, 40%);">+# code of 99 otherwise it will exit with a status code of 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# This perl program expects minium of two arguments on command line,</span><br><span style="color: hsl(120, 100%, 40%);">+# First argument is the name of RTP dump, second argument and so on</span><br><span style="color: hsl(120, 100%, 40%);">+# are the codec names to be searched in RTP dump file</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Check the number of command lines arguments</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+my $num_args = @ARGV;</span><br><span style="color: hsl(120, 100%, 40%);">+if ($num_args < 2)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ print "[VERIFY CODECS]Insufficient arguments\n";</span><br><span style="color: hsl(120, 100%, 40%);">+ exit(99);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ my $FILE_PTR;</span><br><span style="color: hsl(120, 100%, 40%);">+ my $bad_codec = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ my $lock_codec = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ my @pref_codecs = @ARGV[1..$num_args];</span><br><span style="color: hsl(120, 100%, 40%);">+ my $dump_file = $ARGV[0];</span><br><span style="color: hsl(120, 100%, 40%);">+ if (open(FILE_PTR,$dump_file))</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ my $count=0;</span><br><span style="color: hsl(120, 100%, 40%);">+ my $line;</span><br><span style="color: hsl(120, 100%, 40%);">+ my @lines;</span><br><span style="color: hsl(120, 100%, 40%);">+ my $dump_length=0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Read the dump file into arrat @lines </span><br><span style="color: hsl(120, 100%, 40%);">+ @lines = <FILE_PTR>;</span><br><span style="color: hsl(120, 100%, 40%);">+ close FILE_PTR;</span><br><span style="color: hsl(120, 100%, 40%);">+ $dump_length = @lines;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Process the dump file </span><br><span style="color: hsl(120, 100%, 40%);">+ for ($count=0;$count<$dump_length;$count++)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ $line = @lines[$count];</span><br><span style="color: hsl(120, 100%, 40%);">+ #Check for the payload type</span><br><span style="color: hsl(120, 100%, 40%);">+ if ($line =~ /.*pt=([0-9]+).*/) </span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ my $match=0;</span><br><span style="color: hsl(120, 100%, 40%);">+ #Check the payload type matched any of the expected</span><br><span style="color: hsl(120, 100%, 40%);">+ #payload types</span><br><span style="color: hsl(120, 100%, 40%);">+ if($lock_codec == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ #system settled down on desired codec</span><br><span style="color: hsl(120, 100%, 40%);">+ #make sure it keeps on that codec</span><br><span style="color: hsl(120, 100%, 40%);">+ if ($pref_codecs[0] eq $1)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ $lock_codec=1;</span><br><span style="color: hsl(120, 100%, 40%);">+ $match=1;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ foreach my $pref_codec (@pref_codecs)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ if ($pref_codec eq $1)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ $match=1;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ elsif ($pref_codecs[0] eq $1)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ $match=1;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if ($match == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ $bad_codec = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ last;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if ($bad_codec eq 1)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ print "[VERIFY_CODECS] Unsupported codecs in dump file [$dump_file]\n";</span><br><span style="color: hsl(120, 100%, 40%);">+ exit(99);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ elsif($lock_codec == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ print "[VERIFY_CODECS] Call never switched to preferred codec [$dump_file]\n";</span><br><span style="color: hsl(120, 100%, 40%);">+ exit(99);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ exit(0);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ print "[VERIFY_CODECS] Unable to open the dump file [$dump_file]\n";</span><br><span style="color: hsl(120, 100%, 40%);">+ exit(99);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/contrib/scripts/verify_rtp_len.pl b/contrib/scripts/verify_rtp_len.pl</span><br><span>new file mode 100755</span><br><span>index 0000000..50a45f3</span><br><span>--- /dev/null</span><br><span>+++ b/contrib/scripts/verify_rtp_len.pl</span><br><span>@@ -0,0 +1,49 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/usr/bin/perl</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+use strict;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# This perl program parses an RTP dump file and looks for and verifies the RTP frame length len=xxx</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Check the number of command lines arguments</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+my $num_args = @ARGV;</span><br><span style="color: hsl(120, 100%, 40%);">+if ($num_args ne 2)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ print "[VERIFY RTP LEN] needs 2 arguments\n";</span><br><span style="color: hsl(120, 100%, 40%);">+ exit(99);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ my $ret=99;</span><br><span style="color: hsl(120, 100%, 40%);">+ my $dump_file = $ARGV[0];</span><br><span style="color: hsl(120, 100%, 40%);">+ my $len = $ARGV[1];</span><br><span style="color: hsl(120, 100%, 40%);">+ if (open(FILE_PTR,$dump_file)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ my $count = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ my $line;</span><br><span style="color: hsl(120, 100%, 40%);">+ my @lines;</span><br><span style="color: hsl(120, 100%, 40%);">+ my $dump_length = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Read the dump file into array @lines</span><br><span style="color: hsl(120, 100%, 40%);">+ @lines = <FILE_PTR>;</span><br><span style="color: hsl(120, 100%, 40%);">+ close FILE_PTR;</span><br><span style="color: hsl(120, 100%, 40%);">+ $dump_length = @lines;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Process the dump file</span><br><span style="color: hsl(120, 100%, 40%);">+ for ($count = 0; $count < $dump_length; $count++) {</span><br><span style="color: hsl(120, 100%, 40%);">+ $line = @lines[$count];</span><br><span style="color: hsl(120, 100%, 40%);">+ #Check for the payload type</span><br><span style="color: hsl(120, 100%, 40%);">+ if ($line =~ /.*len=([0-9]+).*/) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if($1 ne $len) {</span><br><span style="color: hsl(120, 100%, 40%);">+ $ret = 99;</span><br><span style="color: hsl(120, 100%, 40%);">+ last;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ $ret=0;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ print("Failed to open dump file = $dump_file\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ exit(99);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ exit($ret);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/non-transcode/configs/ast1/extensions.conf b/tests/channels/pjsip/rtp_ptime/non-transcode/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..ad7b155</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/non-transcode/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,11 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+static=yes</span><br><span style="color: hsl(120, 100%, 40%);">+writeprotect=yes</span><br><span style="color: hsl(120, 100%, 40%);">+autofallthrough=yes</span><br><span style="color: hsl(120, 100%, 40%);">+clearglobalvars=no</span><br><span style="color: hsl(120, 100%, 40%);">+priorityjumping=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[globals]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => _X.,1,Dial(pjsip/sbc,180)</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/non-transcode/configs/ast1/pjsip.conf b/tests/channels/pjsip/rtp_ptime/non-transcode/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..45d0b43</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/non-transcode/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,52 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[global]</span><br><span style="color: hsl(120, 100%, 40%);">+type = global</span><br><span style="color: hsl(120, 100%, 40%);">+debug = yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[transport-udp6]</span><br><span style="color: hsl(120, 100%, 40%);">+type = transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol = udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind = [::]:5060</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type = transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol = udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind = 0.0.0.0:5060</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[PEER_A]</span><br><span style="color: hsl(120, 100%, 40%);">+type = aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact = sip:127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[PEER_A]</span><br><span style="color: hsl(120, 100%, 40%);">+type = identify</span><br><span style="color: hsl(120, 100%, 40%);">+endpoint = PEER_A</span><br><span style="color: hsl(120, 100%, 40%);">+match = 127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[PEER_A]</span><br><span style="color: hsl(120, 100%, 40%);">+type = endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+disallow = all</span><br><span style="color: hsl(120, 100%, 40%);">+allow = alaw</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media = no</span><br><span style="color: hsl(120, 100%, 40%);">+send_rpid = yes</span><br><span style="color: hsl(120, 100%, 40%);">+sdp_session = session</span><br><span style="color: hsl(120, 100%, 40%);">+aors = PEER_A</span><br><span style="color: hsl(120, 100%, 40%);">+use_ptime=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[sbc]</span><br><span style="color: hsl(120, 100%, 40%);">+type = aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact = sip:127.0.0.1:5700</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[sbc]</span><br><span style="color: hsl(120, 100%, 40%);">+type = endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+disallow = all</span><br><span style="color: hsl(120, 100%, 40%);">+allow = alaw</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media = no</span><br><span style="color: hsl(120, 100%, 40%);">+send_rpid = yes</span><br><span style="color: hsl(120, 100%, 40%);">+sdp_session = session</span><br><span style="color: hsl(120, 100%, 40%);">+aors = sbc</span><br><span style="color: hsl(120, 100%, 40%);">+use_ptime=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/non-transcode/run-test b/tests/channels/pjsip/rtp_ptime/non-transcode/run-test</span><br><span>new file mode 100755</span><br><span>index 0000000..9eb97d1</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/non-transcode/run-test</span><br><span>@@ -0,0 +1,81 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/usr/bin/env python</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+import sys</span><br><span style="color: hsl(120, 100%, 40%);">+import os</span><br><span style="color: hsl(120, 100%, 40%);">+import logging</span><br><span style="color: hsl(120, 100%, 40%);">+import signal</span><br><span style="color: hsl(120, 100%, 40%);">+import subprocess</span><br><span style="color: hsl(120, 100%, 40%);">+import time</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+sys.path.append("lib/python")</span><br><span style="color: hsl(120, 100%, 40%);">+sys.path.append("utils")</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+from twisted.internet import reactor</span><br><span style="color: hsl(120, 100%, 40%);">+from asterisk.sipp import SIPpTest</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+WORKING_DIR = os.path.abspath(os.path.dirname(__file__))</span><br><span style="color: hsl(120, 100%, 40%);">+TEST_DIR = os.path.dirname(os.path.realpath(__file__))</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+logger = logging.getLogger(__name__)</span><br><span style="color: hsl(120, 100%, 40%);">+e164 = "3200000000"</span><br><span style="color: hsl(120, 100%, 40%);">+sippA_logfile = WORKING_DIR + "/A_PARTY.log"</span><br><span style="color: hsl(120, 100%, 40%);">+sippA_errfile = WORKING_DIR + "/A_PARTY_ERR.log"</span><br><span style="color: hsl(120, 100%, 40%);">+sippB_logfile = WORKING_DIR + "/B_PARTY.log"</span><br><span style="color: hsl(120, 100%, 40%);">+sippB_errfile = WORKING_DIR + "/B_PARTY_ERR.log"</span><br><span style="color: hsl(120, 100%, 40%);">+dump_B = WORKING_DIR + "/codec_B.log"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+SIPP_SCENARIOS = [</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ 'scenario' : 'uas_asterisk.xml',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-i' : '127.0.0.1',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-p' : '5700',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-mp' : '6300',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-message_file' : sippB_logfile,</span><br><span style="color: hsl(120, 100%, 40%);">+ '-error_file' : sippB_errfile,</span><br><span style="color: hsl(120, 100%, 40%);">+ '-trace_msg' : '-trace_err',</span><br><span style="color: hsl(120, 100%, 40%);">+ },</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ 'scenario' : 'uac_asterisk.xml',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-i' : '127.0.0.1',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-p' : '5061',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-s' : e164,</span><br><span style="color: hsl(120, 100%, 40%);">+ '-d' : '5000',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-message_file' : sippA_logfile,</span><br><span style="color: hsl(120, 100%, 40%);">+ '-error_file' : sippA_errfile,</span><br><span style="color: hsl(120, 100%, 40%);">+ '-trace_msg' : '-trace_err',</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+def cleanup():</span><br><span style="color: hsl(120, 100%, 40%);">+ filelist = [ f for f in os.listdir(WORKING_DIR) if f.endswith(".log") ]</span><br><span style="color: hsl(120, 100%, 40%);">+ for f in filelist:</span><br><span style="color: hsl(120, 100%, 40%);">+ os.remove(os.path.join(WORKING_DIR, f))</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+def main():</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS,test_config={'memcheck-delay-stop': 7})</span><br><span style="color: hsl(120, 100%, 40%);">+ test.reactor_timeout = 55;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Run the RTPDUMP tool to capture the logs on B side</span><br><span style="color: hsl(120, 100%, 40%);">+ rtpdump = subprocess.Popen(["rtpdump", "-t","5", "-F","ascii","-o",dump_B, "127.0.0.1/8000"])</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ reactor.run()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Kill the RTPDUMP, pass it the signal"</span><br><span style="color: hsl(120, 100%, 40%);">+ rtpdump.send_signal(signal.SIGINT)</span><br><span style="color: hsl(120, 100%, 40%);">+ rtpdump.wait()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ret_B = subprocess.call(["perl","contrib/scripts/verify_codecs.pl",dump_B ,"8"])</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ret_B != 99):</span><br><span style="color: hsl(120, 100%, 40%);">+ ret_B = subprocess.call(["perl","contrib/scripts/verify_rtp_len.pl",dump_B ,"172"])</span><br><span style="color: hsl(120, 100%, 40%);">+ cleanup()</span><br><span style="color: hsl(120, 100%, 40%);">+ if(ret_B != 99):</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0</span><br><span style="color: hsl(120, 100%, 40%);">+ else:</span><br><span style="color: hsl(120, 100%, 40%);">+ return 1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if __name__ == "__main__":</span><br><span style="color: hsl(120, 100%, 40%);">+ sys.exit(main())</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# vim:sw=4:ts=4:expandtab:textwidth=79</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/non-transcode/sipp/40msalaw.pcap b/tests/channels/pjsip/rtp_ptime/non-transcode/sipp/40msalaw.pcap</span><br><span>new file mode 100644</span><br><span>index 0000000..67356c5</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/non-transcode/sipp/40msalaw.pcap</span><br><span>Binary files differ</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/non-transcode/sipp/uac_asterisk.xml b/tests/channels/pjsip/rtp_ptime/non-transcode/sipp/uac_asterisk.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..f094815</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/non-transcode/sipp/uac_asterisk.xml</span><br><span>@@ -0,0 +1,125 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1"?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "testerlaptop.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- This program is free software; you can redistribute it and/or --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- modify it under the terms of the GNU General Public License as --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- published by the Free Software Foundation; either version 2 of the --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- License, or (at your option) any later version. --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- This program is distributed in the hope that it will be useful, --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- GNU General Public License for more details. --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- You should have received a copy of the GNU General Public License --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- along with this program; if not, write to the --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- Free Software Foundation, Inc., --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- Sipp default 'uac' scenario. --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- --></span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Basic Sipstone UAC"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- In client mode (testerlaptop placing calls), the Call-ID MUST be --></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- generated by testerlaptop. To do so, use [call_id] keyword. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:[service]@[remote_ip] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:testerlaptop@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: testerphone <sip:[service]@[remote_ip]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:testerlaptop@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Performance Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=testerlaptop 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP4 127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 9000 RTP/AVP 8</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:8 PCMA/8000 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=ptime:40</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- By adding rrs="true" (Record Route Sets), the route sets --></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- are saved and used for following messages sent. Useful to test --></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- against stateful SIP proxies/B2BUAs. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true" rrs="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Packet lost can be simulated in any send/recv message by --></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK [next_url] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: testerlaptop <sip:testerlaptop@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: testerphone <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:testerlaptop@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Performance Test</span><br><span style="color: hsl(120, 100%, 40%);">+ [routes]</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <nop></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <exec play_pcap_audio="./tests/channels/pjsip/rtp_ptime/non-transcode/sipp/40msalaw.pcap"/></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </nop></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- This delay can be customized by the -d command-line option --></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- or by adding a 'milliseconds = "value"' option here. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <pause milliseconds="5000" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- The 'crlf' option inserts a blank line in the statistics report. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE [next_url] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: testerlaptop <sip:testerlaptop@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: testerphone <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 2 BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:testerlaptop@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Performance Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ [routes]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- definition of the response time repartition table (unit is ms) --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- definition of the call length repartition table (unit is ms) --></span><br><span style="color: hsl(120, 100%, 40%);">+ <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/non-transcode/sipp/uas_asterisk.xml b/tests/channels/pjsip/rtp_ptime/non-transcode/sipp/uas_asterisk.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..8f6b0ae</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/non-transcode/sipp/uas_asterisk.xml</span><br><span>@@ -0,0 +1,90 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="rtp ptime problem"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<recv request="INVITE" crlf="true" rrs="true"></span><br><span style="color: hsl(120, 100%, 40%);">+</recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<send></span><br><span style="color: hsl(120, 100%, 40%);">+<![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+SIP/2.0 100 Trying</span><br><span style="color: hsl(120, 100%, 40%);">+[last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+]]></span><br><span style="color: hsl(120, 100%, 40%);">+</send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+<![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+[last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_Record-Route]</span><br><span style="color: hsl(120, 100%, 40%);">+Contact: <sip:testerlaptop@[local_ip]:[local_port];user=phone></span><br><span style="color: hsl(120, 100%, 40%);">+Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+v=0</span><br><span style="color: hsl(120, 100%, 40%);">+o=HuaweiSoftX3000 6644052 6644052 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+s=Sip Call</span><br><span style="color: hsl(120, 100%, 40%);">+c=IN IP4 127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+m=audio 8000 RTP/AVP 8 103</span><br><span style="color: hsl(120, 100%, 40%);">+a=rtpmap:8 PCMA/8000</span><br><span style="color: hsl(120, 100%, 40%);">+a=rtpmap:103 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+a=ptime:20</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+]]></span><br><span style="color: hsl(120, 100%, 40%);">+</send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<recv request="ACK"</span><br><span style="color: hsl(120, 100%, 40%);">+ rtd="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+</recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="BYE"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<!-- Keep the call open for a while in case the 200 is lost to be --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- able to retransmit it if we receive the BYE again. --></span><br><span style="color: hsl(120, 100%, 40%);">+<pause milliseconds="4000"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<!-- definition of the response time repartition table (unit is ms) --></span><br><span style="color: hsl(120, 100%, 40%);">+<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<!-- definition of the call length repartition table (unit is ms) --></span><br><span style="color: hsl(120, 100%, 40%);">+<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/non-transcode/test-config.yaml b/tests/channels/pjsip/rtp_ptime/non-transcode/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..c515b53</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/non-transcode/test-config.yaml</span><br><span>@@ -0,0 +1,13 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test that asterisk can convert 40ms audio in 20ms'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'When receiving 40ms audio verify that asterisk can convert it to 20m if customer requested'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'rtpdump'</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'perl'</span><br><span style="color: hsl(120, 100%, 40%);">+ - custom : 'rawsocket'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/tests.yaml b/tests/channels/pjsip/rtp_ptime/tests.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..1186e84</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/tests.yaml</span><br><span>@@ -0,0 +1,4 @@</span><br><span style="color: hsl(120, 100%, 40%);">+# Enter tests here in the order they should be considered for execution:</span><br><span style="color: hsl(120, 100%, 40%);">+tests:</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'transcode'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'non-transcode'</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/transcode/configs/ast1/extensions.conf b/tests/channels/pjsip/rtp_ptime/transcode/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..ad7b155</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/transcode/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,11 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+static=yes</span><br><span style="color: hsl(120, 100%, 40%);">+writeprotect=yes</span><br><span style="color: hsl(120, 100%, 40%);">+autofallthrough=yes</span><br><span style="color: hsl(120, 100%, 40%);">+clearglobalvars=no</span><br><span style="color: hsl(120, 100%, 40%);">+priorityjumping=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[globals]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => _X.,1,Dial(pjsip/sbc,180)</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/transcode/configs/ast1/pjsip.conf b/tests/channels/pjsip/rtp_ptime/transcode/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..23d08bf</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/transcode/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,53 @@</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[global]</span><br><span style="color: hsl(120, 100%, 40%);">+type = global</span><br><span style="color: hsl(120, 100%, 40%);">+debug = yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[transport-udp6]</span><br><span style="color: hsl(120, 100%, 40%);">+type = transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol = udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind = [::]:5060</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type = transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol = udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind = 0.0.0.0:5060</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[PEER_A]</span><br><span style="color: hsl(120, 100%, 40%);">+type = aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact = sip:127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[PEER_A]</span><br><span style="color: hsl(120, 100%, 40%);">+type = identify</span><br><span style="color: hsl(120, 100%, 40%);">+endpoint = PEER_A</span><br><span style="color: hsl(120, 100%, 40%);">+match = 127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[PEER_A]</span><br><span style="color: hsl(120, 100%, 40%);">+type = endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+disallow = all</span><br><span style="color: hsl(120, 100%, 40%);">+allow = alaw</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media = no</span><br><span style="color: hsl(120, 100%, 40%);">+send_rpid = yes</span><br><span style="color: hsl(120, 100%, 40%);">+sdp_session = session</span><br><span style="color: hsl(120, 100%, 40%);">+aors = PEER_A</span><br><span style="color: hsl(120, 100%, 40%);">+use_ptime=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[sbc]</span><br><span style="color: hsl(120, 100%, 40%);">+type = aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact = sip:127.0.0.1:5700</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[sbc]</span><br><span style="color: hsl(120, 100%, 40%);">+type = endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+disallow = all</span><br><span style="color: hsl(120, 100%, 40%);">+allow = ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media = no</span><br><span style="color: hsl(120, 100%, 40%);">+send_rpid = yes</span><br><span style="color: hsl(120, 100%, 40%);">+sdp_session = session</span><br><span style="color: hsl(120, 100%, 40%);">+aors = sbc</span><br><span style="color: hsl(120, 100%, 40%);">+use_ptime=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/transcode/run-test b/tests/channels/pjsip/rtp_ptime/transcode/run-test</span><br><span>new file mode 100755</span><br><span>index 0000000..e17cb8d</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/transcode/run-test</span><br><span>@@ -0,0 +1,80 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/usr/bin/env python</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+import sys</span><br><span style="color: hsl(120, 100%, 40%);">+import os</span><br><span style="color: hsl(120, 100%, 40%);">+import logging</span><br><span style="color: hsl(120, 100%, 40%);">+import signal</span><br><span style="color: hsl(120, 100%, 40%);">+import subprocess</span><br><span style="color: hsl(120, 100%, 40%);">+import time</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+sys.path.append("lib/python")</span><br><span style="color: hsl(120, 100%, 40%);">+sys.path.append("utils")</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+from twisted.internet import reactor</span><br><span style="color: hsl(120, 100%, 40%);">+from asterisk.sipp import SIPpTest</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+WORKING_DIR = os.path.abspath(os.path.dirname(__file__))</span><br><span style="color: hsl(120, 100%, 40%);">+TEST_DIR = os.path.dirname(os.path.realpath(__file__))</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+logger = logging.getLogger(__name__)</span><br><span style="color: hsl(120, 100%, 40%);">+e164 = "3200000000"</span><br><span style="color: hsl(120, 100%, 40%);">+sippA_logfile = WORKING_DIR + "/A_PARTY.log"</span><br><span style="color: hsl(120, 100%, 40%);">+sippA_errfile = WORKING_DIR + "/A_PARTY_ERR.log"</span><br><span style="color: hsl(120, 100%, 40%);">+sippB_logfile = WORKING_DIR + "/B_PARTY.log"</span><br><span style="color: hsl(120, 100%, 40%);">+sippB_errfile = WORKING_DIR + "/B_PARTY_ERR.log"</span><br><span style="color: hsl(120, 100%, 40%);">+dump_B = WORKING_DIR + "/codec_B.log"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+SIPP_SCENARIOS = [</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ 'scenario' : 'uas_asterisk.xml',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-i' : '127.0.0.1',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-p' : '5700',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-mp' : '6300',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-message_file' : sippB_logfile,</span><br><span style="color: hsl(120, 100%, 40%);">+ '-error_file' : sippB_errfile,</span><br><span style="color: hsl(120, 100%, 40%);">+ '-trace_msg' : '-trace_err',</span><br><span style="color: hsl(120, 100%, 40%);">+ },</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ 'scenario' : 'uac_asterisk.xml',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-i' : '127.0.0.1',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-p' : '5061',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-s' : e164,</span><br><span style="color: hsl(120, 100%, 40%);">+ '-d' : '5000',</span><br><span style="color: hsl(120, 100%, 40%);">+ '-message_file' : sippA_logfile,</span><br><span style="color: hsl(120, 100%, 40%);">+ '-error_file' : sippA_errfile,</span><br><span style="color: hsl(120, 100%, 40%);">+ '-trace_msg' : '-trace_err',</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+def cleanup():</span><br><span style="color: hsl(120, 100%, 40%);">+ filelist = [ f for f in os.listdir(WORKING_DIR) if f.endswith(".log") ]</span><br><span style="color: hsl(120, 100%, 40%);">+ for f in filelist:</span><br><span style="color: hsl(120, 100%, 40%);">+ os.remove(os.path.join(WORKING_DIR, f))</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+def main():</span><br><span style="color: hsl(120, 100%, 40%);">+ test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS,test_config={'memcheck-delay-stop':7})</span><br><span style="color: hsl(120, 100%, 40%);">+ test.reactor_timeout = 55;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Run the RTPDUMP tool to capture the logs on B side</span><br><span style="color: hsl(120, 100%, 40%);">+ rtpdump = subprocess.Popen(["rtpdump", "-t","5", "-F","ascii","-o",dump_B, "127.0.0.1/8000"])</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ reactor.run()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Kill the RTPDUMP, pass it the signal"</span><br><span style="color: hsl(120, 100%, 40%);">+ rtpdump.send_signal(signal.SIGINT)</span><br><span style="color: hsl(120, 100%, 40%);">+ rtpdump.wait()</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ ret_B = subprocess.call(["perl","contrib/scripts/verify_codecs.pl",dump_B ,"0"])</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ret_B != 99):</span><br><span style="color: hsl(120, 100%, 40%);">+ ret_B = subprocess.call(["perl","contrib/scripts/verify_rtp_len.pl",dump_B ,"172"])</span><br><span style="color: hsl(120, 100%, 40%);">+ cleanup()</span><br><span style="color: hsl(120, 100%, 40%);">+ if(ret_B != 99):</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0</span><br><span style="color: hsl(120, 100%, 40%);">+ else:</span><br><span style="color: hsl(120, 100%, 40%);">+ return 1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if __name__ == "__main__":</span><br><span style="color: hsl(120, 100%, 40%);">+ sys.exit(main())</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# vim:sw=4:ts=4:expandtab:textwidth=79</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/transcode/sipp/40msalaw.pcap b/tests/channels/pjsip/rtp_ptime/transcode/sipp/40msalaw.pcap</span><br><span>new file mode 100644</span><br><span>index 0000000..67356c5</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/transcode/sipp/40msalaw.pcap</span><br><span>Binary files differ</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/transcode/sipp/uac_asterisk.xml b/tests/channels/pjsip/rtp_ptime/transcode/sipp/uac_asterisk.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..46aa8dc</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/transcode/sipp/uac_asterisk.xml</span><br><span>@@ -0,0 +1,125 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1"?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "testerlaptop.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- This program is free software; you can redistribute it and/or --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- modify it under the terms of the GNU General Public License as --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- published by the Free Software Foundation; either version 2 of the --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- License, or (at your option) any later version. --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- This program is distributed in the hope that it will be useful, --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- GNU General Public License for more details. --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- You should have received a copy of the GNU General Public License --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- along with this program; if not, write to the --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- Free Software Foundation, Inc., --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- Sipp default 'uac' scenario. --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- --></span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Basic Sipstone UAC"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- In client mode (testerlaptop placing calls), the Call-ID MUST be --></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- generated by testerlaptop. To do so, use [call_id] keyword. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:[service]@[remote_ip] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:testerlaptop@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: testerphone <sip:[service]@[remote_ip]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:testerlaptop@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Performance Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=testerlaptop 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP4 127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 9000 RTP/AVP 8</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:8 PCMA/8000 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=ptime:40</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- By adding rrs="true" (Record Route Sets), the route sets --></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- are saved and used for following messages sent. Useful to test --></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- against stateful SIP proxies/B2BUAs. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true" rrs="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Packet lost can be simulated in any send/recv message by --></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK [next_url] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: testerlaptop <sip:testerlaptop@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: testerphone <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:testerlaptop@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Performance Test</span><br><span style="color: hsl(120, 100%, 40%);">+ [routes]</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <nop></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <exec play_pcap_audio="./tests/channels/pjsip/rtp_ptime/transcode/sipp/40msalaw.pcap"/></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </nop></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- This delay can be customized by the -d command-line option --></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- or by adding a 'milliseconds = "value"' option here. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <pause milliseconds="5000" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- The 'crlf' option inserts a blank line in the statistics report. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE [next_url] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: testerlaptop <sip:testerlaptop@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: testerphone <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 2 BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:testerlaptop@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Performance Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ [routes]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- definition of the response time repartition table (unit is ms) --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- definition of the call length repartition table (unit is ms) --></span><br><span style="color: hsl(120, 100%, 40%);">+ <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/transcode/sipp/uas_asterisk.xml b/tests/channels/pjsip/rtp_ptime/transcode/sipp/uas_asterisk.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..283f398</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/transcode/sipp/uas_asterisk.xml</span><br><span>@@ -0,0 +1,90 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="rtp ptime problem"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<recv request="INVITE" crlf="true" rrs="true"></span><br><span style="color: hsl(120, 100%, 40%);">+</recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<send></span><br><span style="color: hsl(120, 100%, 40%);">+<![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+SIP/2.0 100 Trying</span><br><span style="color: hsl(120, 100%, 40%);">+[last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+]]></span><br><span style="color: hsl(120, 100%, 40%);">+</send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+<![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+[last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+[last_Record-Route]</span><br><span style="color: hsl(120, 100%, 40%);">+Contact: <sip:testerlaptop@[local_ip]:[local_port];user=phone></span><br><span style="color: hsl(120, 100%, 40%);">+Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+v=0</span><br><span style="color: hsl(120, 100%, 40%);">+o=HuaweiSoftX3000 6644052 6644052 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+s=Sip Call</span><br><span style="color: hsl(120, 100%, 40%);">+c=IN IP4 127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+m=audio 8000 RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+a=rtpmap:103 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+a=ptime:20</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+]]></span><br><span style="color: hsl(120, 100%, 40%);">+</send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<recv request="ACK"</span><br><span style="color: hsl(120, 100%, 40%);">+ rtd="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+</recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="BYE"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<!-- Keep the call open for a while in case the 200 is lost to be --></span><br><span style="color: hsl(120, 100%, 40%);">+<!-- able to retransmit it if we receive the BYE again. --></span><br><span style="color: hsl(120, 100%, 40%);">+<pause milliseconds="4000"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<!-- definition of the response time repartition table (unit is ms) --></span><br><span style="color: hsl(120, 100%, 40%);">+<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<!-- definition of the call length repartition table (unit is ms) --></span><br><span style="color: hsl(120, 100%, 40%);">+<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/rtp_ptime/transcode/test-config.yaml b/tests/channels/pjsip/rtp_ptime/transcode/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..e53d3e4</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/rtp_ptime/transcode/test-config.yaml</span><br><span>@@ -0,0 +1,14 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test that asterisk can convert 40ms audio in 20ms'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'When receiving 40ms audio verify that asterisk can convert it to 20m if customer requested'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ minversion: '1.4'</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'rtpdump'</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'perl'</span><br><span style="color: hsl(120, 100%, 40%);">+ - custom : 'rawsocket'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - SIP</span><br><span>diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml</span><br><span>index 04d104e..c16ad81 100644</span><br><span>--- a/tests/channels/pjsip/tests.yaml</span><br><span>+++ b/tests/channels/pjsip/tests.yaml</span><br><span>@@ -27,6 +27,7 @@</span><br><span> - dir: 'ice'</span><br><span> - dir: 'use_callerid_contact'</span><br><span> - dir: 'connected_line'</span><br><span style="color: hsl(120, 100%, 40%);">+ - dir: 'rtp_ptime'</span><br><span> - test: 'accountcode'</span><br><span> - test: 'acl_call'</span><br><span> - test: 'allow_overlap'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10627">change 10627</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10627"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I16cfb5805d2b96fdf5cdbc8f53a86522d1d251a7 </div>
<div style="display:none"> Gerrit-Change-Number: 10627 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Robert Cripps <rcripps@voxbone.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua C. Colp <jcolp@digium.com> </div>