[asterisk-commits] kmoore: testsuite/asterisk/trunk r4623 - in /asterisk/trunk/tests/channels/pj...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 30 14:04:08 CST 2014


Author: kmoore
Date: Thu Jan 30 14:04:03 2014
New Revision: 4623

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4623
Log:
TestSuite: Add chan_pjsip path support tests

This adds a test which covers path support for outbound registrations,
inbound registrations, and outbound requests following an inbound
registration.

(closes issue ASTERISK-21084)
Review: https://reviewboard.asterisk.org/r/3051/

Added:
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/registrar.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_invite_recv.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_register.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/tests.yaml

Added: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/extensions.conf?view=auto&rev=4623
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/extensions.conf Thu Jan 30 14:04:03 2014
@@ -1,0 +1,6 @@
+[default]
+
+exten => s,1,NoOp()
+same => n,Answer()
+same => n,Dial(PJSIP/ua1)
+same => n,Hangup()

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/pjsip.conf?view=auto&rev=4623
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/pjsip.conf Thu Jan 30 14:04:03 2014
@@ -1,0 +1,26 @@
+[local-transport-udp]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[ua1_reg]
+type=registration
+transport=local-transport-udp
+server_uri=sip:asterisk at 127.0.0.1:5063
+client_uri=sip:asterisk at 127.0.0.1:5060
+support_path=yes
+
+[endpoint-template](!)
+type=endpoint
+context=default
+allow=!all,ulaw
+
+[ua1](endpoint-template)
+aors=ua1
+
+[ua1]
+type=aor
+max_contacts=1
+minimum_expiration=5
+default_expiration=30
+support_path=yes

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/registrar.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/registrar.xml?view=auto&rev=4623
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/registrar.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/registrar.xml Thu Jan 30 14:04:03 2014
@@ -1,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="External Registrar">
+  <recv request="REGISTER" crlf="true">
+      <action>
+          <ereg regexp=".*path.*"
+              header="Supported:"
+              search_in="hdr"
+              check_it="true"
+              assign_to="1"/>
+      </action>
+  </recv>
+  <Reference variables="1" />
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Route: <sip:localhost:5062;lr>,<sip:P1.EXAMPLEVISITED.COM;lr>
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+    ]]>
+  </send>
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/registrar.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/registrar.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/registrar.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_invite_recv.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_invite_recv.xml?view=auto&rev=4623
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_invite_recv.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_invite_recv.xml Thu Jan 30 14:04:03 2014
@@ -1,0 +1,120 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.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 'uas' scenario.                       -->
+<!--                                                                    -->
+
+<scenario name="UAS for Path testing">
+  <Global variables="remote" />
+  <recv request="INVITE" crlf="true">
+      <action>
+          <!-- Save the from header. We'll need it when we send our BYE -->
+          <ereg regexp=".*(;tag=.*)"
+              header="From:"
+              search_in="hdr"
+              check_it="true"
+              assign_to="remote"/>
+          <ereg regexp=".*<sip:localhost:5062;lr>.*"
+              header="Route:"
+              search_in="hdr"
+              check_it="true"
+              occurence="1"
+              assign_to="1"/>
+          <ereg regexp=".*<sip:P1.EXAMPLEVISITED.COM;lr>.*"
+              header="Route:"
+              search_in="hdr"
+              check_it="true"
+              occurence="2"
+              assign_to="2"/>
+      </action>
+  </recv>
+  <Reference variables="1,2" />
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 180 Ringing
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Route: <sip:localhost:5062;lr>,<sip:P1.EXAMPLEVISITED.COM;lr>
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Route: <sip:localhost:5062;lr>,<sip:P1.EXAMPLEVISITED.COM;lr>
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      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 [media_port] RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv request="ACK"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: ua1 <sip:ua1@[local_ip]:[local_port]>;tag=[pid]SIPpTag01[call_number]
+      To: [$remote]
+      [last_Call-ID:]
+      CSeq: [cseq] BYE
+      Contact: ua1 <sip:ua1@[local_ip]:[local_port]>
+      Route: <sip:localhost:5062;lr>,<sip:P1.EXAMPLEVISITED.COM;lr>
+      Max-Forwards: 70
+      Subject: Path Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200">
+  </recv>
+
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_invite_recv.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_invite_recv.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_invite_recv.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_register.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_register.xml?view=auto&rev=4623
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_register.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_register.xml Thu Jan 30 14:04:03 2014
@@ -1,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="UA1 Registers with Path">
+    <send retrans="500">
+        <![CDATA[
+
+        REGISTER sip:ua1@[remote_ip]:[remote_port] SIP/2.0
+        Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+        From: ua1 <sip:ua1@[local_ip]:[local_port]>;tag=[pid][call_number]
+        To: <sip:ua1@[remote_ip]:[remote_port]>
+        Call-ID: [call_id]
+        CSeq: 1 REGISTER
+        Contact: sip:ua1@[local_ip]:[local_port]
+        Max-Forwards: 70
+        Subject: Path Test
+        Expires: 3600
+        Supported: path
+        Path: <sip:localhost:5062;lr>,<sip:P1.EXAMPLEVISITED.COM;lr>
+        Content-Length: 0
+
+        ]]>
+    </send>
+
+    <recv response="200" rtd="true">
+         <action>
+            <ereg regexp=".*<sip:localhost:5062;lr>,<sip:P1.EXAMPLEVISITED.COM;lr>.*"
+                search_in="hdr" header="Path:" check_it="true" assign_to="1"/>
+            <ereg regexp=".*path.*"
+                search_in="hdr" header="Supported:" check_it="true" assign_to="2"/>
+         </action>
+    </recv>
+
+    <Reference variables="1,2"/>
+</scenario>

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_register.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_register.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/sipp/ua1_register.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/test-config.yaml?view=auto&rev=4623
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/test-config.yaml Thu Jan 30 14:04:03 2014
@@ -1,0 +1,45 @@
+testinfo:
+    summary:     'PJSIP Path Support'
+    description: |
+        'This test verifies SIP path support for chan_pjsip. It tests two scenarios:
+        1. It checks that the Path headers are parsed out of a REGISTER request
+           and sent back in the 200 Route header. It also checks that a
+           subsequent INVITE request sent to the UA contains the path
+           information in the Route headers.
+        2. If enabled globally, it verifies that an outbound REGISTER request
+           indicates support for Path so that intervening proxies can do their
+           magic.
+
+properties:
+    minversion: '12.1.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - app : 'sipp'
+        - asterisk : 'res_pjsip'
+        - asterisk : 'res_pjsip_path'
+    tags:
+        - pjsip
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            config-section: originator-ua1_invite_recv
+            typename: 'PluggableModules.Originator'
+
+originator-ua1_invite_recv:
+    trigger: 'ami_connect'
+
+sipp-config:
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'ua1_register.xml', '-p': '5062',},}
+                - { 'key-args': {'scenario': 'registrar.xml', '-p': '5063',},}
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'ua1_invite_recv.xml', '-p': '5062',},}

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/path/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/tests.yaml?view=diff&rev=4623&r1=4622&r2=4623
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/tests.yaml (original)
+++ asterisk/trunk/tests/channels/pjsip/registration/inbound/nominal/tests.yaml Thu Jan 30 14:04:03 2014
@@ -5,3 +5,4 @@
     - dir: 'multiple_contacts'
     - dir: 'single_contact'
     - dir: 'unregister'
+    - test: 'path'




More information about the asterisk-commits mailing list