[asterisk-commits] russell: testsuite/asterisk/trunk r1612 - in /asterisk/trunk: ./ lib/python/a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 2 17:20:59 CDT 2011


Author: russell
Date: Thu Jun  2 17:20:54 2011
New Revision: 1612

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1612
Log:
Add 4 new tests related to SIP MESSAGE handling.

message_diabled - check response to MESSAGE when out of call messages
                  are disabled

message_unauth - Pass through MESSAGE without authentication

message_auth - Pass through MESSAGE with authentication

message_from_call - Send a MESSAGE to another party from dialplan being
                    executed as the result from a normal call

Added:
    asterisk/trunk/tests/channels/SIP/message_auth/
    asterisk/trunk/tests/channels/SIP/message_auth/configs/
    asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/
    asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/message_auth/configs/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/message_auth/run-test   (with props)
    asterisk/trunk/tests/channels/SIP/message_auth/sipp/
    asterisk/trunk/tests/channels/SIP/message_auth/sipp/message.xml   (with props)
    asterisk/trunk/tests/channels/SIP/message_auth/sipp/message_recv.xml   (with props)
    asterisk/trunk/tests/channels/SIP/message_auth/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/SIP/message_disabled/
    asterisk/trunk/tests/channels/SIP/message_disabled/configs/
    asterisk/trunk/tests/channels/SIP/message_disabled/configs/ast1/
    asterisk/trunk/tests/channels/SIP/message_disabled/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/message_disabled/run-test   (with props)
    asterisk/trunk/tests/channels/SIP/message_disabled/sipp/
    asterisk/trunk/tests/channels/SIP/message_disabled/sipp/message.xml   (with props)
    asterisk/trunk/tests/channels/SIP/message_disabled/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/SIP/message_from_call/
    asterisk/trunk/tests/channels/SIP/message_from_call/configs/
    asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/
    asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/message_from_call/run-test   (with props)
    asterisk/trunk/tests/channels/SIP/message_from_call/sipp/
    asterisk/trunk/tests/channels/SIP/message_from_call/sipp/call.xml   (with props)
    asterisk/trunk/tests/channels/SIP/message_from_call/sipp/message_recv.xml   (with props)
    asterisk/trunk/tests/channels/SIP/message_from_call/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/SIP/message_unauth/
    asterisk/trunk/tests/channels/SIP/message_unauth/configs/
    asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/
    asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/message_unauth/run-test   (with props)
    asterisk/trunk/tests/channels/SIP/message_unauth/sipp/
    asterisk/trunk/tests/channels/SIP/message_unauth/sipp/message.xml   (with props)
    asterisk/trunk/tests/channels/SIP/message_unauth/sipp/message_recv.xml   (with props)
    asterisk/trunk/tests/channels/SIP/message_unauth/test-config.yaml   (with props)
Modified:
    asterisk/trunk/README.txt
    asterisk/trunk/lib/python/asterisk/sipp.py
    asterisk/trunk/tests/channels/SIP/tests.yaml

Modified: asterisk/trunk/README.txt
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/README.txt?view=diff&rev=1612&r1=1611&r2=1612
==============================================================================
--- asterisk/trunk/README.txt (original)
+++ asterisk/trunk/README.txt Thu Jun  2 17:20:54 2011
@@ -3,7 +3,7 @@
 ===                           Asterisk Test Suite                            ===
 ===                                                                          ===
 ===                         http://www.asterisk.org/                         ===
-===                      Copyright (C) 2010, Digium, Inc.                    ===
+===                  Copyright (C) 2010 - 2011, Digium, Inc.                 ===
 ===                                                                          ===
 ================================================================================
 

Modified: asterisk/trunk/lib/python/asterisk/sipp.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/sipp.py?view=diff&rev=1612&r1=1611&r2=1612
==============================================================================
--- asterisk/trunk/lib/python/asterisk/sipp.py (original)
+++ asterisk/trunk/lib/python/asterisk/sipp.py Thu Jun  2 17:20:54 2011
@@ -91,6 +91,7 @@
             sipp_args.extend([ key, val ])
 
         print "Executing SIPp scenario: %s" % scenario['scenario']
+        print sipp_args
 
         return subprocess.Popen(sipp_args,
                                 stdout=subprocess.PIPE, stderr=subprocess.PIPE)

Added: asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/extensions.conf?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/extensions.conf Thu Jun  2 17:20:54 2011
@@ -1,0 +1,10 @@
+[default]
+
+exten => _.,1,NoOp(ERROR: THIS SHOULD NOT BE EXECUTED)
+
+[not_default]
+
+exten => _.,1,NoOp()
+
+exten => user,1,Verbose(1,Got a message from SIPp)
+exten => user,n,MessageSend(sip:user2)

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/sip.conf?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/sip.conf Thu Jun  2 17:20:54 2011
@@ -1,0 +1,20 @@
+[general]
+
+accept_outofcall_message = yes
+auth_message_requests = yes
+
+[user]
+type=peer
+host=127.0.0.1
+port=5061
+context=not_default
+secret=blah
+
+[user2]
+type=peer
+host=127.0.0.1
+port=5062
+context=not_default
+username=user2
+secret=blah
+

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_auth/configs/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_auth/configs/sip.conf?view=auto&rev=1612
==============================================================================
    (empty)

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/configs/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/configs/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/configs/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_auth/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_auth/run-test?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_auth/run-test (added)
+++ asterisk/trunk/tests/channels/SIP/message_auth/run-test Thu Jun  2 17:20:54 2011
@@ -1,0 +1,44 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+Russell Bryant <russell at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import os
+
+sys.path.append("lib/python")
+from asterisk.sipp import SIPpTest
+
+
+WORKING_DIR = "/tmp/asterisk-testsuite/sip/message_auth"
+TEST_DIR = os.path.dirname(os.path.realpath(__file__))
+
+SIPP_SCENARIOS = [
+    {
+        'scenario' : 'message_recv.xml',
+        '-p' : '5062'
+    },
+    {
+        'scenario' : 'message.xml',
+        '-p' : '5061'
+    }
+]
+
+
+def main(argv=None):
+    if argv is None:
+        argv = sys.argv
+
+    test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)
+    return test.run()
+
+
+if __name__ == "__main__":
+    sys.exit(main())
+
+
+# vim:sw=4:ts=4:expandtab:textwidth=79

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_auth/sipp/message.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_auth/sipp/message.xml?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_auth/sipp/message.xml (added)
+++ asterisk/trunk/tests/channels/SIP/message_auth/sipp/message.xml Thu Jun  2 17:20:54 2011
@@ -1,0 +1,48 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="MESSAGE with auth">
+  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
+  <!-- generated by sipp. To do so, use [call_id] keyword.                -->
+  <send retrans="500">
+    <![CDATA[
+      MESSAGE sip:user@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: user <sip:user@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:user@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 MESSAGE
+      Contact: sip:user@[local_ip]:[local_port]
+      Max-Forwards: 20
+      Expires: 3600
+      Content-Type: text/plain
+      Content-Length: 18
+
+      Watson, come here.
+
+    ]]>
+  </send>
+
+  <recv response="401" auth="true" rtd="true"/>
+
+  <send retrans="500">
+    <![CDATA[
+      MESSAGE sip:user@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      Max-Forwards: 20
+      From: user <sip:user@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:user@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 2 MESSAGE
+      Contact: sip:user@[local_ip]:[local_port]
+      Expires: 3600
+      [authentication username=user password=blah]
+      Content-Type: text/plain
+      Content-Length: 18
+
+      Watson, come here.
+
+    ]]>
+  </send>
+
+  <recv response="202" rtd="true" />
+</scenario>

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/sipp/message.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/sipp/message.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/sipp/message.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_auth/sipp/message_recv.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_auth/sipp/message_recv.xml?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_auth/sipp/message_recv.xml (added)
+++ asterisk/trunk/tests/channels/SIP/message_auth/sipp/message_recv.xml Thu Jun  2 17:20:54 2011
@@ -1,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Basic MESSAGE send and receive">
+  <recv request="MESSAGE" crlf="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+      SIP/2.0 401 Unauthorized
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      WWW-Authenticate: digest realm="test",stale=true
+
+    ]]>
+  </send>
+
+  <recv request="MESSAGE" crlf="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+      SIP/2.0 202 Accepted
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
+      Supported: replaces, timer
+      Content-Length: 0
+
+    ]]>
+  </send>
+</scenario>

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/sipp/message_recv.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/sipp/message_recv.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/sipp/message_recv.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_auth/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_auth/test-config.yaml?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_auth/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/message_auth/test-config.yaml Thu Jun  2 17:20:54 2011
@@ -1,0 +1,11 @@
+testinfo:
+    summary: 'Test inbound and outbound unauthenticated MESSAGE'
+    description: |
+        'Send Asterisk a MESSAGE and wait for Asterisk to send it back.'
+
+properties:
+    minversion: '1.10'
+    dependencies:
+        - sipp :
+            version : 'v3.0'
+            feature : 'TLS'

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_auth/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_disabled/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_disabled/configs/ast1/sip.conf?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_disabled/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/message_disabled/configs/ast1/sip.conf Thu Jun  2 17:20:54 2011
@@ -1,0 +1,3 @@
+[general]
+
+accept_outofcall_message = no

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_disabled/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_disabled/run-test?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_disabled/run-test (added)
+++ asterisk/trunk/tests/channels/SIP/message_disabled/run-test Thu Jun  2 17:20:54 2011
@@ -1,0 +1,39 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+Russell Bryant <russell at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import os
+
+sys.path.append("lib/python")
+from asterisk.sipp import SIPpTest
+
+
+WORKING_DIR = "/tmp/asterisk-testsuite/sip/message_disabled"
+TEST_DIR = os.path.dirname(os.path.realpath(__file__))
+
+SIPP_SCENARIOS = [
+    {
+        'scenario' : 'message.xml',
+    }
+]
+
+
+def main(argv=None):
+    if argv is None:
+        argv = sys.argv
+
+    test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)
+    return test.run()
+
+
+if __name__ == "__main__":
+    sys.exit(main())
+
+
+# vim:sw=4:ts=4:expandtab:textwidth=79

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_disabled/sipp/message.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_disabled/sipp/message.xml?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_disabled/sipp/message.xml (added)
+++ asterisk/trunk/tests/channels/SIP/message_disabled/sipp/message.xml Thu Jun  2 17:20:54 2011
@@ -1,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Basic MESSAGE send and receive">
+  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
+  <!-- generated by sipp. To do so, use [call_id] keyword.                -->
+  <send retrans="500">
+    <![CDATA[
+
+      MESSAGE sip:user@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: user <sip:user@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:user@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 MESSAGE
+      Contact: sip:user@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Expires: 3600
+      Content-Type: text/plain
+      Content-Length: 18
+
+      Watson, come here.
+
+    ]]>
+  </send>
+
+  <recv response="405" rtd="true" />
+</scenario>

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/sipp/message.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/sipp/message.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/sipp/message.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_disabled/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_disabled/test-config.yaml?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_disabled/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/message_disabled/test-config.yaml Thu Jun  2 17:20:54 2011
@@ -1,0 +1,9 @@
+testinfo:
+    summary: 'Test response to MESSAGE when out-of-call MESSAGE is disabled (or not supported)'
+    description: |
+        'Send Asterisk a MESSAGE and expect that it gets denied'
+
+properties:
+    minversion: '1.10'
+    dependencies:
+        - app : 'sipp'

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_disabled/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/extensions.conf?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/extensions.conf Thu Jun  2 17:20:54 2011
@@ -1,0 +1,8 @@
+[default]
+
+exten => _.,1,NoOp()
+
+exten => test,1,Answer()
+exten => test,n,Set(MESSAGE(body)=I like waffles.)
+exten => test,n,MessageSend(sip:user at 127.0.0.1:5062)
+exten => test,n,Wait(30) ; SIPp will hang up.

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/sip.conf?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/sip.conf Thu Jun  2 17:20:54 2011
@@ -1,0 +1,3 @@
+[general]
+
+allowguest=yes

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_from_call/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_from_call/run-test?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_from_call/run-test (added)
+++ asterisk/trunk/tests/channels/SIP/message_from_call/run-test Thu Jun  2 17:20:54 2011
@@ -1,0 +1,44 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+Russell Bryant <russell at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import os
+
+sys.path.append("lib/python")
+from asterisk.sipp import SIPpTest
+
+
+WORKING_DIR = "/tmp/asterisk-testsuite/sip/message_from_call"
+TEST_DIR = os.path.dirname(os.path.realpath(__file__))
+
+SIPP_SCENARIOS = [
+    {
+        'scenario' : 'message_recv.xml',
+        '-p' : '5062'
+    },
+    {
+        'scenario' : 'call.xml',
+        '-p' : '5061'
+    }
+]
+
+
+def main(argv=None):
+    if argv is None:
+        argv = sys.argv
+
+    test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)
+    return test.run()
+
+
+if __name__ == "__main__":
+    sys.exit(main())
+
+
+# vim:sw=4:ts=4:expandtab:textwidth=79

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_from_call/sipp/call.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_from_call/sipp/call.xml?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_from_call/sipp/call.xml (added)
+++ asterisk/trunk/tests/channels/SIP/message_from_call/sipp/call.xml Thu Jun  2 17:20:54 2011
@@ -1,0 +1,95 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Channel Test">
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: test1 <sip:wienerschnitzel@[local_ip]:[local_port]>;tag=[call_number]
+      To: test <sip:test@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 INVITE
+      Contact: sip:kartoffelsalat@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      User-Agent: Channel Param Test
+      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 6000 RTP/AVP 0 101
+      a=rtpmap:0 PCMU/8000
+      a=rtpmap:101 telephone-event/8000
+      m=video 6002 RTP/AVP 34
+      a=rtpmap:34 H263/90000
+
+    ]]>
+  </send>
+
+  <recv response="100"
+        optional="true">
+  </recv>
+
+  <recv response="180" optional="true">
+  </recv>
+
+  <recv response="183" optional="true">
+  </recv>
+
+  <recv response="200" rtd="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      ACK sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: test1 <sip:wienerschnitzel@[local_ip]:[local_port]>;tag=[call_number]
+      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 1 ACK
+      Contact: sip:kartoffelsalat@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <!-- Pause long enough for our test to run -->
+  <pause milliseconds="4000" />
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: test1 <sip:wienerschnitzel@[local_ip]:[local_port]>;tag=[call_number]
+      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 2 BYE
+      Contact: sip:kartoffelsalat@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200" crlf="true">
+  </recv>
+
+  <!-- definition of the response time repartition table (unit is ms)   -->
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <!-- definition of the call length repartition table (unit is ms)     -->
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/sipp/call.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/sipp/call.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/sipp/call.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_from_call/sipp/message_recv.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_from_call/sipp/message_recv.xml?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_from_call/sipp/message_recv.xml (added)
+++ asterisk/trunk/tests/channels/SIP/message_from_call/sipp/message_recv.xml Thu Jun  2 17:20:54 2011
@@ -1,0 +1,21 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Basic MESSAGE send and receive">
+  <recv request="MESSAGE" crlf="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+      SIP/2.0 202 Accepted
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
+      Supported: replaces, timer
+      Content-Length: 0
+
+    ]]>
+  </send>
+</scenario>

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/sipp/message_recv.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/sipp/message_recv.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/sipp/message_recv.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_from_call/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_from_call/test-config.yaml?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_from_call/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/message_from_call/test-config.yaml Thu Jun  2 17:20:54 2011
@@ -1,0 +1,10 @@
+testinfo:
+    summary: 'Test sending a MESSAGE while processing a call.'
+    description: |
+        'Set up a call with Asterisk and send an out-of-call SIP MESSAGE
+         from the dialplan processing that call.'
+
+properties:
+    minversion: '1.10'
+    dependencies:
+        - app : 'sipp'

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_from_call/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/extensions.conf?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/extensions.conf Thu Jun  2 17:20:54 2011
@@ -1,0 +1,9 @@
+[default]
+
+exten => _.,1,NoOp()
+
+exten => user,1,Verbose(1,Got a message from SIPp)
+exten => user,n,Verbose(1,To: ${MESSAGE(to)})
+exten => user,n,Verbose(1,From: ${MESSAGE(from)})
+exten => user,n,Verbose(1,Body: ${MESSAGE(body)})
+exten => user,n,MessageSend(sip:user at 127.0.0.1:5062)

Propchange: asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/sip.conf?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/sip.conf Thu Jun  2 17:20:54 2011
@@ -1,0 +1,4 @@
+[general]
+
+accept_outofcall_message = yes
+auth_message_requests = no

Propchange: asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_unauth/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_unauth/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_unauth/run-test?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_unauth/run-test (added)
+++ asterisk/trunk/tests/channels/SIP/message_unauth/run-test Thu Jun  2 17:20:54 2011
@@ -1,0 +1,44 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+Russell Bryant <russell at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import os
+
+sys.path.append("lib/python")
+from asterisk.sipp import SIPpTest
+
+
+WORKING_DIR = "/tmp/asterisk-testsuite/sip/message_unauth"
+TEST_DIR = os.path.dirname(os.path.realpath(__file__))
+
+SIPP_SCENARIOS = [
+    {
+        'scenario' : 'message_recv.xml',
+        '-p' : '5062'
+    },
+    {
+        'scenario' : 'message.xml',
+        '-p' : '5061'
+    }
+]
+
+
+def main(argv=None):
+    if argv is None:
+        argv = sys.argv
+
+    test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)
+    return test.run()
+
+
+if __name__ == "__main__":
+    sys.exit(main())
+
+
+# vim:sw=4:ts=4:expandtab:textwidth=79

Propchange: asterisk/trunk/tests/channels/SIP/message_unauth/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/message_unauth/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/SIP/message_unauth/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/message_unauth/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/message_unauth/sipp/message.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/message_unauth/sipp/message.xml?view=auto&rev=1612
==============================================================================
--- asterisk/trunk/tests/channels/SIP/message_unauth/sipp/message.xml (added)
+++ asterisk/trunk/tests/channels/SIP/message_unauth/sipp/message.xml Thu Jun  2 17:20:54 2011
@@ -1,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Basic MESSAGE send and receive">
+  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
+  <!-- generated by sipp. To do so, use [call_id] keyword.                -->
+  <send retrans="500">
+    <![CDATA[
+
+      MESSAGE sip:user@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: user <sip:user@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:user@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 MESSAGE
+      Contact: sip:user@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Expires: 3600
+      Content-Type: text/plain

[... 104 lines stripped ...]



More information about the asterisk-commits mailing list