[asterisk-commits] res pjsip empty: Add test for reply to empty SIP INFO packets (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 18 13:46:44 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: res_pjsip_empty: Add test for reply to empty SIP INFO packets
......................................................................


res_pjsip_empty: Add test for reply to empty SIP INFO packets

Add new test that checks after establishing a call via an INVITE,
when an INFO packet is recieved with no 'Content-Type' header,
the emtpy INFO module should respond with a 200 - OK packet.

ASTERISK-24986

Change-Id: I7999582041be32e359940be731972ba9387bb397
---
A tests/channels/pjsip/info_empty/configs/ast1/extensions.conf
A tests/channels/pjsip/info_empty/configs/ast1/pjsip.conf
A tests/channels/pjsip/info_empty/sipp/empty.xml
A tests/channels/pjsip/info_empty/test-config.yaml
M tests/channels/pjsip/tests.yaml
5 files changed, 189 insertions(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/tests/channels/pjsip/info_empty/configs/ast1/extensions.conf b/tests/channels/pjsip/info_empty/configs/ast1/extensions.conf
new file mode 100644
index 0000000..7476ff3
--- /dev/null
+++ b/tests/channels/pjsip/info_empty/configs/ast1/extensions.conf
@@ -0,0 +1,5 @@
+[default]
+
+exten => empty,1,NoOp()
+    same => n,Answer()
+    same => n,MusicOnHold()
diff --git a/tests/channels/pjsip/info_empty/configs/ast1/pjsip.conf b/tests/channels/pjsip/info_empty/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..33e61b9
--- /dev/null
+++ b/tests/channels/pjsip/info_empty/configs/ast1/pjsip.conf
@@ -0,0 +1,25 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+[endpoint_t](!)
+type=endpoint
+context=default
+transport=local
+direct_media=no
+disallow=all
+allow=ulaw
+dtmf_mode=info
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+;; test
+
+[test](endpoint_t)
+aors=test
+
+[test](aor_t)
+contact=sip:test at 127.0.0.1:5061
diff --git a/tests/channels/pjsip/info_empty/sipp/empty.xml b/tests/channels/pjsip/info_empty/sipp/empty.xml
new file mode 100644
index 0000000..5fb32ec
--- /dev/null
+++ b/tests/channels/pjsip/info_empty/sipp/empty.xml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="INFO Test">
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:empty@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: test <sip:test@[local_ip]:[local_port]>;tag=[call_number]
+      To: empty <sip:empty@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 INVITE
+      Contact: sip:test@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: INFO Test
+      Content-Length: [len]
+
+      v=0
+      o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+      s=-
+      c=IN IP[media_ip_type] [media_ip]
+      t=0 0
+      m=audio 6000 RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv response="100" optional="true">
+  </recv>
+
+  <recv response="200" rtd="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      ACK sip:empty@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: test <sip:test@[local_ip]:[local_port]>;tag=[call_number]
+      To: empty <sip:empty@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 1 ACK
+      Contact: sip:test@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: INFO Test
+      Content-Type: application/sdp
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: empty <sip:empty@[local_ip]:[local_port]>;tag=[call_number]
+      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 2 INFO
+      Contact: sip:test@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Content-Length: [len]
+
+    ]]>
+  </send>
+
+  <recv response="200" crlf="true">
+  </recv>
+
+  <send retrans="500">
+    <![CDATA[
+
+      INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: empty <sip:empty@[local_ip]:[local_port]>;tag=[call_number]
+      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 3 INFO
+      Contact: sip:test@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Content-Length: [len]
+
+    ]]>
+  </send>
+
+  <recv response="200" crlf="true">
+  </recv>
+
+  <send retrans="500">
+    <![CDATA[
+
+      INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: empty <sip:empty@[local_ip]:[local_port]>;tag=[call_number]
+      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 17 INFO
+      Contact: sip:test@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Content-Length: [len]
+
+    ]]>
+  </send>
+
+  <recv response="200" crlf="true">
+  </recv>
+
+  <pause/>
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:empty@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: test <sip:test@[local_ip]:[local_port]>;tag=[call_number]
+      To: empty <sip:empty@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 18 BYE
+      Contact: sip:test@[local_ip][local_port]
+      Max-Forwards: 70
+      Subject: INFO Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200" crlf="true">
+  </recv>
+
+</scenario>
diff --git a/tests/channels/pjsip/info_empty/test-config.yaml b/tests/channels/pjsip/info_empty/test-config.yaml
new file mode 100644
index 0000000..8e9f286
--- /dev/null
+++ b/tests/channels/pjsip/info_empty/test-config.yaml
@@ -0,0 +1,25 @@
+testinfo:
+    summary: 'Test that asterisk correctly handles EMTPY INFO in SIP packets when using PJSIP.'
+    description:
+            This test checks that after establishing a call via an INVITE, when
+            an INFO packet is recieved with no 'Content-Type' header, the
+            emtpy INFO module should respond with a 200 - OK packet.
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'sipp.SIPpTestCase'
+
+test-object-config:
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'empty.xml', '-i': '127.0.0.1', '-p': '5061', '-d': '3000'} }
+
+properties:
+    minversion: '13.10.0'
+    dependencies:
+        - app : 'sipp'
+        - asterisk : 'res_pjsip'
+    tags:
+        - pjsip
diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml
index b44fafb..88a9a06 100644
--- a/tests/channels/pjsip/tests.yaml
+++ b/tests/channels/pjsip/tests.yaml
@@ -37,6 +37,7 @@
     - test: 'incoming_call_on_second_transport'
     - test: 'incoming_calls_without_auth'
     - test: 'info_dtmf'
+    - test: 'info_empty'
     - test: 'keep_alive'
     - test: 'reinvite_early'
     - test: 'reinvite_pending'

-- 
To view, visit https://gerrit.asterisk.org/2788
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7999582041be32e359940be731972ba9387bb397
Gerrit-PatchSet: 3
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: snuffy <snuffy22 at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: snuffy <snuffy22 at gmail.com>



More information about the asterisk-commits mailing list