[asterisk-commits] wdoekes: testsuite/asterisk/trunk r3242 - in /asterisk/trunk/tests/channels/S...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed May 30 10:35:33 CDT 2012
Author: wdoekes
Date: Wed May 30 10:35:27 2012
New Revision: 3242
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3242
Log:
Add test to ensure that you're not allowed to set up a SIP call with a to-tag.
Review: https://reviewboard.asterisk.org/r/1918/
Reviewed by: Mark Michelson
Added:
asterisk/trunk/tests/channels/SIP/invite_no_totag/
asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/
asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/
asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/sip.conf (with props)
asterisk/trunk/tests/channels/SIP/invite_no_totag/run-test (with props)
asterisk/trunk/tests/channels/SIP/invite_no_totag/sipp/
asterisk/trunk/tests/channels/SIP/invite_no_totag/sipp/call.xml (with props)
asterisk/trunk/tests/channels/SIP/invite_no_totag/test-config.yaml (with props)
Modified:
asterisk/trunk/tests/channels/SIP/tests.yaml
Added: asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/extensions.conf?view=auto&rev=3242
==============================================================================
--- asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/extensions.conf Wed May 30 10:35:27 2012
@@ -1,0 +1,4 @@
+[default]
+exten => _X!,1,Answer()
+exten => _X!,n,Wait(1)
+exten => _X!,n,Hangup()
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = wdoekes 2012-05-30 1 1
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/sip.conf?view=auto&rev=3242
==============================================================================
--- asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/sip.conf Wed May 30 10:35:27 2012
@@ -1,0 +1,4 @@
+[general]
+allowguest=yes
+udpbindaddr=127.0.0.1
+pedantic=yes
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:keywords = wdoekes 2012-05-30 1 1
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/invite_no_totag/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/invite_no_totag/run-test?view=auto&rev=3242
==============================================================================
--- asterisk/trunk/tests/channels/SIP/invite_no_totag/run-test (added)
+++ asterisk/trunk/tests/channels/SIP/invite_no_totag/run-test Wed May 30 10:35:27 2012
@@ -1,0 +1,31 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2012, Digium, Inc.
+Walter Doekes <walter+asterisk at wjd.nu>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+import os, sys
+
+sys.path.append('lib/python')
+
+from twisted.internet import reactor
+from asterisk.sipp import SIPpTest
+
+TEST_DIR = os.path.dirname(os.path.realpath(__file__))
+SIPP_SCENARIOS = [{'scenario': 'call.xml'}]
+
+
+def main():
+ test = SIPpTest('UNUSED_PARAMETER', TEST_DIR, SIPP_SCENARIOS)
+ reactor.run()
+ if not test.passed:
+ return 1
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
+
+# vim:sw=4:ts=4:expandtab:textwidth=79
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/run-test
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/run-test
------------------------------------------------------------------------------
svn:executable = *
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/run-test
------------------------------------------------------------------------------
svn:keywords = wdoekes 2012-05-30 1 1
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/run-test
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/invite_no_totag/sipp/call.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/invite_no_totag/sipp/call.xml?view=auto&rev=3242
==============================================================================
--- asterisk/trunk/tests/channels/SIP/invite_no_totag/sipp/call.xml (added)
+++ asterisk/trunk/tests/channels/SIP/invite_no_totag/sipp/call.xml Wed May 30 10:35:27 2012
@@ -1,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<scenario name="Do an INVITE with a to-tag and expect failure, Walter Doekes 2012">
+ <label id="invite"/>
+
+ <send retrans="500" start_txn="invite">
+ <![CDATA[
+
+ INVITE sip:123@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: sip:[service]@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
+ To: sip:123@[remote_ip]:[remote_port];tag=sometag
+ Contact: sip:[service]@[local_ip]:[local_port]
+ Call-ID: [call_id]
+ CSeq: [cseq] INVITE
+ Max-Forwards: 70
+ 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 8 0
+ a=rtpmap:8 PCMA/8000
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv response="100" optional="true" response_txn="invite"/>
+
+ <recv response="481" response_txn="invite"/>
+
+ <send ack_txn="invite">
+ <![CDATA[
+
+ ACK sip:123@[remote_ip]:[remote_port] SIP/2.0
+ [last_Via:]
+ [routes]
+ [last_From:]
+ [last_To:]
+ Contact: sip:[service]@[local_ip]:[local_port]
+ Call-ID: [call_id]
+ CSeq: [cseq] ACK
+ Max-Forwards: 70
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+</scenario>
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/sipp/call.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/sipp/call.xml
------------------------------------------------------------------------------
svn:keywords = wdoekes 2012-05-30 1 1
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/sipp/call.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/invite_no_totag/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/invite_no_totag/test-config.yaml?view=auto&rev=3242
==============================================================================
--- asterisk/trunk/tests/channels/SIP/invite_no_totag/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/invite_no_totag/test-config.yaml Wed May 30 10:35:27 2012
@@ -1,0 +1,16 @@
+testinfo:
+ summary: 'Ensure that initial INVITE requests are not allowed to contain a To tag'
+ description: |
+ 'It is not a good idea to accept initial INVITEs with a To tag.
+ Proxies commonly use the presence of this tag to distinguish initial
+ from in-dialog requests, where in-dialog requests face less scrutiny.'
+
+properties:
+ minversion: '1.4'
+ dependencies:
+ - python: 'twisted'
+ - sipp:
+ version: 'v3.1'
+ tags:
+ - SIP
+
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = wdoekes 2012-05-30 1 1
Propchange: asterisk/trunk/tests/channels/SIP/invite_no_totag/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=3242&r1=3241&r2=3242
==============================================================================
--- asterisk/trunk/tests/channels/SIP/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/tests.yaml Wed May 30 10:35:27 2012
@@ -43,3 +43,4 @@
- test: 'generic_ccss'
- test: 'hangupcause'
- test: 'sip_cause'
+ - test: 'invite_no_totag'
More information about the asterisk-commits
mailing list