<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10304">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">strict_rtp: Added test for strictrtp option 'seqno'.<br><br>This test verifies the functionality of the new option 'seqno' for<br>strictrtp. A channel is started up in the Echo application, which then<br>triggers a burst of packets from the test. The packets will continue to<br>be bursted to the target until strict RTP learns the source, which then<br>fires off another event that will send a packet from a different source.<br>The test passes if the packet from the source we did not learn is<br>dropped. The difference between this test and the existing test is that<br>it checks to see if the time interval during learning for receiving<br>packets is ignored, hence the bursts and not a normal call scenario.<br><br>Also added a new directory to account for multiple strictrtp tests.<br><br>Change-Id: I0067bb11793f97423752aef04c8716841a7ad0d9<br>---<br>A tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/extensions.conf<br>A tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/pjsip.conf<br>A tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/rtp.conf<br>A tests/rtp/strict_rtp/strict_rtp_seqno/sipp/call_setup.xml<br>A tests/rtp/strict_rtp/strict_rtp_seqno/strict_rtp.py<br>A tests/rtp/strict_rtp/strict_rtp_seqno/test-config.yaml<br>R tests/rtp/strict_rtp/strict_rtp_yes/configs/ast1/extensions.conf<br>R tests/rtp/strict_rtp/strict_rtp_yes/configs/ast1/pjsip.conf<br>R tests/rtp/strict_rtp/strict_rtp_yes/configs/ast1/rtp.conf<br>R tests/rtp/strict_rtp/strict_rtp_yes/configs/ast2/extensions.conf<br>R tests/rtp/strict_rtp/strict_rtp_yes/configs/ast2/pjsip.conf<br>R tests/rtp/strict_rtp/strict_rtp_yes/configs/ast2/rtp.conf<br>R tests/rtp/strict_rtp/strict_rtp_yes/strict_rtp.py<br>R tests/rtp/strict_rtp/strict_rtp_yes/test-config.yaml<br>A tests/rtp/strict_rtp/tests.yaml<br>M tests/rtp/tests.yaml<br>16 files changed, 272 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/extensions.conf b/tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..6199b22</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,6 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Echo()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span>diff --git a/tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/pjsip.conf b/tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..bef6c2f</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,19 @@</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%);">+[local]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+transport=local</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:alice@127.0.0.1:5061</span><br><span>diff --git a/tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/rtp.conf b/tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/rtp.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4d49874</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rtp/strict_rtp/strict_rtp_seqno/configs/ast1/rtp.conf</span><br><span>@@ -0,0 +1,4 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+rtpstart=10000</span><br><span style="color: hsl(120, 100%, 40%);">+rtpend=10002</span><br><span style="color: hsl(120, 100%, 40%);">+strictrtp=seqno</span><br><span>diff --git a/tests/rtp/strict_rtp/strict_rtp_seqno/sipp/call_setup.xml b/tests/rtp/strict_rtp/strict_rtp_seqno/sipp/call_setup.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..ab6ee31</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rtp/strict_rtp/strict_rtp_seqno/sipp/call_setup.xml</span><br><span>@@ -0,0 +1,81 @@</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="INVITE to echo with SDP in initial INVITE"></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:echo@[remote_ip]:[remote_port] 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: test1 <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: test <sip:test@[remote_ip]:[remote_port]></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:test@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Test</span><br><span style="color: hsl(120, 100%, 40%);">+ User-Agent: 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=phoneA 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 IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 6000 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%);">+</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"</span><br><span style="color: hsl(120, 100%, 40%);">+ 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="200" rtd="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%);">+ <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 sip:echo@[remote_ip]:[remote_port] 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: test1 <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: test <sip:test@[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:test@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Test</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%);">+ <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%);">+ <!-- 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/rtp/strict_rtp/strict_rtp_seqno/strict_rtp.py b/tests/rtp/strict_rtp/strict_rtp_seqno/strict_rtp.py</span><br><span>new file mode 100644</span><br><span>index 0000000..ea58956</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rtp/strict_rtp/strict_rtp_seqno/strict_rtp.py</span><br><span>@@ -0,0 +1,125 @@</span><br><span style="color: hsl(120, 100%, 40%);">+"""Strict RTP verification</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+This module sends a flood of RTP packets to a target after SIPP starts a</span><br><span style="color: hsl(120, 100%, 40%);">+call in order to have Asterisk lock on to a new target address. It will also</span><br><span style="color: hsl(120, 100%, 40%);">+send a packet after the target has been locked onto and considers the test</span><br><span style="color: hsl(120, 100%, 40%);">+a success if that packet is denied.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Copyright (C) 2018, Digium, Inc.</span><br><span style="color: hsl(120, 100%, 40%);">+Ben Ford <bford@digium.com></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+This program is free software, distributed under the terms of</span><br><span style="color: hsl(120, 100%, 40%);">+the GNU General Public License Version 2.</span><br><span style="color: hsl(120, 100%, 40%);">+"""</span><br><span style="color: hsl(120, 100%, 40%);">+import logging</span><br><span style="color: hsl(120, 100%, 40%);">+#from datetime import datetime</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+from twisted.internet.protocol import DatagramProtocol</span><br><span style="color: hsl(120, 100%, 40%);">+from twisted.internet import reactor</span><br><span style="color: hsl(120, 100%, 40%);">+from twisted.internet import task</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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+class StrictRtpTester(object):</span><br><span style="color: hsl(120, 100%, 40%);">+ """A pluggable module for verifying strictrtp seqno functionality"""</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ class PacketSendProtocol(DatagramProtocol):</span><br><span style="color: hsl(120, 100%, 40%);">+ """The twisted protocol that sends packets</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 __init__(self, test_object):</span><br><span style="color: hsl(120, 100%, 40%);">+ """Constructor</span><br><span style="color: hsl(120, 100%, 40%);">+ """</span><br><span style="color: hsl(120, 100%, 40%);">+ self.test_object = test_object</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ def datagramReceived(self, data, (host, port)):</span><br><span style="color: hsl(120, 100%, 40%);">+ """Callback for when a datagram is received.</span><br><span style="color: hsl(120, 100%, 40%);">+ We don't want anything to happen here because we do all</span><br><span style="color: hsl(120, 100%, 40%);">+ of the handling ourselves via TestEvent.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ Keyword Arguments:</span><br><span style="color: hsl(120, 100%, 40%);">+ data The actual packet</span><br><span style="color: hsl(120, 100%, 40%);">+ (host, port) Tuple of source host and port</span><br><span style="color: hsl(120, 100%, 40%);">+ """</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGGER.debug('Packet received from {0}:{1}\n{2}'.format(</span><br><span style="color: hsl(120, 100%, 40%);">+ host, port, data))</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ def __init__(self, module_config, test_object):</span><br><span style="color: hsl(120, 100%, 40%);">+ """Constructor</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ Keyword Arguments:</span><br><span style="color: hsl(120, 100%, 40%);">+ module_config The configuration for this pluggable module</span><br><span style="color: hsl(120, 100%, 40%);">+ test_object Our test object</span><br><span style="color: hsl(120, 100%, 40%);">+ """</span><br><span style="color: hsl(120, 100%, 40%);">+ self.send_num = 1</span><br><span style="color: hsl(120, 100%, 40%);">+ self.send_task = None</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # Use the AMI callback to know when we are fully booted</span><br><span style="color: hsl(120, 100%, 40%);">+ self.test_object = test_object</span><br><span style="color: hsl(120, 100%, 40%);">+ test_object.register_ami_observer(self.ami_connect_cb)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ def send_packets(self, protocol, num):</span><br><span style="color: hsl(120, 100%, 40%);">+ """Send packets to endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+ """</span><br><span style="color: hsl(120, 100%, 40%);">+ idx = 1</span><br><span style="color: hsl(120, 100%, 40%);">+ header = bytearray(12)</span><br><span style="color: hsl(120, 100%, 40%);">+ header[0] = (2 << 6) & 0xC0</span><br><span style="color: hsl(120, 100%, 40%);">+ while idx <= num:</span><br><span style="color: hsl(120, 100%, 40%);">+ header[2] = (self.send_num & 0xFF00) >> 8</span><br><span style="color: hsl(120, 100%, 40%);">+ header[3] = (self.send_num & 0xFF)</span><br><span style="color: hsl(120, 100%, 40%);">+ protocol.transport.write(header, ('127.0.0.1', 10000))</span><br><span style="color: hsl(120, 100%, 40%);">+ self.send_num = self.send_num + 1</span><br><span style="color: hsl(120, 100%, 40%);">+ idx = idx + 1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ def ami_connect_cb(self, ami):</span><br><span style="color: hsl(120, 100%, 40%);">+ """Callback called when AMI connects</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ Keyword Arguments:</span><br><span style="color: hsl(120, 100%, 40%);">+ ami The AMI manager object for our Asterisk instance</span><br><span style="color: hsl(120, 100%, 40%);">+ """</span><br><span style="color: hsl(120, 100%, 40%);">+ ami.registerEvent('TestEvent', self.test_event_handler)</span><br><span style="color: hsl(120, 100%, 40%);">+ ami.registerEvent('Newexten', self.new_exten_handler)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ def test_event_handler(self, ami, event):</span><br><span style="color: hsl(120, 100%, 40%);">+ """TestEvent handler</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ Keyword Arguments:</span><br><span style="color: hsl(120, 100%, 40%);">+ ami The AMI protocol instance</span><br><span style="color: hsl(120, 100%, 40%);">+ event The TestEvent</span><br><span style="color: hsl(120, 100%, 40%);">+ """</span><br><span style="color: hsl(120, 100%, 40%);">+ if event['state'] == 'STRICT_RTP_LEARN':</span><br><span style="color: hsl(120, 100%, 40%);">+ if event['source'] != '127.0.0.1:6000':</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGGER.debug("Failure: Strict RTP did not lock on to source 127.0.0.1:6000")</span><br><span style="color: hsl(120, 100%, 40%);">+ self.test_object.set_passed(False)</span><br><span style="color: hsl(120, 100%, 40%);">+ ami.hangup(self.channel)</span><br><span style="color: hsl(120, 100%, 40%);">+ return</span><br><span style="color: hsl(120, 100%, 40%);">+ self.send_task.stop()</span><br><span style="color: hsl(120, 100%, 40%);">+ protocol = StrictRtpTester.PacketSendProtocol(self.test_object)</span><br><span style="color: hsl(120, 100%, 40%);">+ reactor.listenUDP(6001, protocol)</span><br><span style="color: hsl(120, 100%, 40%);">+ self.send_packets(protocol, 1)</span><br><span style="color: hsl(120, 100%, 40%);">+ elif event['state'] == 'STRICT_RTP_CLOSED':</span><br><span style="color: hsl(120, 100%, 40%);">+ if event['source'] != '127.0.0.1:6001':</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGGER.debug("Failure: Strict RTP dropped packet from source other than 127.0.0.1:6001")</span><br><span style="color: hsl(120, 100%, 40%);">+ self.test_object.set_passed(False)</span><br><span style="color: hsl(120, 100%, 40%);">+ else:</span><br><span style="color: hsl(120, 100%, 40%);">+ self.test_object.set_passed(True)</span><br><span style="color: hsl(120, 100%, 40%);">+ ami.hangup(self.channel)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ def new_exten_handler(self, ami, event):</span><br><span style="color: hsl(120, 100%, 40%);">+ """NewExten handler</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ Keyword Arguments:</span><br><span style="color: hsl(120, 100%, 40%);">+ ami The AMI protocol instance</span><br><span style="color: hsl(120, 100%, 40%);">+ event The Newexten event</span><br><span style="color: hsl(120, 100%, 40%);">+ """</span><br><span style="color: hsl(120, 100%, 40%);">+ def errback(err):</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGGER.error(err)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if event['application'] != 'Echo':</span><br><span style="color: hsl(120, 100%, 40%);">+ return</span><br><span style="color: hsl(120, 100%, 40%);">+ self.channel = event['channel']</span><br><span style="color: hsl(120, 100%, 40%);">+ protocol = StrictRtpTester.PacketSendProtocol(self.test_object)</span><br><span style="color: hsl(120, 100%, 40%);">+ reactor.listenUDP(6000, protocol)</span><br><span style="color: hsl(120, 100%, 40%);">+ self.send_task = task.LoopingCall(self.send_packets, protocol, 20)</span><br><span style="color: hsl(120, 100%, 40%);">+ deferred = self.send_task.start(1.0)</span><br><span style="color: hsl(120, 100%, 40%);">+ deferred.addErrback(errback)</span><br><span>diff --git a/tests/rtp/strict_rtp/strict_rtp_seqno/test-config.yaml b/tests/rtp/strict_rtp/strict_rtp_seqno/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..8c12073</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rtp/strict_rtp/strict_rtp_seqno/test-config.yaml</span><br><span>@@ -0,0 +1,32 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Verify strictrtp set to seqno ignores strictrtp time interval'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This test verifies that when strictrtp is set to seqno, Asterisk is</span><br><span style="color: hsl(120, 100%, 40%);">+ able to lock on to the target address, even if there is a burst of</span><br><span style="color: hsl(120, 100%, 40%);">+ packets during the learning period. It also ensures that packets from</span><br><span style="color: hsl(120, 100%, 40%);">+ other sources are dropped after we lock on to our target address.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ add-test-to-search-path: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: 'test-object-config'</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: 'dummy-config'</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'strict_rtp.StrictRtpTester'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': {'scenario': 'call_setup.xml', '-i': '127.0.0.1', '-p': '5061', '-s': 'alice'} }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+dummy-config:</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%);">+ - asterisk : 'app_echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span>diff --git a/tests/rtp/strict_rtp/configs/ast1/extensions.conf b/tests/rtp/strict_rtp/strict_rtp_yes/configs/ast1/extensions.conf</span><br><span>similarity index 100%</span><br><span>rename from tests/rtp/strict_rtp/configs/ast1/extensions.conf</span><br><span>rename to tests/rtp/strict_rtp/strict_rtp_yes/configs/ast1/extensions.conf</span><br><span>diff --git a/tests/rtp/strict_rtp/configs/ast1/pjsip.conf b/tests/rtp/strict_rtp/strict_rtp_yes/configs/ast1/pjsip.conf</span><br><span>similarity index 100%</span><br><span>rename from tests/rtp/strict_rtp/configs/ast1/pjsip.conf</span><br><span>rename to tests/rtp/strict_rtp/strict_rtp_yes/configs/ast1/pjsip.conf</span><br><span>diff --git a/tests/rtp/strict_rtp/configs/ast1/rtp.conf b/tests/rtp/strict_rtp/strict_rtp_yes/configs/ast1/rtp.conf</span><br><span>similarity index 100%</span><br><span>rename from tests/rtp/strict_rtp/configs/ast1/rtp.conf</span><br><span>rename to tests/rtp/strict_rtp/strict_rtp_yes/configs/ast1/rtp.conf</span><br><span>diff --git a/tests/rtp/strict_rtp/configs/ast2/extensions.conf b/tests/rtp/strict_rtp/strict_rtp_yes/configs/ast2/extensions.conf</span><br><span>similarity index 100%</span><br><span>rename from tests/rtp/strict_rtp/configs/ast2/extensions.conf</span><br><span>rename to tests/rtp/strict_rtp/strict_rtp_yes/configs/ast2/extensions.conf</span><br><span>diff --git a/tests/rtp/strict_rtp/configs/ast2/pjsip.conf b/tests/rtp/strict_rtp/strict_rtp_yes/configs/ast2/pjsip.conf</span><br><span>similarity index 100%</span><br><span>rename from tests/rtp/strict_rtp/configs/ast2/pjsip.conf</span><br><span>rename to tests/rtp/strict_rtp/strict_rtp_yes/configs/ast2/pjsip.conf</span><br><span>diff --git a/tests/rtp/strict_rtp/configs/ast2/rtp.conf b/tests/rtp/strict_rtp/strict_rtp_yes/configs/ast2/rtp.conf</span><br><span>similarity index 100%</span><br><span>rename from tests/rtp/strict_rtp/configs/ast2/rtp.conf</span><br><span>rename to tests/rtp/strict_rtp/strict_rtp_yes/configs/ast2/rtp.conf</span><br><span>diff --git a/tests/rtp/strict_rtp/strict_rtp.py b/tests/rtp/strict_rtp/strict_rtp_yes/strict_rtp.py</span><br><span>similarity index 100%</span><br><span>rename from tests/rtp/strict_rtp/strict_rtp.py</span><br><span>rename to tests/rtp/strict_rtp/strict_rtp_yes/strict_rtp.py</span><br><span>diff --git a/tests/rtp/strict_rtp/test-config.yaml b/tests/rtp/strict_rtp/strict_rtp_yes/test-config.yaml</span><br><span>similarity index 100%</span><br><span>rename from tests/rtp/strict_rtp/test-config.yaml</span><br><span>rename to tests/rtp/strict_rtp/strict_rtp_yes/test-config.yaml</span><br><span>diff --git a/tests/rtp/strict_rtp/tests.yaml b/tests/rtp/strict_rtp/tests.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..9becafb</span><br><span>--- /dev/null</span><br><span>+++ b/tests/rtp/strict_rtp/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: 'strict_rtp_seqno'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'strict_rtp_yes'</span><br><span>diff --git a/tests/rtp/tests.yaml b/tests/rtp/tests.yaml</span><br><span>index 4a5db65..3ff1e44 100644</span><br><span>--- a/tests/rtp/tests.yaml</span><br><span>+++ b/tests/rtp/tests.yaml</span><br><span>@@ -1,3 +1,3 @@</span><br><span> # Enter tests here in the order they should be considered for execution:</span><br><span> tests:</span><br><span style="color: hsl(0, 100%, 40%);">- - test: 'strict_rtp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - dir: 'strict_rtp'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10304">change 10304</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/10304"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I0067bb11793f97423752aef04c8716841a7ad0d9 </div>
<div style="display:none"> Gerrit-Change-Number: 10304 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>