[Asterisk-code-review] testsuite: verify unknown content-disposion handling (testsuite[13])

Friendly Automation asteriskteam at digium.com
Mon Apr 6 13:27:49 CDT 2020


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/testsuite/+/13953 )

Change subject: testsuite: verify unknown content-disposion handling
......................................................................

testsuite: verify unknown content-disposion handling

Verify that if handling is required for a content type and
asterisk does not know how to handle it.  It will be rejected
with a 415 response

ASTERISK-28782 #close

Change-Id: Icaf27d73e4fb16be192025b59a7fa58a8f83b827
---
A tests/channels/pjsip/content_disposition/configs/ast1/extensions.conf
A tests/channels/pjsip/content_disposition/configs/ast1/pjsip.conf
A tests/channels/pjsip/content_disposition/sipp/A_PARTY.xml
A tests/channels/pjsip/content_disposition/test-config.yaml
M tests/channels/pjsip/tests.yaml
5 files changed, 186 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/tests/channels/pjsip/content_disposition/configs/ast1/extensions.conf b/tests/channels/pjsip/content_disposition/configs/ast1/extensions.conf
new file mode 100644
index 0000000..ad7b155
--- /dev/null
+++ b/tests/channels/pjsip/content_disposition/configs/ast1/extensions.conf
@@ -0,0 +1,11 @@
+[general]
+static=yes
+writeprotect=yes
+autofallthrough=yes
+clearglobalvars=no
+priorityjumping=yes
+
+[globals]
+
+[default]
+exten => _X.,1,Dial(pjsip/sbc,180)
diff --git a/tests/channels/pjsip/content_disposition/configs/ast1/pjsip.conf b/tests/channels/pjsip/content_disposition/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..eae3301
--- /dev/null
+++ b/tests/channels/pjsip/content_disposition/configs/ast1/pjsip.conf
@@ -0,0 +1,53 @@
+[global]
+type = global
+user_agent = Vox Callcontrol
+debug = yes
+
+[transport-udp]
+type = transport
+protocol = udp
+bind = 0.0.0.0
+
+[PEER_A]
+type = aor
+contact = sip:127.0.0.1:5061
+
+[PEER_A]
+type = identify
+endpoint = PEER_A
+match = 127.0.0.1
+
+[PEER_A]
+type = endpoint
+context = default
+dtmf_mode = rfc4733
+disallow = all
+allow = alaw
+allow = ulaw
+allow = g729
+allow = h263p
+allow = h264
+direct_media = no
+send_rpid = yes
+sdp_session = session
+aors = PEER_A
+
+[sbc]
+type = aor
+contact = sip:127.0.0.1:5700
+
+[sbc]
+type = endpoint
+context = default
+dtmf_mode = rfc4733
+disallow = all
+allow = alaw
+allow = ulaw
+allow = g729
+allow = h263p
+allow = h264
+direct_media = no
+send_rpid = yes
+sdp_session = session
+aors = sbc
+
diff --git a/tests/channels/pjsip/content_disposition/sipp/A_PARTY.xml b/tests/channels/pjsip/content_disposition/sipp/A_PARTY.xml
new file mode 100644
index 0000000..67779e8
--- /dev/null
+++ b/tests/channels/pjsip/content_disposition/sipp/A_PARTY.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE scenario SYSTEM "bansallaptop.dtd">
+<!-- This program is free software; you can redistribute it and/or      -->
+<!-- modify it under the terms of the GNU General Public License as     -->
+<!-- published by the Free Software Foundation; either version 2 of the -->
+<!-- License, or (at your option) any later version.                    -->
+<!--                                                                    -->
+<!-- This program is distributed in the hope that it will be useful,    -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      -->
+<!-- GNU General Public License for more details.                       -->
+<!--                                                                    -->
+<!-- You should have received a copy of the GNU General Public License  -->
+<!-- along with this program; if not, write to the                      -->
+<!-- Free Software Foundation, Inc.,                                    -->
+<!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             -->
+<!--                                                                    -->
+<!--                 Sipp default 'uac' scenario.                       -->
+<!--                                                                    -->
+<scenario name="A_PARTY.xml">
+  <!-- INVITE with application/ISUP and sdp body, asterisk should ignore ISUP body and still process the SDP -->
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:[service]@[remote_ip] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From:  <sip:bansallaptop@[local_ip]:[local_port]>;tag=[call_number]
+      To: bansalphone <sip:[service]@[remote_ip]>
+      Call-ID: [call_id]
+      X-VCC-UUID: [pid][clock_tick][call_number]
+      X-VCC-Provider: 61 [local_ip] BEL
+      CSeq: 1 INVITE
+      Contact: sip:bansallaptop@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Type: multipart/mixed;boundary=ub-dialogic-sw-1
+      Content-Length: [len]
+
+      --ub-dialogic-sw-1
+      Content-Type: application/sdp
+
+      v=0
+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+      s=-
+      c=IN IP[media_ip_type] [media_ip]
+      t=0 0
+      m=audio 7000 RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+
+      --ub-dialogic-sw-1
+      Content-Type: application/ISUP;version=itu-t92+
+      Content-Disposition: signal;handling=required
+
+      \x01\x00\x20\x01\x0a\x00\x02\x0a\x08\x83\x90\x12\x31\x78\x98\x90\x09\x0a\x07\x03\x11\x12\x80\x81\x44\x10\x08\x01\x80\x31\x02\x00\x00\x3d\x01\x12\x03\x0c\x6d\x06\x80\x50\x31\x32\x33\x34\x7d\x02\x91\x81\x1d\x03\x80\x90\xa3\x20\x18\x04\x42\x69\x74\x74\x65\x20\x72\x75\x66\x65\x6e\x20\x53\x69\x65\x20\x7a\x75\x72\x75\x65\x63\x6b\x39\x06\x31\xc0\x3d\xc0\xfe\xd0\xfe\x01\x01\x00
+      --ub-dialogic-sw-1--
+    ]]>
+  </send>
+
+  <recv response="100" optional="true">
+  </recv>
+
+
+
+  <!-- By adding rrs="true" (Record Route Sets), the route sets         -->
+  <!-- are saved and used for following messages sent. Useful to test   -->
+  <!-- against stateful SIP proxies/B2BUAs.                             -->
+  <recv response="415" rtd="true" rrs="true">
+  </recv>
+
+
+  <!-- Packet lost can be simulated in any send/recv message by         -->
+  <!-- by adding the 'lost = "10"'. Value can be [1-100] percent.       -->
+  <send>
+    <![CDATA[
+
+      ACK [next_url] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: bansallaptop <sip:bansallaptop@[local_ip]:[local_port]>;tag=[call_number]
+      To: bansalphone <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 1 ACK
+      Contact: sip:bansallaptop@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      [routes]
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+
+</scenario>
diff --git a/tests/channels/pjsip/content_disposition/test-config.yaml b/tests/channels/pjsip/content_disposition/test-config.yaml
new file mode 100644
index 0000000..3e4adc8
--- /dev/null
+++ b/tests/channels/pjsip/content_disposition/test-config.yaml
@@ -0,0 +1,29 @@
+testinfo:
+    summary: 'Reject INVITE if unknown content type requires handling'
+    description: |
+         'If unknown media has handling=required in its content disposition reject the call with 415'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'sipp.SIPpTestCase'
+
+test-object-config:
+    memcheck-delay-stop: 7
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': { 'scenario': 'A_PARTY.xml', '-p': '5061', '-i': '127.0.0.1', '-s': '3200000000' } }
+
+
+properties:
+    dependencies:
+        - sipp :
+             version : 'v3.0'
+        - asterisk : 'res_pjsip'
+        - asterisk : 'res_pjsip_session'
+        - asterisk : 'chan_pjsip'
+
+    tags:
+        - pjsip
diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml
index abc17c0..3b32221 100644
--- a/tests/channels/pjsip/tests.yaml
+++ b/tests/channels/pjsip/tests.yaml
@@ -59,3 +59,4 @@
     - test: 'invalid_uris'
     - test: 'moh_passthru_inactive'
     - test: 'non_negotiated_frame_SSRC_change'
+    - test: 'content_disposition'

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/13953
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 13
Gerrit-Change-Id: Icaf27d73e4fb16be192025b59a7fa58a8f83b827
Gerrit-Change-Number: 13953
Gerrit-PatchSet: 3
Gerrit-Owner: Torrey Searle <tsearle at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200406/8a140211/attachment-0001.html>


More information about the asterisk-code-review mailing list