[asterisk-commits] mjordan: testsuite/asterisk/trunk r3658 - in /asterisk/trunk/tests/channels/S...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 5 07:19:35 CST 2013
Author: mjordan
Date: Tue Mar 5 07:19:30 2013
New Revision: 3658
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3658
Log:
Add tests to cover RFC 3327 support in chan_sip
This patch adds a test for the Path header support in chan_sip. It covers two
scenarios:
1. A UA sends a REGISTER request to Asterisk. The test verifies that the Path
header in the request is copied into the 200 OK response and that the response
indicates support for 'path'. It then verifies that a subsequent request sent
to the UA (An INVITE for a new call) contains the path information in the
Route header.
2. If path support is enabled globally, it verifies that outbound REGISTER
requests from Asterisk indicate support for 'path'.
Review: https://reviewboard.asterisk.org/r/2325
(issue ASTERISK-16884)
Added:
asterisk/trunk/tests/channels/SIP/path/
asterisk/trunk/tests/channels/SIP/path/configs/
asterisk/trunk/tests/channels/SIP/path/configs/ast1/
asterisk/trunk/tests/channels/SIP/path/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/channels/SIP/path/configs/ast1/sip.conf (with props)
asterisk/trunk/tests/channels/SIP/path/sipp/
asterisk/trunk/tests/channels/SIP/path/sipp/registrar.xml (with props)
asterisk/trunk/tests/channels/SIP/path/sipp/ua1_invite_recv.xml (with props)
asterisk/trunk/tests/channels/SIP/path/sipp/ua1_register.xml (with props)
asterisk/trunk/tests/channels/SIP/path/test-config.yaml (with props)
Modified:
asterisk/trunk/tests/channels/SIP/tests.yaml
Added: asterisk/trunk/tests/channels/SIP/path/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/path/configs/ast1/extensions.conf?view=auto&rev=3658
==============================================================================
--- asterisk/trunk/tests/channels/SIP/path/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/path/configs/ast1/extensions.conf Tue Mar 5 07:19:30 2013
@@ -1,0 +1,6 @@
+[default]
+
+exten => s,1,NoOp()
+same => n,Answer()
+same => n,Dial(SIP/ua1)
+same => n,Hangup()
Propchange: asterisk/trunk/tests/channels/SIP/path/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/path/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/path/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/path/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/path/configs/ast1/sip.conf?view=auto&rev=3658
==============================================================================
--- asterisk/trunk/tests/channels/SIP/path/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/path/configs/ast1/sip.conf Tue Mar 5 07:19:30 2013
@@ -1,0 +1,9 @@
+[general]
+supportpath = yes
+
+register = asterisk at 127.0.0.1:5063
+
+[ua1]
+host = dynamic
+type = peer
+supportpath = yes
Propchange: asterisk/trunk/tests/channels/SIP/path/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/path/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/path/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/path/sipp/registrar.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/path/sipp/registrar.xml?view=auto&rev=3658
==============================================================================
--- asterisk/trunk/tests/channels/SIP/path/sipp/registrar.xml (added)
+++ asterisk/trunk/tests/channels/SIP/path/sipp/registrar.xml Tue Mar 5 07:19:30 2013
@@ -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:P3.EXAMPLEHOME.COM;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/SIP/path/sipp/registrar.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/path/sipp/registrar.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/path/sipp/registrar.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/path/sipp/ua1_invite_recv.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/path/sipp/ua1_invite_recv.xml?view=auto&rev=3658
==============================================================================
--- asterisk/trunk/tests/channels/SIP/path/sipp/ua1_invite_recv.xml (added)
+++ asterisk/trunk/tests/channels/SIP/path/sipp/ua1_invite_recv.xml Tue Mar 5 07:19:30 2013
@@ -1,0 +1,113 @@
+<?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_tag" />
+ <recv request="INVITE" crlf="true">
+ <action>
+ <ereg regexp=".*<sip:P3.EXAMPLEHOME.COM;lr>,<sip:P1.EXAMPLEVISITED.COM;lr>.*"
+ header="Route:"
+ search_in="hdr"
+ check_it="true"
+ assign_to="1"/>
+ <!-- Save the from tag. We'll need it when we send our BYE -->
+ <ereg regexp=".*(;tag=.*)"
+ header="From:"
+ search_in="hdr"
+ check_it="true"
+ assign_to="remote_tag"/>
+ </action>
+ </recv>
+ <Reference variables="1" />
+
+ <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:P3.EXAMPLEHOME.COM;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:P3.EXAMPLEHOME.COM;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: ua1 <sip:[service]@[remote_ip]:[remote_port]>[$remote_tag]
+ [last_Call-ID:]
+ CSeq: [cseq] BYE
+ Contact: sip:ua1@[local_ip]:[local_port]
+ Route: <sip:P3.EXAMPLEHOME.COM;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/SIP/path/sipp/ua1_invite_recv.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/path/sipp/ua1_invite_recv.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/path/sipp/ua1_invite_recv.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/path/sipp/ua1_register.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/path/sipp/ua1_register.xml?view=auto&rev=3658
==============================================================================
--- asterisk/trunk/tests/channels/SIP/path/sipp/ua1_register.xml (added)
+++ asterisk/trunk/tests/channels/SIP/path/sipp/ua1_register.xml Tue Mar 5 07:19:30 2013
@@ -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:P3.EXAMPLEHOME.COM;lr>,<sip:P1.EXAMPLEVISITED.COM;lr>
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" rtd="true">
+ <action>
+ <ereg regexp=".*<sip:P3.EXAMPLEHOME.COM;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/SIP/path/sipp/ua1_register.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/path/sipp/ua1_register.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/path/sipp/ua1_register.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/path/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/path/test-config.yaml?view=auto&rev=3658
==============================================================================
--- asterisk/trunk/tests/channels/SIP/path/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/path/test-config.yaml Tue Mar 5 07:19:30 2013
@@ -1,0 +1,39 @@
+testinfo:
+ summary: 'SIP Path Support'
+ description: |
+ 'This test verifies SIP Path Support. 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.0.0'
+ dependencies:
+ - python : 'twisted'
+ - python : 'starpy'
+ - app : 'sipp'
+ tags:
+ - SIP
+
+test-modules:
+ test-object:
+ config-section: sipp-config
+ typename: 'sipp.SIPpTestCase'
+ modules:
+ -
+ typename: 'PluggableModules.Originator'
+
+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/SIP/path/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/path/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/path/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/trunk/tests/channels/SIP/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/tests.yaml?view=diff&rev=3658&r1=3657&r2=3658
==============================================================================
--- asterisk/trunk/tests/channels/SIP/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/tests.yaml Tue Mar 5 07:19:30 2013
@@ -55,3 +55,4 @@
- test: 'device_state_notification'
- test: 'directrtpsetup'
- dir: 'session_timers'
+ - test: 'path'
More information about the asterisk-commits
mailing list