<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6505">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">testsuite: Repurpose the tel_uri test to test invalid URIs<br><br>We're now testing that non sip(s) URIs that appear in the Request<br>Line or From/To/Contact headers are rejected with a 461.<br><br>Change-Id: I933dda31ff553c77dc64a4d95d28b8bfccbbe98f<br>---<br>R tests/channels/pjsip/invalid_uris/configs/ast1/extensions.conf<br>R tests/channels/pjsip/invalid_uris/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/invalid_uris/sipp/invalid_uris.xml<br>A tests/channels/pjsip/invalid_uris/test-config.yaml<br>D tests/channels/pjsip/tel_uri/sipp/tel_uac.xml<br>D tests/channels/pjsip/tel_uri/test-config.yaml<br>M tests/channels/pjsip/tests.yaml<br>7 files changed, 145 insertions(+), 61 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/05/6505/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/channels/pjsip/tel_uri/configs/ast1/extensions.conf b/tests/channels/pjsip/invalid_uris/configs/ast1/extensions.conf<br>similarity index 100%<br>rename from tests/channels/pjsip/tel_uri/configs/ast1/extensions.conf<br>rename to tests/channels/pjsip/invalid_uris/configs/ast1/extensions.conf<br>diff --git a/tests/channels/pjsip/tel_uri/configs/ast1/pjsip.conf b/tests/channels/pjsip/invalid_uris/configs/ast1/pjsip.conf<br>similarity index 100%<br>rename from tests/channels/pjsip/tel_uri/configs/ast1/pjsip.conf<br>rename to tests/channels/pjsip/invalid_uris/configs/ast1/pjsip.conf<br>diff --git a/tests/channels/pjsip/invalid_uris/sipp/invalid_uris.xml b/tests/channels/pjsip/invalid_uris/sipp/invalid_uris.xml<br>new file mode 100644<br>index 0000000..1b5a5ae<br>--- /dev/null<br>+++ b/tests/channels/pjsip/invalid_uris/sipp/invalid_uris.xml<br>@@ -0,0 +1,118 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="Basic Sipstone UAC"><br>+  <send retrans="500"><br>+    <![CDATA[<br>+<br>+      INVITE tel:+1000;phone-context=foo.com SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]<br>+      To: sut <sip:1000@[remote_ip]:[remote_port]><br>+      Call-ID: [call_id]<br>+      CSeq: 1 INVITE<br>+      Contact: sip:sipp@[local_ip]:[local_port]<br>+      Max-Forwards: 70<br>+      Subject: Performance Test<br>+      Content-Type: application/sdp<br>+      Content-Length: [len]<br>+<br>+      v=0<br>+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+      s=-<br>+      c=IN IP[media_ip_type] [media_ip]<br>+      t=0 0<br>+      m=audio [media_port] RTP/AVP 0<br>+      a=rtpmap:0 PCMU/8000<br>+<br>+    ]]><br>+  </send><br>+<br>+  <recv response="416" /> <!-- Unsupported URI Scheme --><br>+<br>+  <send retrans="500"><br>+    <![CDATA[<br>+<br>+      INVITE sip:1000@[local_ip]:[local_port] SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: <tel:+15558675309>;tag=[pid]SIPpTag00[call_number]<br>+      To: sut <sip:1000@[remote_ip]:[remote_port]><br>+      Call-ID: [call_id]<br>+      CSeq: 1 INVITE<br>+      Contact: sip:sipp@[local_ip]:[local_port]<br>+      Max-Forwards: 70<br>+      Subject: Performance Test<br>+      Content-Type: application/sdp<br>+      Content-Length: [len]<br>+<br>+      v=0<br>+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+      s=-<br>+      c=IN IP[media_ip_type] [media_ip]<br>+      t=0 0<br>+      m=audio [media_port] RTP/AVP 0<br>+      a=rtpmap:0 PCMU/8000<br>+<br>+    ]]><br>+  </send><br>+<br>+  <recv response="416" /> <!-- Unsupported URI Scheme --><br>+<br>+  <send retrans="500"><br>+    <![CDATA[<br>+<br>+      INVITE sip:1000@[local_ip]:[local_port] SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]<br>+      To: sut <tel:+15558675309><br>+      Call-ID: [call_id]<br>+      CSeq: 1 INVITE<br>+      Contact: sip:sipp@[local_ip]:[local_port]<br>+      Max-Forwards: 70<br>+      Subject: Performance Test<br>+      Content-Type: application/sdp<br>+      Content-Length: [len]<br>+<br>+      v=0<br>+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+      s=-<br>+      c=IN IP[media_ip_type] [media_ip]<br>+      t=0 0<br>+      m=audio [media_port] RTP/AVP 0<br>+      a=rtpmap:0 PCMU/8000<br>+<br>+    ]]><br>+  </send><br>+<br>+  <recv response="416" /> <!-- Unsupported URI Scheme --><br>+<br>+  <send retrans="500"><br>+    <![CDATA[<br>+<br>+      INVITE sip:1000@[local_ip]:[local_port] SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]<br>+      To: sut <sip:1000@[remote_ip]:[remote_port]><br>+      Call-ID: [call_id]<br>+      CSeq: 1 INVITE<br>+      Contact: tel:+15558675309<br>+      Max-Forwards: 70<br>+      Subject: Performance Test<br>+      Content-Type: application/sdp<br>+      Content-Length: [len]<br>+<br>+      v=0<br>+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+      s=-<br>+      c=IN IP[media_ip_type] [media_ip]<br>+      t=0 0<br>+      m=audio [media_port] RTP/AVP 0<br>+      a=rtpmap:0 PCMU/8000<br>+<br>+    ]]><br>+  </send><br>+<br>+  <recv response="416" /> <!-- Unsupported URI Scheme --><br>+<br>+</scenario><br>+<br>diff --git a/tests/channels/pjsip/invalid_uris/test-config.yaml b/tests/channels/pjsip/invalid_uris/test-config.yaml<br>new file mode 100644<br>index 0000000..adf54dd<br>--- /dev/null<br>+++ b/tests/channels/pjsip/invalid_uris/test-config.yaml<br>@@ -0,0 +1,26 @@<br>+testinfo:<br>+    summary: 'Verifies that non sip(s) uri requests are rejected'<br>+    description: |<br>+        This test verifies that non sip(s) URIs are rejected when appearing in<br>+        the Request Line or in the From/To/Contact headers.<br>+<br>+properties:<br>+    minversion: ['13.18.1', '14.7.1']<br>+    dependencies:<br>+        - python : 'twisted'<br>+        - python : 'starpy'<br>+        - app : 'sipp'<br>+        - asterisk : 'res_pjsip'<br>+    tags:<br>+        - pjsip<br>+<br>+test-modules:<br>+    test-object:<br>+        config-section: sipp-config<br>+        typename: 'sipp.SIPpTestCase'<br>+<br>+sipp-config:<br>+    test-iterations:<br>+        -<br>+            scenarios:<br>+                - { 'key-args': {'scenario': 'invalid_uris.xml', '-p': '5061'} }<br>diff --git a/tests/channels/pjsip/tel_uri/sipp/tel_uac.xml b/tests/channels/pjsip/tel_uri/sipp/tel_uac.xml<br>deleted file mode 100644<br>index 29c30b1..0000000<br>--- a/tests/channels/pjsip/tel_uri/sipp/tel_uac.xml<br>+++ /dev/null<br>@@ -1,34 +0,0 @@<br>-<?xml version="1.0" encoding="ISO-8859-1" ?><br>-<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>-<br>-<scenario name="Basic Sipstone UAC"><br>-  <send retrans="500"><br>-    <![CDATA[<br>-<br>-      INVITE tel:+1000;phone-context=foo.com SIP/2.0<br>-      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>-      From: <tel:1000;phone-context=+1555>;tag=[pid]SIPpTag00[call_number]<br>-      To: sut <tel:+15558675309><br>-      Call-ID: [call_id]<br>-      CSeq: 1 INVITE<br>-      Contact: sip:sipp@[local_ip]:[local_port]<br>-      Max-Forwards: 70<br>-      Subject: Performance Test<br>-      Content-Type: application/sdp<br>-      Content-Length: [len]<br>-<br>-      v=0<br>-      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>-      s=-<br>-      c=IN IP[media_ip_type] [media_ip]<br>-      t=0 0<br>-      m=audio [media_port] RTP/AVP 0<br>-      a=rtpmap:0 PCMU/8000<br>-<br>-    ]]><br>-  </send><br>-<br>-  <recv response="416" /> <!-- Unsupported URI Scheme --><br>-<br>-</scenario><br>-<br>diff --git a/tests/channels/pjsip/tel_uri/test-config.yaml b/tests/channels/pjsip/tel_uri/test-config.yaml<br>deleted file mode 100644<br>index eb5e6d7..0000000<br>--- a/tests/channels/pjsip/tel_uri/test-config.yaml<br>+++ /dev/null<br>@@ -1,26 +0,0 @@<br>-testinfo:<br>-    summary: 'TEL URI support in basic inbound calls'<br>-    description: |<br>-        This test verifies that TEL URIs are appropriately handled in a basic<br>-        incoming call situation.<br>-<br>-properties:<br>-    minversion: ['13.17.1', '14.6.1']<br>-    dependencies:<br>-        - python : 'twisted'<br>-        - python : 'starpy'<br>-        - app : 'sipp'<br>-        - asterisk : 'res_pjsip'<br>-    tags:<br>-        - pjsip<br>-<br>-test-modules:<br>-    test-object:<br>-        config-section: sipp-config<br>-        typename: 'sipp.SIPpTestCase'<br>-<br>-sipp-config:<br>-    test-iterations:<br>-        -<br>-            scenarios:<br>-                - { 'key-args': {'scenario': 'tel_uac.xml', '-p': '5061'} }<br>diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml<br>index a25007f..ceadbde 100644<br>--- a/tests/channels/pjsip/tests.yaml<br>+++ b/tests/channels/pjsip/tests.yaml<br>@@ -54,4 +54,4 @@<br>     - test: 'cseq_method'<br>     - test: 'multipart_empty_part'<br>     - test: 'dtmf_info_fallback'<br>-    - test: 'tel_uri'<br>+    - test: 'invalid_uris'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6505">change 6505</a>. To unsubscribe, 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/6505"/><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: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I933dda31ff553c77dc64a4d95d28b8bfccbbe98f </div>
<div style="display:none"> Gerrit-Change-Number: 6505 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>