[asterisk-commits] kmoore: testsuite/asterisk/trunk r5055 - in /asterisk/trunk: contrib/sipp/ co...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 23 07:29:49 CDT 2014


Author: kmoore
Date: Fri May 23 07:29:39 2014
New Revision: 5055

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5055
Log:
Testsuite: Fix ARI attended transfer test

This reworks a significant portion of the ARI attended transfer test to
avoid dependence on pjsua since it has the tendency to cause sporadic
(and sometimes consistent) test failures. The reworked test uses SIPp
with 3PCC to manage the transfer scenario.

This also adds reference SIPp scenarios used in the transfer setup in
the contrib directory for use by future tests.

(closes isssue ASTERISK-23641)
Review: https://reviewboard.asterisk.org/r/3525/

Added:
    asterisk/trunk/contrib/sipp/transfer/
    asterisk/trunk/contrib/sipp/transfer/referee.xml   (with props)
    asterisk/trunk/contrib/sipp/transfer/referer.xml   (with props)
    asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/
    asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referee.xml   (with props)
    asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referer.xml   (with props)
Modified:
    asterisk/trunk/contrib/sipp/table_of_contents
    asterisk/trunk/tests/rest_api/bridges/attended_transfer/attended_transfer.py
    asterisk/trunk/tests/rest_api/bridges/attended_transfer/test-config.yaml

Modified: asterisk/trunk/contrib/sipp/table_of_contents
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/contrib/sipp/table_of_contents?view=diff&rev=5055&r1=5054&r2=5055
==============================================================================
--- asterisk/trunk/contrib/sipp/table_of_contents (original)
+++ asterisk/trunk/contrib/sipp/table_of_contents Fri May 23 07:29:39 2014
@@ -100,3 +100,24 @@
 * uac-register-unregister.xml
 	This scenario is identical to uac-register.xml, except
 	that the Expires header is set to 0.
+
+=========================================================
+|                     TRANSFER                          |
+=========================================================
+
+* referee.xml
+	This scenario waits for a command from a cooperating
+	SIPp scenario (referer.xml or referer_uas.xml), sends
+	an INVITE, expects a 200 OK in return, sends an ACK to
+	complete the transaction, and then relays call
+	information to a the cooperating SIPp scenario. Use the
+	-3pcc option to control the 3PCC communication port. The
+	value associated with the -3pcc option should be the same
+	for both scenarios (e.g. '-3pcc 127.0.0.1:5064').
+
+* referer.xml
+	This scenario functions as a cooperating counterpart for
+	referee.xml and will initiate its call first. Once its call
+	is up, it will send a command to referee.xml, collect its
+	call information in a return command, and initiate the
+	REFER attended transfer.

Added: asterisk/trunk/contrib/sipp/transfer/referee.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/contrib/sipp/transfer/referee.xml?view=auto&rev=5055
==============================================================================
--- asterisk/trunk/contrib/sipp/transfer/referee.xml (added)
+++ asterisk/trunk/contrib/sipp/transfer/referee.xml Fri May 23 07:29:39 2014
@@ -1,0 +1,127 @@
+<?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             -->
+<!--                                                                    -->
+
+<scenario name="Referee Leg">
+
+  <recvCmd>
+    <action>
+      <ereg regexp="REMOTE(.*)"
+        search_in="hdr"
+        header="Call-ID:"
+        check_it="true"
+        assign_to="1,original_callid" />
+    </action>
+  </recvCmd>
+
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:1000@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
+      To: <sip:transfer@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: [cseq] INVITE
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Max-Forwards: 70
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=- 1324901698 1324901698 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 101
+      a=sendrecv
+      a=rtpmap:0 PCMU/8000
+      a=rtpmap:101 telephone-event/8000
+
+    ]]>
+  </send>
+
+  <recv response="100" optional="true" />
+  <recv response="101" optional="true" />
+  <recv response="180" optional="true" />
+  <recv response="200" rtd="true" crlf="true">
+    <action>
+      <ereg regexp="tag=([[:alnum:].\-]*)"
+        search_in="hdr"
+        header="To:"
+        check_it="true"
+        assign_to="2,to_tag" />
+      <ereg regexp="tag=([[:alnum:].\-]*)"
+        search_in="hdr"
+        header="From:"
+        check_it="true"
+        assign_to="3,from_tag" />
+    </action>
+  </recv>
+  <Reference variables="1,2,3" />
+
+  <send>
+    <![CDATA[
+
+      ACK sip:1000@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+      [last_From:]
+      [last_To]
+      Call-ID: [call_id]
+      CSeq: [cseq] ACK
+      Contact: sip:bob@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <pause milliseconds="1000" />
+  <sendCmd>
+    <![CDATA[
+      Call-ID: [$original_callid]
+      Remote-To-Tag: [$to_tag]
+      Remote-From-Tag: [$from_tag]
+      Remote-URI: sip:1000@[remote_ip]:[remote_port]
+    ]]>
+  </sendCmd>
+
+  <recv request="BYE" />
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Content-Length:0
+
+    ]]>
+  </send>
+
+  <!-- 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/contrib/sipp/transfer/referee.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/contrib/sipp/transfer/referee.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/contrib/sipp/transfer/referee.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/contrib/sipp/transfer/referer.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/contrib/sipp/transfer/referer.xml?view=auto&rev=5055
==============================================================================
--- asterisk/trunk/contrib/sipp/transfer/referer.xml (added)
+++ asterisk/trunk/contrib/sipp/transfer/referer.xml Fri May 23 07:29:39 2014
@@ -1,0 +1,179 @@
+<?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             -->
+<!--                                                                    -->
+
+<scenario name="Referer Leg">
+
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:stasis@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
+      To: <sip:transfer@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: [cseq] INVITE
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Content-Type: application/sdp
+      Max-Forwards: 70
+      Content-Length: [len]
+
+      v=0
+      o=- 1324901698 1324901698 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 101
+      a=sendrecv
+      a=rtpmap:0 PCMU/8000
+      a=rtpmap:101 telephone-event/8000
+
+    ]]>
+  </send>
+
+  <recv response="100" optional="true" />
+  <recv response="101" optional="true" />
+  <recv response="180" optional="true" />
+  <recv response="200" rtd="true" crlf="true" />
+
+  <send>
+    <![CDATA[
+
+      ACK sip:stasis@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+      [last_From:]
+      [last_To]
+      Call-ID: [call_id]
+      CSeq: [cseq] ACK
+      Contact: sip:bob@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <sendCmd>
+    <![CDATA[
+      Call-ID: REMOTE[call_id]
+      Start the Echo Leg
+    ]]>
+  </sendCmd>
+
+  <recvCmd>
+    <action>
+      <ereg regexp=" (.+)"
+        search_in="hdr"
+        header="Remote-URI:"
+        check_it="true"
+        assign_to="1,remote_contact" />
+      <ereg regexp=" (.+)"
+        search_in="hdr"
+        header="Remote-To-Tag:"
+        check_it="true"
+        assign_to="2,remote_to_tag" />
+      <ereg regexp=" (.+)"
+        search_in="hdr"
+        header="Remote-From-Tag:"
+        check_it="true"
+        assign_to="3,remote_from_tag" />
+      <ereg regexp=" (.+)@(.+)"
+        search_in="hdr"
+        header="Call-ID:"
+        check_it="true"
+        assign_to="4,callid_chunk_1,callid_chunk_2"/>
+     </action>
+  </recvCmd>
+  <Reference variables="1,2,3,4" />
+
+  <send>
+    <![CDATA[
+
+      REFER sip:stasis@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      [last_From:]
+      [last_To]
+      [last_Call-ID:]
+      CSeq: [cseq] REFER
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Max-Forwards: 70
+      Refer-to: <[$remote_contact]?Replaces=REMOTE[$callid_chunk_1]%40[$callid_chunk_2]%3Bto-tag%3D[$remote_to_tag]%3Bfrom-tag%3D[$remote_from_tag]>
+      Referred-By: sip:bob@[local_ip]
+      Content-Length: 0
+
+    ]]>
+  </send>
+  <recv response="202" rtd="true" crlf="true" />
+
+  <recv request="NOTIFY" />
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Content-Length:0
+
+    ]]>
+  </send>
+
+  <recv request="NOTIFY" />
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Content-Length:0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:stasis@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
+      To: <sip:transfer@[remote_ip]:[remote_port]>[peer_tag_param]
+      [last_Call-ID:]
+      CSeq: [cseq] BYE
+      Contact: sip:bob@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+  <recv response="200" />
+
+  <!-- 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/contrib/sipp/transfer/referer.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/contrib/sipp/transfer/referer.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/contrib/sipp/transfer/referer.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: asterisk/trunk/tests/rest_api/bridges/attended_transfer/attended_transfer.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/attended_transfer/attended_transfer.py?view=diff&rev=5055&r1=5054&r2=5055
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/attended_transfer/attended_transfer.py (original)
+++ asterisk/trunk/tests/rest_api/bridges/attended_transfer/attended_transfer.py Fri May 23 07:29:39 2014
@@ -7,55 +7,45 @@
 '''
 
 import logging
-import subprocess
-import time
+from sys import path
+
+path.append("lib/python/asterisk")
+from sipp import SIPpScenario
 
 LOGGER = logging.getLogger(__name__)
 
 class TestLogic(object):
     def __init__(self):
-        self.channels = 0
         self.originated_id = None
         self.bridge_id = None
-        self.pja = subprocess.Popen(['pjsua', '--local-port=5065', '--null-audio',
-            '--id=sip:bob at 127.0.0.1'],
-            stdin=subprocess.PIPE, stdout=subprocess.PIPE)
 
 TEST = TestLogic()
 
-def a_call_stasis():
-    TEST.pja.stdin.write("m\n")
-    TEST.pja.stdin.write("sip:stasis at 127.0.0.1:5060\n")
-
-def on_third_leg(ami, event):
-    LOGGER.debug("Peforming transfer")
-    TEST.pja.stdin.write("X\n")
-    LOGGER.debug("Selecting transferee")
-    TEST.pja.stdin.write("1\n")
-    LOGGER.debug("DONE")
-    return True
-
-def a_call_app():
-    TEST.pja.stdin.write("H\n")
-    TEST.pja.stdin.write("m\n")
-    TEST.pja.stdin.write("sip:1000 at 127.0.0.1:5060\n")
-
 def on_kickoff_start(ari, event, test_object):
     LOGGER.debug("on_kickoff_start(%r)" % event)
+
+    sipp_referer = SIPpScenario(test_object.test_name,
+        {'scenario':'referer.xml', '-p':'5065', '-3pcc':'127.0.0.1:5064'}, target='127.0.0.1')
+    sipp_referee = SIPpScenario(test_object.test_name,
+        {'scenario':'referee.xml', '-p':'5066', '-3pcc':'127.0.0.1:5064'}, target='127.0.0.1')
+    sipp_referer.run(test_object)
+    sipp_referee.run(test_object)
+
     TEST.bridge_id = ari.post('bridges').json()['id']
-    a_call_stasis()
     TEST.originated_id = event['channel']['id']
+
     ari.post('bridges', TEST.bridge_id, 'addChannel', channel=event['channel']['id'])
     return True
 
 def on_test_start(ari, event, test_object):
     LOGGER.debug("on_test_start(%r)" % event)
+
     ari.post('bridges', TEST.bridge_id, 'addChannel', channel=event['channel']['id'])
-    a_call_app()
     return True
 
 def on_attended_transfer(ari, event, test_object):
     LOGGER.debug("on_attended_transfer(%r)" % event)
+
     ari.delete('bridges', TEST.bridge_id)
     ari.delete('channels', TEST.originated_id)
 

Added: asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referee.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referee.xml?view=auto&rev=5055
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referee.xml (added)
+++ asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referee.xml Fri May 23 07:29:39 2014
@@ -1,0 +1,127 @@
+<?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             -->
+<!--                                                                    -->
+
+<scenario name="Referee Leg">
+
+  <recvCmd>
+    <action>
+      <ereg regexp="REMOTE(.*)"
+        search_in="hdr"
+        header="Call-ID:"
+        check_it="true"
+        assign_to="1,original_callid" />
+    </action>
+  </recvCmd>
+
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:1000@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
+      To: <sip:transfer@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: [cseq] INVITE
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Max-Forwards: 70
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=- 1324901698 1324901698 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 101
+      a=sendrecv
+      a=rtpmap:0 PCMU/8000
+      a=rtpmap:101 telephone-event/8000
+
+    ]]>
+  </send>
+
+  <recv response="100" optional="true" />
+  <recv response="101" optional="true" />
+  <recv response="180" optional="true" />
+  <recv response="200" rtd="true" crlf="true">
+    <action>
+      <ereg regexp="tag=([[:alnum:].\-]*)"
+        search_in="hdr"
+        header="To:"
+        check_it="true"
+        assign_to="2,to_tag" />
+      <ereg regexp="tag=([[:alnum:].\-]*)"
+        search_in="hdr"
+        header="From:"
+        check_it="true"
+        assign_to="3,from_tag" />
+    </action>
+  </recv>
+  <Reference variables="1,2,3" />
+
+  <send>
+    <![CDATA[
+
+      ACK sip:1000@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+      [last_From:]
+      [last_To]
+      Call-ID: [call_id]
+      CSeq: [cseq] ACK
+      Contact: sip:bob@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <pause milliseconds="1000" />
+  <sendCmd>
+    <![CDATA[
+      Call-ID: [$original_callid]
+      Remote-To-Tag: [$to_tag]
+      Remote-From-Tag: [$from_tag]
+      Remote-URI: sip:1000@[remote_ip]:[remote_port]
+    ]]>
+  </sendCmd>
+
+  <recv request="BYE" />
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Content-Length:0
+
+    ]]>
+  </send>
+
+  <!-- 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/rest_api/bridges/attended_transfer/sipp/referee.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referee.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referee.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referer.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referer.xml?view=auto&rev=5055
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referer.xml (added)
+++ asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referer.xml Fri May 23 07:29:39 2014
@@ -1,0 +1,179 @@
+<?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             -->
+<!--                                                                    -->
+
+<scenario name="Referer Leg">
+
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:stasis@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
+      To: <sip:transfer@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: [cseq] INVITE
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Content-Type: application/sdp
+      Max-Forwards: 70
+      Content-Length: [len]
+
+      v=0
+      o=- 1324901698 1324901698 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 101
+      a=sendrecv
+      a=rtpmap:0 PCMU/8000
+      a=rtpmap:101 telephone-event/8000
+
+    ]]>
+  </send>
+
+  <recv response="100" optional="true" />
+  <recv response="101" optional="true" />
+  <recv response="180" optional="true" />
+  <recv response="200" rtd="true" crlf="true" />
+
+  <send>
+    <![CDATA[
+
+      ACK sip:stasis@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+      [last_From:]
+      [last_To]
+      Call-ID: [call_id]
+      CSeq: [cseq] ACK
+      Contact: sip:bob@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <sendCmd>
+    <![CDATA[
+      Call-ID: REMOTE[call_id]
+      Start the Echo Leg
+    ]]>
+  </sendCmd>
+
+  <recvCmd>
+    <action>
+      <ereg regexp=" (.+)"
+        search_in="hdr"
+        header="Remote-URI:"
+        check_it="true"
+        assign_to="1,remote_contact" />
+      <ereg regexp=" (.+)"
+        search_in="hdr"
+        header="Remote-To-Tag:"
+        check_it="true"
+        assign_to="2,remote_to_tag" />
+      <ereg regexp=" (.+)"
+        search_in="hdr"
+        header="Remote-From-Tag:"
+        check_it="true"
+        assign_to="3,remote_from_tag" />
+      <ereg regexp=" (.+)@(.+)"
+        search_in="hdr"
+        header="Call-ID:"
+        check_it="true"
+        assign_to="4,callid_chunk_1,callid_chunk_2"/>
+     </action>
+  </recvCmd>
+  <Reference variables="1,2,3,4" />
+
+  <send>
+    <![CDATA[
+
+      REFER sip:stasis@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      [last_From:]
+      [last_To]
+      [last_Call-ID:]
+      CSeq: [cseq] REFER
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Max-Forwards: 70
+      Refer-to: <[$remote_contact]?Replaces=REMOTE[$callid_chunk_1]%40[$callid_chunk_2]%3Bto-tag%3D[$remote_to_tag]%3Bfrom-tag%3D[$remote_from_tag]>
+      Referred-By: sip:bob@[local_ip]
+      Content-Length: 0
+
+    ]]>
+  </send>
+  <recv response="202" rtd="true" crlf="true" />
+
+  <recv request="NOTIFY" />
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Content-Length:0
+
+    ]]>
+  </send>
+
+  <recv request="NOTIFY" />
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Content-Length:0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:stasis@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: <sip:bob@[local_ip]:[local_port]>;tag=[call_number]
+      To: <sip:transfer@[remote_ip]:[remote_port]>[peer_tag_param]
+      [last_Call-ID:]
+      CSeq: [cseq] BYE
+      Contact: sip:bob@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+  <recv response="200" />
+
+  <!-- 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/rest_api/bridges/attended_transfer/sipp/referer.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referer.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referer.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: asterisk/trunk/tests/rest_api/bridges/attended_transfer/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/attended_transfer/test-config.yaml?view=diff&rev=5055&r1=5054&r2=5055
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/attended_transfer/test-config.yaml (original)
+++ asterisk/trunk/tests/rest_api/bridges/attended_transfer/test-config.yaml Fri May 23 07:29:39 2014
@@ -1,7 +1,33 @@
 testinfo:
-    summary: Test originating calls to a Stasis application using ARI and then attended transferring.
+    summary: Test that ensures attended transfer events are delivered via WebSocket.
     description: |
-        Originate two external SIP calls into Stasis and then have one attended transfer the other.
+        "This test originates one call into Stasis():
+
+          Originated Channel -> Stasis()
+
+        It then starts two SIPp scenarios that call into the dialplan:
+
+          SIPp #1 (referer.xml) -> Stasis()
+          SIPp #2 (referee.xml) -> Echo()
+
+        The two SIPp scenarios work together via 3PCC mode to pass
+        SIPp #2's call information back to SIPp #1 once both calls are up:
+
+          SIPp #2 --3PCC(call information)-> SIPp #1
+
+        The test bridges the two channels in Stasis():
+
+          Originated Channel -> Stasis() -> Bridge -> Stasis() -> SIPp #1
+
+        SIPp #1 then performs an attended transfer using a REFER with
+        SIPp #2's call information which results in a Local channel
+        passing information between Stasis() and Echo():
+
+          Originated Channel -> Stasis() -> Bridge -> Stasis() -> Local Channel Pair -> Echo()
+
+        Now that the transfer is complete and the transferring channels
+        have been hung up, the remaining channels are hung up and the
+        test ends."
 
 test-modules:
     add-test-to-search-path: True
@@ -11,9 +37,6 @@
         -
             config-section: ari-config
             typename: ari.WebSocketEventModule
-        -
-            config-section: ami-config
-            typename: 'ami.AMIEventModule'
 
 ari-config:
     apps: testsuite
@@ -45,19 +68,6 @@
                 module: attended_transfer
                 method: on_attended_transfer
 
-ami-config:
-    -
-        type: 'callback'
-        conditions:
-            match:
-                Event: 'Newexten'
-                Context: 'default'
-                Extension: '1000'
-                Application: 'Echo'
-                Channel: 'PJSIP/bob-.*'
-        callbackModule: 'attended_transfer'
-        callbackMethod: 'on_third_leg'
-
 properties:
     minversion: '12.1.0'
     dependencies:




More information about the asterisk-commits mailing list