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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 27 07:49:17 CDT 2014


Author: kmoore
Date: Fri Jun 27 07:49:05 2014
New Revision: 5189

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5189
Log:
Testsuite: Add PJSIP attended transfer tests

This adds tests for nominal callee- and caller-initiated attended
transfer scenarios using SIPp scenarios and SIPp's 3PCC to coordinate
call state. This also adds another sample SIPp scenario for handling
the REFER initiator behavior as a UAS that works with referee.xml (the
UAC attended transfer coordinator).

ASTERISK-23643 #close
Review: https://reviewboard.asterisk.org/r/3560/

Added:
    asterisk/trunk/contrib/sipp/transfer/referer_uas.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/attended_transfer.py   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referee.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/uac-no-hangup.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/uas.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/attended_transfer.py   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/configs/
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/sipp/
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/sipp/referee.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/sipp/referer.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/sipp/uas.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/caller_local/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/tests.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/tests.yaml   (with props)
Modified:
    asterisk/trunk/contrib/sipp/table_of_contents
    asterisk/trunk/lib/python/asterisk/sipp.py
    asterisk/trunk/tests/channels/pjsip/transfers/tests.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=5189&r1=5188&r2=5189
==============================================================================
--- asterisk/trunk/contrib/sipp/table_of_contents (original)
+++ asterisk/trunk/contrib/sipp/table_of_contents Fri Jun 27 07:49:05 2014
@@ -120,4 +120,13 @@
 	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.
+	REFER attended transfer. This scenario MUST be started
+	before referee.xml.
+
+* referer_uas.xml
+	This scenario functions as a cooperating counterpart for
+	referee.xml and will accept a call. 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. This scenario MUST be started before
+	referee.xml.

Added: asterisk/trunk/contrib/sipp/transfer/referer_uas.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/contrib/sipp/transfer/referer_uas.xml?view=auto&rev=5189
==============================================================================
--- asterisk/trunk/contrib/sipp/transfer/referer_uas.xml (added)
+++ asterisk/trunk/contrib/sipp/transfer/referer_uas.xml Fri Jun 27 07:49:05 2014
@@ -1,0 +1,221 @@
+<?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">
+  <recv request="INVITE" crlf="true" />
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[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">
+    <action>
+      <ereg regexp=" (.+)"
+        search_in="hdr"
+        header="From:"
+        check_it="true"
+        assign_to="1,outbound_to_header" />
+      <ereg regexp=" (.+)"
+        search_in="hdr"
+        header="To:"
+        check_it="true"
+        assign_to="1,outbound_from_header" />
+    </action>
+  </recv>
+
+  <!-- Put this leg on hold -->
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/UDP [local_ip]:[local_port];rport;received=127.0.0.1;branch=[branch]
+      From: [$outbound_from_header]
+      To: [$outbound_to_header]
+      Call-ID: [call_id]
+      CSeq: [cseq] INVITE
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      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=sendonly
+      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:[local_ip]:[local_port] SIP/2.0
+      [last_Via]
+      [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" />
+     </action>
+  </recvCmd>
+  <Reference variables="1,2,3" />
+
+  <send>
+    <![CDATA[
+
+      REFER sip:call_c@[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[call_id]%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" optional="true" next="do_notify"/>
+
+  <label id="after_notify" />
+
+  <recv request="BYE" />
+  <send next="after_notify_response">
+    <![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>
+
+  <label id="do_notify" />
+  <send next="after_notify">
+    <![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>
+  <label id="after_notify_response"/>
+
+  <!-- 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_uas.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

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=5189&r1=5188&r2=5189
==============================================================================
--- asterisk/trunk/lib/python/asterisk/sipp.py (original)
+++ asterisk/trunk/lib/python/asterisk/sipp.py Fri Jun 27 07:49:05 2014
@@ -162,12 +162,17 @@
             # each set of scenarios in the YAML config
             sipp_scenarios = []
             for scenario in scenario_set:
-                ordered_args = scenario.get('ordered-args') or []
-                target = scenario.get('target') or '127.0.0.1'
-                sipp_scenarios.append(SIPpScenario(self.test_name,
-                                                   scenario['key-args'],
-                                                   ordered_args,
-                                                   target=target))
+                if ("coordinated-sender" in scenario
+                    and "coordinated-receiver" in scenario):
+                    sipp_scenarios.append(CoordinatedScenario(self.test_name,
+                                                              scenario))
+                else:
+                    ordered_args = scenario.get('ordered-args') or []
+                    target = scenario.get('target') or '127.0.0.1'
+                    sipp_scenarios.append(SIPpScenario(self.test_name,
+                                                       scenario['key-args'],
+                                                       ordered_args,
+                                                       target=target))
             self.scenarios.append(sipp_scenarios)
 
         final_deferred = defer.Deferred()
@@ -375,7 +380,7 @@
 class SIPpProtocol(protocol.ProcessProtocol):
     """Class that manages a single SIPp instance"""
 
-    def __init__(self, name, stop_deferred):
+    def __init__(self, name, stop_deferred, start_deferred=None):
         """Create a SIPp process
 
         Keyword Arguments:
@@ -389,6 +394,7 @@
         self.exited = False
         self.stderr = []
         self._stop_deferred = stop_deferred
+        self._start_deferred = start_deferred
 
     def kill(self):
         """Kill the SIPp scenario"""
@@ -407,6 +413,8 @@
     def connectionMade(self):
         """Override of ProcessProtocol.connectionMade"""
         LOGGER.debug("Connection made to SIPp scenario %s" % (self._name))
+        if self._start_deferred:
+            self._start_deferred.callback(self)
 
     def errReceived(self, data):
         """Override of ProcessProtocol.errReceived"""
@@ -501,7 +509,7 @@
             self._process.kill()
         return
 
-    def run(self, test_case=None):
+    def run(self, test_case=None, start_deferred=None):
         """Execute a SIPp scenario
 
         Execute the SIPp scenario that was passed to this object
@@ -585,7 +593,7 @@
             self._test_case = test_case
             exit_deferred.addCallback(__evaluate_scenario_results)
 
-        self._process = SIPpProtocol(self.scenario['scenario'], exit_deferred)
+        self._process = SIPpProtocol(self.scenario['scenario'], exit_deferred, start_deferred)
         reactor.spawnProcess(self._process,
                              sipp_args[0],
                              sipp_args,
@@ -593,6 +601,120 @@
                              None,
                              None)
         return self._our_exit_deferred
+
+class CoordinatedScenario(object):
+    """A SIPp based scenario for the Asterisk testsuite that handles basic 3PCC
+    coordination.
+
+    CoordinatedScenario wraps and builds on the capabilities of SIPpScenario to
+    allow a pair of 3PCC scenarios to launch at the appropriate times to
+    function correctly. The sender scenario will not be started until the
+    receiver scenario comes up and opens its 3PCC port.
+    """
+
+    next_3pcc_port = 5080
+
+    def __init__(self, test_dir, coordinated_config):
+        """
+        Keyword Arguments:
+        test_dir            The path to the directory containing the run-test
+                            file.
+
+        coordinated_config  The configuration to use for the two coordinated
+                            SIPp scenarios. The SIPpScenario configurations are
+                            stored under keys "coordinated-sender" and
+                            "coordinated-receiver". These configs should not
+                            explicitly set 3PCC configurations as it will be
+                            handled automatically.
+        """
+
+        self.coordination_port = CoordinatedScenario.next_3pcc_port
+        CoordinatedScenario.next_3pcc_port += 1
+        coordination_address = '127.0.0.1:%s' % (self.coordination_port)
+
+        receiver_config = coordinated_config["coordinated-receiver"]
+        receiver_config['key-args']['-3pcc'] = coordination_address
+        target = receiver_config.get('target', '127.0.0.1')
+        self.receiver = SIPpScenario(test_dir,
+                                     receiver_config['key-args'],
+                                     receiver_config.get('ordered-args', []),
+                                     target=target)
+
+        sender_config = coordinated_config["coordinated-sender"]
+        sender_config['key-args']['-3pcc'] = coordination_address
+        target = sender_config.get('target', '127.0.0.1')
+        self.sender = SIPpScenario(test_dir,
+                                     sender_config['key-args'],
+                                     sender_config.get('ordered-args', []),
+                                     target=target)
+
+        self.exited = False
+        self.passed = False
+        self.results = []
+        self.name = "Coordinated Scenario %d" % self.coordination_port
+
+
+    def kill(self):
+        """Kill the executing SIPp scenario"""
+        self.sender.kill()
+        self.receiver.kill()
+        return
+
+    def run(self, test_case=None):
+        """Execute a coordinated SIPp scenario
+
+        Execute the set of SIPp scenarios passed to this object
+
+        Keyword Arguments:
+        test_case  If not None, the scenario will automatically evaluate its
+                   pass/fail status at the end of the run. In the event of a
+                   failure, it will fail the test case scenario and call
+                   stop_reactor.
+
+        Returns:
+        A deferred that can be used to determine when the SIPp Scenario
+        has exited.
+        """
+
+        def __scenario_callback(result, exit_deferred):
+            """Callback called when a scenario completes"""
+            self.results.append(result)
+            if self.sender.exited and self.receiver.exited:
+                self.exited = True
+                if self.sender.passed and self.receiver.passed:
+                    self.passed = True
+
+                if self.passed:
+                    LOGGER.info("Coordinated SIPp Scenario %d Exited" %
+                                (self.coordination_port))
+                else:
+                    LOGGER.warning("Coordinated SIPp Scenario %d Failed" %
+                                   (self.coordination_port))
+                exit_deferred.callback(self)
+            return result
+
+        def __receiver_start_callback(result):
+            """Callback for receiver start"""
+            sender_deferred = self.sender.run(test_case)
+            sender_deferred.addCallback(__scenario_callback)
+            return result
+
+        LOGGER.info("Executing coordinated SIPp scenario %d" %
+                    (self.coordination_port))
+
+        # setup callback for the receiver scenario start
+        receiver_start_deferred = defer.Deferred()
+        receiver_start_deferred.addCallback(__receiver_start_callback)
+
+        # setup callback for receiver completion
+        exit_deferred = defer.Deferred()
+        receiver_deferred = self.receiver.run(test_case,
+                                                   receiver_start_deferred)
+        receiver_deferred.addCallback(__scenario_callback, exit_deferred)
+
+
+        return exit_deferred
+
 
 class SIPpTest(TestCase):
     """A SIPp based test for the Asterisk testsuite.

Added: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/attended_transfer.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/attended_transfer.py?view=auto&rev=5189
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/attended_transfer.py (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/attended_transfer.py Fri Jun 27 07:49:05 2014
@@ -1,0 +1,21 @@
+"""
+Copyright (C) 2014, Digium, Inc.
+Kinsey Moore <kmoore at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+"""
+
+import logging
+
+LOGGER = logging.getLogger(__name__)
+
+HUNGUP = 0
+
+def transfer_complete(ami, event):
+    global HUNGUP
+    HUNGUP += 1
+    if HUNGUP == 2:
+        LOGGER.debug("Hanging up all charlie channels")
+        ami.hangup("/^PJSIP/charlie-.*$/")
+    return True

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/attended_transfer.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/attended_transfer.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/attended_transfer.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/attended_transfer.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/extensions.conf?view=auto&rev=5189
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/extensions.conf Fri Jun 27 07:49:05 2014
@@ -1,0 +1,8 @@
+[default]
+exten => call_c,1,NoOp()
+	same => n,Dial(PJSIP/charlie)
+	same => n,Hangup()
+
+exten => alice,1,NoOp()
+       same => n,Dial(PJSIP/bob)
+       same => n,Hangup()

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/pjsip.conf?view=auto&rev=5189
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/pjsip.conf Fri Jun 27 07:49:05 2014
@@ -1,0 +1,30 @@
+[local]
+type=transport
+protocol=udp
+bind=127.0.0.1:5060
+
+[endpoint](!)
+type=endpoint
+context=default
+disallow=all
+allow=ulaw
+direct_media=no
+
+[alice](endpoint)
+
+[bob](endpoint)
+aors=bob
+
+[bob]
+type=aor
+contact=sip:bob at 127.0.0.1:5066
+
+[charlie](endpoint)
+aors=charlie
+
+[charlie]
+type=aor
+contact=sip:charlie at 127.0.0.1:5067
+
+[david](endpoint)
+

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referee.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referee.xml?view=auto&rev=5189
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referee.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referee.xml Fri Jun 27 07:49:05 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:call_c@[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:call_c@[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:call_c@[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/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referee.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referee.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referee.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml?view=auto&rev=5189
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml Fri Jun 27 07:49:05 2014
@@ -1,0 +1,221 @@
+<?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">
+  <recv request="INVITE" crlf="true" />
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[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">
+    <action>
+      <ereg regexp=" (.+)"
+        search_in="hdr"
+        header="From:"
+        check_it="true"
+        assign_to="1,outbound_to_header" />
+      <ereg regexp=" (.+)"
+        search_in="hdr"
+        header="To:"
+        check_it="true"
+        assign_to="1,outbound_from_header" />
+    </action>
+  </recv>
+
+  <!-- Put this leg on hold -->
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/UDP [local_ip]:[local_port];rport;received=127.0.0.1;branch=[branch]
+      From: [$outbound_from_header]
+      To: [$outbound_to_header]
+      Call-ID: [call_id]
+      CSeq: [cseq] INVITE
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      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=sendonly
+      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:[local_ip]:[local_port] SIP/2.0
+      [last_Via]
+      [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" />
+     </action>
+  </recvCmd>
+  <Reference variables="1,2,3" />
+
+  <send>
+    <![CDATA[
+
+      REFER sip:call_c@[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[call_id]%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" optional="true" next="do_notify"/>
+
+  <label id="after_notify" />
+
+  <recv request="BYE" />
+  <send next="after_notify_response">
+    <![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>
+
+  <label id="do_notify" />
+  <send next="after_notify">
+    <![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>
+  <label id="after_notify_response"/>
+
+  <!-- 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/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/referer_uas.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/uac-no-hangup.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/uac-no-hangup.xml?view=auto&rev=5189
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/uac-no-hangup.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local/sipp/uac-no-hangup.xml Fri Jun 27 07:49:05 2014
@@ -1,0 +1,90 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Basic Sipstone UAC">
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 INVITE
+      Contact: sip:alice@[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="100"
+        optional="true">
+  </recv>
+
+  <recv response="181"
+        optional="true">
+  </recv>
+
+  <recv response="180" optional="true">
+  </recv>
+

[... 1049 lines stripped ...]



More information about the asterisk-commits mailing list