[asterisk-commits] kmoore: testsuite/asterisk/trunk r4787 - in /asterisk/trunk/tests/channels/SI...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 5 07:52:44 CST 2014


Author: kmoore
Date: Wed Mar  5 07:52:38 2014
New Revision: 4787

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4787
Log:
Testsuite: Add test for direct RTP reinvite failure

This adds a test for the scenario where Asterisk attempts to initiate a
remote RTP native bridge, but one side declines and hangs up. This
could previously cause a crash in Asterisk 1.8 and 11.

(closes issue ASTERISK-23310)
Review: https://reviewboard.asterisk.org/r/3297/

Added:
    asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/
    asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/
    asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/
    asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/
    asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-no-reinvite.xml   (with props)
    asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-reinvite.xml   (with props)
    asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/SIP/tests.yaml

Added: asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/extensions.conf?view=auto&rev=4787
==============================================================================
--- asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/extensions.conf Wed Mar  5 07:52:38 2014
@@ -1,0 +1,4 @@
+[default]
+exten => s,1,NoOp()
+same => n,Dial(SIP/no_reinvite,,g)
+same => n,Playback(demo-instruct)

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

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

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

Added: asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/sip.conf?view=auto&rev=4787
==============================================================================
--- asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/configs/ast1/sip.conf Wed Mar  5 07:52:38 2014
@@ -1,0 +1,12 @@
+[general]
+[no_reinvite]
+host=127.0.0.1
+port=5065
+type=friend
+insecure=invite
+
+[reinvite]
+host=127.0.0.1
+port=5066
+type=friend
+insecure=invite

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

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

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

Added: asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-no-reinvite.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-no-reinvite.xml?view=auto&rev=4787
==============================================================================
--- asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-no-reinvite.xml (added)
+++ asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-no-reinvite.xml Wed Mar  5 07:52:38 2014
@@ -1,0 +1,108 @@
+<?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 native bridging preventing reinvites">
+  <Global variables="remote_tag" />
+  <recv request="INVITE" crlf="true">
+      <action>
+          <!-- 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>
+
+  <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:]
+      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 request="INVITE" crlf="true" />
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 500 Direct Media Reinvite Denied
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Type: application/sdp
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv request="ACK" rtd="true" crlf="true" />
+
+  <pause />
+
+  <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]
+      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/direct_rtp_fallback/sipp/uas-no-reinvite.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-no-reinvite.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-no-reinvite.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-reinvite.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-reinvite.xml?view=auto&rev=4787
==============================================================================
--- asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-reinvite.xml (added)
+++ asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-reinvite.xml Wed Mar  5 07:52:38 2014
@@ -1,0 +1,129 @@
+<?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 native bridging preventing reinvites">
+  <recv request="INVITE" crlf="true" />
+
+  <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:]
+      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 request="INVITE" crlf="true" />
+
+  <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:]
+      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 request="INVITE" crlf="true" />
+
+  <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:]
+      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 request="BYE" rtd="true" crlf="true" />
+
+  <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:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <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/direct_rtp_fallback/sipp/uas-reinvite.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-reinvite.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/sipp/uas-reinvite.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/test-config.yaml?view=auto&rev=4787
==============================================================================
--- asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/test-config.yaml Wed Mar  5 07:52:38 2014
@@ -1,0 +1,40 @@
+testinfo:
+    summary:     'Basic direct media reinvite fallback test'
+    description: |
+        "This test verifies that Asterisk will fall back to P2P bridging if a direct media reinvite fails and checks for conditions where such an event fails to clean up properly."
+
+properties:
+    minversion: '1.8.27.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - app : 'sipp'
+        - asterisk : 'chan_sip'
+    tags:
+        - SIP
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            config-section: originator-config
+            typename: 'pluggable_modules.Originator'
+
+sipp-config:
+    reactor-timeout: 90
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'uas-no-reinvite.xml', '-p': '5065'} }
+                - { 'key-args': {'scenario': 'uas-reinvite.xml', '-p': '5066'},
+                    'ordered-args': ['-rtp_echo'] }
+
+originator-config:
+    channel: 'SIP/reinvite'
+    context: 'default'
+    exten: 's'
+    priority: '1'
+    trigger: 'ami_connect'

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

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

Propchange: asterisk/trunk/tests/channels/SIP/direct_rtp_fallback/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=4787&r1=4786&r2=4787
==============================================================================
--- asterisk/trunk/tests/channels/SIP/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/tests.yaml Wed Mar  5 07:52:38 2014
@@ -64,3 +64,4 @@
     - dir: 'register_forbidden_retry'
     - test: 'outbound_register_from'
     - test: 'outbound_reregister_from'
+    - test: 'direct_rtp_fallback'




More information about the asterisk-commits mailing list