<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/13569">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_endpoint_identifier_ip: Add port matching tests<br><br>ASTERISK~28639<br><br>Change-Id: I1552621070ba288844af8449796ffc7b02389f5a<br>---<br>A tests/channels/pjsip/identify/port_matching/port/configs/ast1/extensions.conf<br>A tests/channels/pjsip/identify/port_matching/port/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/identify/port_matching/port/sipp/nominal.xml<br>A tests/channels/pjsip/identify/port_matching/port/sipp/off_nominal.xml<br>A tests/channels/pjsip/identify/port_matching/port/test-config.yaml<br>A tests/channels/pjsip/identify/port_matching/port_with_mask/configs/ast1/extensions.conf<br>A tests/channels/pjsip/identify/port_matching/port_with_mask/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/identify/port_matching/port_with_mask/sipp/nominal.xml<br>A tests/channels/pjsip/identify/port_matching/port_with_mask/sipp/off_nominal.xml<br>A tests/channels/pjsip/identify/port_matching/port_with_mask/test-config.yaml<br>A tests/channels/pjsip/identify/port_matching/tests.yaml<br>M tests/channels/pjsip/identify/tests.yaml<br>12 files changed, 388 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/channels/pjsip/identify/port_matching/port/configs/ast1/extensions.conf b/tests/channels/pjsip/identify/port_matching/port/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..df819c9</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/port/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/channels/pjsip/identify/port_matching/port/configs/ast1/pjsip.conf b/tests/channels/pjsip/identify/port_matching/port/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..fc1406f</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/port/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,26 @@</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%);">+[local-transport-template](!)</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp](local-transport-template)</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%);">+[endpoint-template-ipv4](!)</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,alaw</span><br><span style="color: hsl(120, 100%, 40%);">+media_address=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice](endpoint-template-ipv4)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[identify-template](!)</span><br><span style="color: hsl(120, 100%, 40%);">+type=identify</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice-identify](identify-template)</span><br><span style="color: hsl(120, 100%, 40%);">+endpoint=alice</span><br><span style="color: hsl(120, 100%, 40%);">+match=127.0.0.1:5061</span><br><span>diff --git a/tests/channels/pjsip/identify/port_matching/port/sipp/nominal.xml b/tests/channels/pjsip/identify/port_matching/port/sipp/nominal.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..1790d39</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/port/sipp/nominal.xml</span><br><span>@@ -0,0 +1,85 @@</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%);">+ <pause/></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%);">+ BYE 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: 2 BYE</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 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 style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/identify/port_matching/port/sipp/off_nominal.xml b/tests/channels/pjsip/identify/port_matching/port/sipp/off_nominal.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..6cd401f</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/port/sipp/off_nominal.xml</span><br><span>@@ -0,0 +1,42 @@</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="401"></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 style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/identify/port_matching/port/test-config.yaml b/tests/channels/pjsip/identify/port_matching/port/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..c23cb47</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/port/test-config.yaml</span><br><span>@@ -0,0 +1,31 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Tests incoming calls identified by source IP and source port'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This test covers sending calls to an Asterisk instance</span><br><span style="color: hsl(120, 100%, 40%);">+ identified by a source IP address and source port.</span><br><span style="color: hsl(120, 100%, 40%);">+ It is expected that both scenarios pass, with the first</span><br><span style="color: hsl(120, 100%, 40%);">+ accepting the INVITE and the second rejecting with a 401.</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%);">+ 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%);">+</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%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ # IPv4 & UDP</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': 'nominal.xml', '-i': '127.0.0.1', '-p': '5061', '-s': 's'} }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': {'scenario': 'off_nominal.xml', '-i': '127.0.0.1', '-p': '5062', '-s': 's'} }</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%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</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 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/identify/port_matching/port_with_mask/configs/ast1/extensions.conf b/tests/channels/pjsip/identify/port_matching/port_with_mask/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..df819c9</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/port_with_mask/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/channels/pjsip/identify/port_matching/port_with_mask/configs/ast1/pjsip.conf b/tests/channels/pjsip/identify/port_matching/port_with_mask/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..2b85dad</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/port_with_mask/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,26 @@</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%);">+[local-transport-template](!)</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp](local-transport-template)</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%);">+[endpoint-template-ipv4](!)</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,alaw</span><br><span style="color: hsl(120, 100%, 40%);">+media_address=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice](endpoint-template-ipv4)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[identify-template](!)</span><br><span style="color: hsl(120, 100%, 40%);">+type=identify</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[alice-identify](identify-template)</span><br><span style="color: hsl(120, 100%, 40%);">+endpoint=alice</span><br><span style="color: hsl(120, 100%, 40%);">+match=127.0.0.0:5061/8</span><br><span>diff --git a/tests/channels/pjsip/identify/port_matching/port_with_mask/sipp/nominal.xml b/tests/channels/pjsip/identify/port_matching/port_with_mask/sipp/nominal.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..1790d39</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/port_with_mask/sipp/nominal.xml</span><br><span>@@ -0,0 +1,85 @@</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%);">+ <pause/></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%);">+ BYE 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: 2 BYE</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 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 style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/identify/port_matching/port_with_mask/sipp/off_nominal.xml b/tests/channels/pjsip/identify/port_matching/port_with_mask/sipp/off_nominal.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..6cd401f</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/port_with_mask/sipp/off_nominal.xml</span><br><span>@@ -0,0 +1,42 @@</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="401"></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 style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/identify/port_matching/port_with_mask/test-config.yaml b/tests/channels/pjsip/identify/port_matching/port_with_mask/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..ce57efa</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/port_with_mask/test-config.yaml</span><br><span>@@ -0,0 +1,34 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Tests incoming calls identified by source network and port'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This test covers sending calls to an Asterisk instance</span><br><span style="color: hsl(120, 100%, 40%);">+ identified by a source network and source port.</span><br><span style="color: hsl(120, 100%, 40%);">+ It is expected that all scenarios pass, with the first</span><br><span style="color: hsl(120, 100%, 40%);">+ two accepting the INVITE and the second two rejecting</span><br><span style="color: hsl(120, 100%, 40%);">+ with a 401.</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%);">+ 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%);">+</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%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ # IPv4 & UDP</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': 'nominal.xml', '-i': '127.0.0.1', '-p': '5061', '-s': 's'} }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': {'scenario': 'nominal.xml', '-i': '127.0.0.2', '-p': '5061', '-s': 's'} }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': {'scenario': 'off_nominal.xml', '-i': '127.0.0.1', '-p': '5062', '-s': 's'} }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': {'scenario': 'off_nominal.xml', '-i': '127.0.0.2', '-p': '5062', '-s': 's'} }</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%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</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 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/identify/port_matching/tests.yaml b/tests/channels/pjsip/identify/port_matching/tests.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..62ede86</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/identify/port_matching/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: 'port'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'port_with_mask'</span><br><span>diff --git a/tests/channels/pjsip/identify/tests.yaml b/tests/channels/pjsip/identify/tests.yaml</span><br><span>index 60215c3..c896582 100644</span><br><span>--- a/tests/channels/pjsip/identify/tests.yaml</span><br><span>+++ b/tests/channels/pjsip/identify/tests.yaml</span><br><span>@@ -5,3 +5,4 @@</span><br><span> - test: 'header_ordering_header_ip'</span><br><span> - test: 'header_ordering_ip_header'</span><br><span> - test: 'ordering'</span><br><span style="color: hsl(120, 100%, 40%);">+ - dir: 'port_matching'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/13569">change 13569</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/c/testsuite/+/13569"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: I1552621070ba288844af8449796ffc7b02389f5a </div>
<div style="display:none"> Gerrit-Change-Number: 13569 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>