<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7732">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">AST-2017-014: res_pjsip - Test for missing contact headers<br><br>If a SIP message that creates a dialog does not contain a contact header<br>Asterisk responds with a 400. This test checks each of those SIP messages<br>with missing contact headers against Asterisk to make sure the proper<br>response is received.<br><br>ASTERISK-27480 #close<br><br>Change-Id: Ie0078c482dd06f14653729a46b69fb48fbc19f23<br>---<br>A tests/channels/pjsip/headers/no_contact/configs/ast1/extensions.conf<br>A tests/channels/pjsip/headers/no_contact/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/headers/no_contact/sipp/no_contact.xml<br>A tests/channels/pjsip/headers/no_contact/test-config.yaml<br>M tests/channels/pjsip/headers/tests.yaml<br>5 files changed, 182 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/channels/pjsip/headers/no_contact/configs/ast1/extensions.conf b/tests/channels/pjsip/headers/no_contact/configs/ast1/extensions.conf<br>new file mode 100644<br>index 0000000..4365177<br>--- /dev/null<br>+++ b/tests/channels/pjsip/headers/no_contact/configs/ast1/extensions.conf<br>@@ -0,0 +1,3 @@<br>+[general]<br>+<br>+[default]<br>diff --git a/tests/channels/pjsip/headers/no_contact/configs/ast1/pjsip.conf b/tests/channels/pjsip/headers/no_contact/configs/ast1/pjsip.conf<br>new file mode 100644<br>index 0000000..e59c702<br>--- /dev/null<br>+++ b/tests/channels/pjsip/headers/no_contact/configs/ast1/pjsip.conf<br>@@ -0,0 +1,34 @@<br>+[local]<br>+type=transport<br>+protocol=udp<br>+bind=0.0.0.0<br>+<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+<br>+[endpoint_t](!)<br>+type=endpoint<br>+transport=local<br>+context=default<br>+direct_media=no<br>+disallow=all<br>+allow=ulaw<br>+<br>+[aor_t](!)<br>+type=aor<br>+max_contacts=10<br>+<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+;;; alice<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+<br>+[alice](aor_t)<br>+contact=sip:alice@127.0.0.1:5061<br>+<br>+[alice]<br>+type=auth<br>+username=alice<br>+password=alice<br>+<br>+[alice](endpoint_t)<br>+aors=alice<br>+auth=alice<br>diff --git a/tests/channels/pjsip/headers/no_contact/sipp/no_contact.xml b/tests/channels/pjsip/headers/no_contact/sipp/no_contact.xml<br>new file mode 100644<br>index 0000000..d0ede2b<br>--- /dev/null<br>+++ b/tests/channels/pjsip/headers/no_contact/sipp/no_contact.xml<br>@@ -0,0 +1,116 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="Missing Contact"><br>+   <send retrans="500"><br>+         <![CDATA[<br>+         INVITE sip:alice@[remote_ip]:[remote_port] SIP/2.0<br>+           Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+             Max-Forwards: 70<br>+             From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid].[call_number]<br>+            To: "bob" <sip:bob@[remote_ip]:[remote_port]><br>+                Call-ID: [call_id]<br>+           CSeq: [cseq] INVITE<br>+          Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER<br>+             Supported: replaces, 100rel, timer, norefersub<br>+               Session-Expires: 1800<br>+                Min-SE: 90<br>+           User-Agent: Test<br>+             Content-Type: application/sdp<br>+                Content-Length: [len]<br>+<br>+             ]]><br>+       </send><br>+<br>+     <recv response="400" /><br>+<br>+   <send retrans="500"><br>+         <![CDATA[<br>+         UPDATE sip:alice@[remote_ip]:[remote_port] SIP/2.0<br>+           Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+             Max-Forwards: 70<br>+             From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid].[call_number]<br>+            To: "bob" <sip:bob@[remote_ip]:[remote_port]><br>+                Call-ID: [call_id]<br>+           CSeq: [cseq] UPDATE<br>+          Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER<br>+             Supported: replaces, 100rel, timer, norefersub<br>+               Session-Expires: 1800<br>+                Min-SE: 90<br>+           User-Agent: Test<br>+             Content-Type: application/sdp<br>+                Content-Length: [len]<br>+<br>+             ]]><br>+       </send><br>+<br>+     <recv response="400" /><br>+<br>+   <send retrans="500"><br>+         <![CDATA[<br>+         SUBSCRIBE sip:alice@[remote_ip]:[remote_port] SIP/2.0<br>+                Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+             Max-Forwards: 70<br>+             From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid].[call_number]<br>+            To: "alice" <sip:alice@[remote_ip]:[remote_port]><br>+            Call-ID: [call_id]<br>+           CSeq: [cseq] SUBSCRIBE<br>+               Event: presence<br>+              Expires: 3600<br>+                Supported: replaces, 100rel, timer, norefersub<br>+               Accept: application/pidf+xml<br>+         User-Agent: Test<br>+             Content-Length: [len]<br>+<br>+             ]]><br>+       </send><br>+<br>+     <recv response="400" /><br>+<br>+   <send retrans="500"><br>+    <![CDATA[<br>+              REFER sip:alice@[remote_ip]:[remote_port] SIP/2.0<br>+            Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+             Max-Forwards: 70<br>+             From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid].[call_number]<br>+            To: "bob" <sip:bob@[remote_ip]:[remote_port]><br>+                Call-ID: [call_id]<br>+           CSeq: [cseq] REFER<br>+           Event: refer<br>+         Expires: 600<br>+         Supported: replaces, 100rel, timer, norefersub<br>+               Accept: message/sipfag;version=2.0<br>+           Allow-Events: presence, message-summary, refer<br>+               Refer-To: sip:charlie@[remote_ip]:[remote_port];user=phone<br>+           Referred-By: sip:alice@[local_ip]:[local_port]<br>+               User-Agent: Test<br>+             Content-Length: [len]<br>+<br>+    ]]><br>+        </send><br>+<br>+     <recv response="400" /><br>+<br>+   <send retrans="500"><br>+         <![CDATA[<br>+         NOTIFY sip:bob@[remote_ip]:[remote_port] SIP/2.0<br>+             Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+             Max-Forwards: 70<br>+             From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid].[call_number]<br>+            To: "bob" <sip:bob@[remote_ip]:[remote_port]><br>+                Call-ID: [call_id]<br>+           CSeq: [cseq] NOTIFY<br>+          Event: message-summary<br>+               Expires: 3600<br>+                Supported: replaces, 100rel, timer, norefersub<br>+               Accept: application/pidf+xml<br>+         User-Agent: Test<br>+             Content-Type: application/simple-message-summary<br>+             Content-Length: [len]<br>+<br>+             ]]><br>+       </send><br>+<br>+     <recv response="400" /><br>+<br>+</scenario><br>diff --git a/tests/channels/pjsip/headers/no_contact/test-config.yaml b/tests/channels/pjsip/headers/no_contact/test-config.yaml<br>new file mode 100644<br>index 0000000..ffa105a<br>--- /dev/null<br>+++ b/tests/channels/pjsip/headers/no_contact/test-config.yaml<br>@@ -0,0 +1,28 @@<br>+testinfo:<br>+    summary: 'Test SIP messages that contain no contact header'<br>+    description: |<br>+        'SIP messages that create dialogs must contain a contact header.<br>+         This test makes sure that Asterisk responds with a 400 for those<br>+         SIP message types that require a contact header.'<br>+<br>+properties:<br>+    minversion: ['13.19.1', '14.7.5', '15.2.1']<br>+    dependencies:<br>+        - sipp :<br>+            version : 'v3.0'<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>+    reactor-timeout: 20<br>+    test-iterations:<br>+        -<br>+            scenarios:<br>+                - { 'key-args': {'scenario': 'no_contact.xml', '-p': '5061',<br>+                    '-au': 'alice', '-ap': 'alice'} }<br>diff --git a/tests/channels/pjsip/headers/tests.yaml b/tests/channels/pjsip/headers/tests.yaml<br>index 7c3b64d..6206526 100644<br>--- a/tests/channels/pjsip/headers/tests.yaml<br>+++ b/tests/channels/pjsip/headers/tests.yaml<br>@@ -1,4 +1,5 @@<br> # Enter tests here in the order they should be considered for execution:<br> tests:<br>     - test: 'anonymous_from_basic_call'<br>+    - test: 'no_contact'<br>     - test: 'non-anonymous_from_basic_call'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7732">change 7732</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/7732"/><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: Ie0078c482dd06f14653729a46b69fb48fbc19f23 </div>
<div style="display:none"> Gerrit-Change-Number: 7732 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>