[Asterisk-code-review] res pjsip empty: Add test for reply to empty SIP INFO packets (testsuite[master])

snuffy asteriskteam at digium.com
Mon May 9 04:48:29 CDT 2016


snuffy has uploaded a new change for review.

  https://gerrit.asterisk.org/2788

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 test that checks for 200 - OK responses when PJSIP is sent a
INFO packet with no Content-Type.

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, 201 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/88/2788/1

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..6a8769c
--- /dev/null
+++ b/tests/channels/pjsip/info_empty/configs/ast1/pjsip.conf
@@ -0,0 +1,33 @@
+[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
+
+;; test2
+
+[test2](endpoint_t)
+aors=test2
+
+[test2](aor_t)
+contact=sip:test2 at 127.0.0.1:5062
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..34ddc61
--- /dev/null
+++ b/tests/channels/pjsip/info_empty/sipp/empty.xml
@@ -0,0 +1,139 @@
+<?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]
+
+      0
+
+    ]]>
+  </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]
+
+      1
+
+    ]]>
+  </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]
+
+      2
+
+    ]]>
+  </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..0c8519a
--- /dev/null
+++ b/tests/channels/pjsip/info_empty/test-config.yaml
@@ -0,0 +1,23 @@
+testinfo:
+    summary: 'Test that asterisk correctly handles EMTPY INFO in SIP packets when using PJSIP.'
+    description:
+            Tests INFO packets with no Content-Type are responded to.
+
+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: newchange
Gerrit-Change-Id: I7999582041be32e359940be731972ba9387bb397
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: snuffy <snuffy22 at gmail.com>



More information about the asterisk-code-review mailing list