[svn-commits] mmichelson: testsuite/asterisk/trunk r6364 - in /asterisk/trunk/tests/channel...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jan 30 12:10:48 CST 2015


Author: mmichelson
Date: Fri Jan 30 12:10:39 2015
New Revision: 6364

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6364
Log:
Add test to ensure no channel is leaked if we receive a REINVITE from a channel that performs a transfer.

This test has a SIPp scenario perform a blind transfer that fails. Upon receiving the failure notification,
the SIPp scenario sends a reinvite to Asterisk. The test ensures that this reinvite does not cause the
creation of a new channel by ensuring that the channel count after the test completes is zero.

Review: https://reviewboard.asterisk.org/r/4343


Added:
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/tests.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/sipp/
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/sipp/transferer.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/test-config.yaml   (with props)

Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/tests.yaml?view=auto&rev=6364
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/tests.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/tests.yaml Fri Jan 30 12:10:39 2015
@@ -1,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'transferer_reinvite'

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/extensions.conf?view=auto&rev=6364
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/extensions.conf Fri Jan 30 12:10:39 2015
@@ -1,0 +1,10 @@
+[default]
+
+exten => echo,1,Answer()
+same => n,Echo()
+same => n,Hangup()
+
+exten => call-sipp,1,Dial(PJSIP/sipp)
+same => n,Hangup()
+
+exten => bad_exten,1,NoOp()

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/pjsip.conf?view=auto&rev=6364
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/pjsip.conf Fri Jan 30 12:10:39 2015
@@ -1,0 +1,14 @@
+[main-transport]
+type = transport
+protocol = udp
+bind = 127.0.0.1
+
+[sipp]
+type = endpoint
+context = default
+allow = ulaw
+aors = sipp
+
+[sipp]
+type = aor
+contact = sip:sipp at 127.0.0.1:5061

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/sipp/transferer.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/sipp/transferer.xml?view=auto&rev=6364
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/sipp/transferer.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/sipp/transferer.xml Fri Jan 30 12:10:39 2015
@@ -1,0 +1,185 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+<scenario name="transferer">
+  <Global variables="remote_tag" />
+  <recv request="INVITE" crlf="true">
+      <!-- Save the from tag. We'll need it when we send our BYE -->
+      <action>
+          <ereg regexp="(;tag=.*)"
+              header="From:"
+              search_in="hdr"
+              check_it="true"
+              assign_to="remote_tag"/>
+	  </action>
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 180 Ringing
+      [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>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag00[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>
+
+  <pause milliseconds="2000" />
+
+  <!-- Blind transfer this sucker to the transfer_target -->
+  <send retrans="500">
+    <![CDATA[
+
+      REFER sip:sipp@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]:[remote_port]>[$remote_tag]
+      Call-ID: [call_id]
+      CSeq: [cseq] REFER
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Refer-To: sip:bad_exten@[remote_ip]:[remote_port];user=phone
+      Referred-By: sip:sipp@[local_ip]:[local_port]
+      Content-Length: 0
+
+    ]]>
+
+  </send>
+
+  <recv response="202" rtd="true">
+  </recv>
+
+  <!-- We should receive two NOTIFYs from Asterisk. One will be a 180 ringing sipfrag -->
+  <!-- and the other will be a 503 sipfrag -->
+  <recv request="NOTIFY" crlf="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      [last_Event:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+    ]]>
+  </send>
+
+  <recv request="NOTIFY" crlf="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      [last_Event:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:sipp@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sip:sipp@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:sipp@[remote_ip]:[remote_port]>[$remote_tag]
+      Call-ID: [call_id]
+      CSeq: [cseq] INVITE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance 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 [media_port] RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+    ]]>
+  </send>
+
+  <recv response="200" crlf="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      ACK sip:sipp@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port]
+      From: sip:sipp@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:sipp@[remote_ip]:[remote_port]>[$remote_tag]
+      Contact: sip:[service]@[local_ip]:[local_port]
+      Call-ID: [call_id]
+      CSeq: [cseq] ACK
+      Max-Forwards: 70
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv request="BYE" timeout="5000"/>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      [last_Event:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+    ]]>
+  </send>
+</scenario>
+

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/sipp/transferer.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/sipp/transferer.xml
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/sipp/transferer.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/test-config.yaml?view=auto&rev=6364
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/test-config.yaml Fri Jan 30 12:10:39 2015
@@ -1,0 +1,51 @@
+testinfo:
+    summary: "Ensure that an ill-timed reinvite does not result in a stuck channel"
+    description: |
+        'Asterisk originates a call to a Local channel that runs Echo. The other half of
+        the local channel is placed into the dialplan and calls a SIPp scenario. The SIPp
+        scenario answers the call and then performs a blind transfer to an extension that
+        immediately hangs up. The SIPp scenario, upon receiving a NOTIFY that the blind
+        transfer has failed, sends a reinvite to Asterisk. Asterisk should respond to this
+        reinvite with a 200 OK and then immediately send a BYE. The channel test condition
+        is used to ensure that there are no active channels once the test concludes.'
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: sipp.SIPpTestCase
+    modules:
+        -
+            config-section: originator-config
+            typename: pluggable_modules.Originator
+
+sipp-config:
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'transferer.xml', '-i': '127.0.0.1', '-p': '5061' }}
+
+originator-config:
+    channel: 'Local/echo at default'
+    context: 'default'
+    exten: 'call-sipp'
+    priority: '1'
+    trigger: 'scenario_start'
+    scenario-name: 'transferer.xml'
+
+
+properties:
+    minversion: '13.2.0'
+    dependencies:
+        - sipp:
+            version: 'v3.0'
+        - asterisk: 'res_pjsip'
+        - asterisk: 'res_pjsip_session'
+        - asterisk: 'res_pjsip_refer'
+        - asterisk: 'chan_pjsip'
+        - asterisk: 'app_dial'
+        - asterisk: 'app_echo'
+    tags:
+        - pjsip
+    testconditions:
+        -
+            name: 'channels'

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = 'Author Date Id Revision'

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/off_nominal/transferer_reinvite/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the svn-commits mailing list