[asterisk-commits] kmoore: testsuite/asterisk/trunk r6091 - in /asterisk/trunk/tests/channels/pj...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 12 08:16:01 CST 2014


Author: kmoore
Date: Fri Dec 12 08:15:54 2014
New Revision: 6091

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6091
Log:
Testsuite: Test for hold using 'inactive' streams

This adds tests checking the use of the 'inactive' stream direction for
setting hold. This is used by some Seimens phones. This is primarily a
copy of the existing hold tests for 'sendonly' streams with a little
cleanup.

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

Added:
    asterisk/trunk/tests/channels/pjsip/hold_inactive/
    asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/
    asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/hold_inactive/run-test   (with props)
    asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/
    asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/inject.csv   (with props)
    asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_A.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_IP_media_restrict.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_duplicate_hold.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_hold_update.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_media_restrict.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_unhold_sans_sdp.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/hold_inactive/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/pjsip/tests.yaml

Added: asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/extensions.conf?view=auto&rev=6091
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/extensions.conf Fri Dec 12 08:15:54 2014
@@ -1,0 +1,11 @@
+[general]
+PHONE_TO_DIAL=PJSIP/phone_B
+
+[default]
+; Dial with no options; use bridge set up based on peer definitions
+exten => devicehint,hint,PJSIP/phone_A
+
+exten => basicdial,1,NoOp()
+	same => n,Dial(PJSIP/phone_B,,g)
+	same => n,UserEvent(TestStatus, extension: basicdial)
+	same => n,Hangup()

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

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

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

Added: asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/pjsip.conf?view=auto&rev=6091
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/pjsip.conf Fri Dec 12 08:15:54 2014
@@ -1,0 +1,28 @@
+[local]
+type=transport
+protocol=udp
+bind=127.0.0.1:5060
+
+[phone_A]
+type=aor
+contact=sip:phone_A at 127.0.0.2:5060
+
+[phone_A]
+type=endpoint
+aors=phone_A
+context=default
+disallow=all
+allow=ulaw
+direct_media=no
+
+[phone_B]
+type=aor
+contact=sip:phone_B at 127.0.0.3:5060
+
+[phone_B]
+type=endpoint
+aors=phone_B
+context=default
+disallow=all
+allow=ulaw
+direct_media=no

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

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

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/hold_inactive/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/hold_inactive/run-test?view=auto&rev=6091
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/hold_inactive/run-test (added)
+++ asterisk/trunk/tests/channels/pjsip/hold_inactive/run-test Fri Dec 12 08:15:54 2014
@@ -1,0 +1,267 @@
+#!/usr/bin/env python
+"""
+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 sys
+import logging
+
+sys.path.append("lib/python")
+
+from asterisk.test_case import TestCase
+from asterisk.sipp import SIPpScenario
+from twisted.internet import reactor
+
+LOGGER = logging.getLogger(__name__)
+INJECT_FILE = "inject.csv"
+
+
+class SIPHold(TestCase):
+    '''TestCase to execute and evaluate PJSIP hold/unhold scenarios '''
+
+    def __init__(self):
+        ''' Constructor '''
+        super(SIPHold, self).__init__()
+        self.create_asterisk()
+
+        self.sipp_scn_phone_a = [{'scenario': 'phone_A.xml',
+                                  '-i': '127.0.0.2', '-p': '5060',
+                                  '-inf': INJECT_FILE},
+                                 {'scenario': 'phone_A.xml',
+                                  '-i': '127.0.0.2', '-p': '5060',
+                                  '-inf': INJECT_FILE},
+                                 {'scenario': 'phone_A.xml',
+                                  '-i': '127.0.0.2', '-p': '5060',
+                                  '-inf': INJECT_FILE},
+                                 {'scenario': 'phone_A.xml',
+                                  '-i': '127.0.0.2', '-p': '5060',
+                                  '-inf': INJECT_FILE},
+                                 {'scenario': 'phone_A.xml',
+                                  '-i': '127.0.0.2', '-p': '5060',
+                                  '-inf': INJECT_FILE}]
+        self.sipp_scn_phone_b = [{'scenario': 'phone_B_media_restrict.xml',
+                                  '-i': '127.0.0.3', '-p': '5060',
+                                  '-inf': INJECT_FILE},
+                                 {'scenario': 'phone_B_unhold_sans_sdp.xml',
+                                  '-i': '127.0.0.3', '-p': '5060',
+                                  '-inf': INJECT_FILE},
+                                 {'scenario': 'phone_B_duplicate_hold.xml',
+                                  '-i': '127.0.0.3', '-p': '5060',
+                                  '-inf': INJECT_FILE},
+                                 {'scenario': 'phone_B_hold_update.xml',
+                                  '-i': '127.0.0.3', '-p': '5060',
+                                  '-inf': INJECT_FILE},
+                                 {'scenario': 'phone_B_IP_media_restrict.xml',
+                                  '-i': '127.0.0.3', '-p': '5060',
+                                  '-inf': INJECT_FILE}]
+
+        self.passed = True
+        self.moh_start_events = 0
+        self.moh_stop_events = 0
+        self.hold_events = 0
+        self.unhold_events = 0
+        self.user_events = 0
+        self.status_inuse_events = 0
+        self.status_onhold_events = 0
+        self.status_notinuse_events = 0
+        self._test_counter = 0
+        self._a_finished = False
+        self._b_finished = False
+
+    def ami_connect(self, ami):
+        ''' Reaction to new AMI connection
+
+        :param ami: AMI connection that was established
+        '''
+        super(SIPHold, self).ami_connect(ami)
+        ami.registerEvent('UserEvent', self.user_event_handler)
+
+        ami.registerEvent('MusicOnHoldStart', self.moh_start_event_handler)
+        ami.registerEvent('MusicOnHoldStop', self.moh_stop_event_handler)
+
+        ami.registerEvent('ExtensionStatus', self.extension_status_handler)
+
+        ami.registerEvent('Hold', self.hold_event_handler)
+        ami.registerEvent('Unhold', self.unhold_event_handler)
+
+        LOGGER.info("Starting SIP scenario")
+        self.execute_scenarios()
+
+    def execute_scenarios(self):
+        '''Execute sipp scenarios and check results for a single test phase
+        '''
+        def __check_scenario_a(result):
+            ''' Callback from successful sipp scenario - raises flag
+            indicating that side A completed execution
+
+            :param result: value returned by sipp indicating completion status
+            '''
+            self._a_finished = True
+            return result
+
+        def __check_scenario_b(result):
+            ''' Callback from successful sipp scenario - raises flag
+            indicating that side B completed execution
+
+            :param result: value returned by sipp indicating completion status
+            '''
+            self._b_finished = True
+            return result
+
+        def __execute_next_scenario(result):
+            ''' Callback from successful sipp scenario - if both sipp
+            scenarios are finished then this function will start executing
+            the next scenario.
+
+            :param result: value returned by sipp indicating completion status
+            '''
+            if self._a_finished and self._b_finished:
+                self._test_counter += 1
+                self.reset_timeout()
+                self.execute_scenarios()
+            return result
+
+        if self._test_counter == len(self.sipp_scn_phone_a):
+            LOGGER.info("All scenarios executed")
+            return
+
+        sipp_a = SIPpScenario(self.test_name,
+                              self.sipp_scn_phone_a[self._test_counter])
+        sipp_b = SIPpScenario(self.test_name,
+                              self.sipp_scn_phone_b[self._test_counter])
+
+        # Start up the listener first - Phone A calls Phone B
+        self._a_finished = False
+        self._b_finished = False
+        res_b = sipp_b.run(self)
+        res_a = sipp_a.run(self)
+
+        res_a.addCallback(__check_scenario_a)
+        res_a.addCallback(__execute_next_scenario)
+        res_b.addCallback(__check_scenario_b)
+        res_b.addCallback(__execute_next_scenario)
+
+    def user_event_handler(self, ami, event):
+        ''' Reacts to UserEvents issued to indicate the end of a call.
+        stops the testsuite once all calls have reached that point.
+
+        :param ami: AMI connection that the event was received from
+        :param event: Event that was received
+        '''
+        self.user_events += 1
+        if (self.user_events == len(self.sipp_scn_phone_a)):
+            LOGGER.info("All user events received; stopping reactor")
+            self.stop_reactor()
+
+    def moh_start_event_handler(self, ami, event):
+        ''' Reacts to music on hold start events and tallies them.
+
+        :param ami: AMI connection the event was received from
+        :param event: Event that was received
+        '''
+        LOGGER.debug("Received MOH start event")
+        self.moh_start_events += 1
+
+    def moh_stop_event_handler(self, ami, event):
+        ''' Reacts to music on hold stop events and tallies them.
+
+        :param ami: AMI connection the event was received from
+        :param event: Event that was received
+        '''
+
+        LOGGER.debug("Received MOH stop event")
+        self.moh_stop_events += 1
+
+    def extension_status_handler(self, ami, event):
+        ''' Count hold, unhold, and hungup statuses '''
+        status = event.get('status')
+        if status == '1':
+            self.status_inuse_events += 1
+        elif status == '16':
+            self.status_onhold_events += 1
+        elif status == '0':
+            self.status_notinuse_events += 1
+
+    def hold_event_handler(self, ami, event):
+        ''' Reacts to hold events and tallies them.
+
+        :param ami: AMI connection the event was received from
+        :param event: Event that was received
+        '''
+
+        LOGGER.debug("Recieved Hold event")
+        self.hold_events += 1
+
+    def unhold_event_handler(self, ami, event):
+        ''' Reacts to unhold events and tallies them.
+
+        :param ami: AMI connection the event was received from
+        :param event: Event that was received
+        '''
+
+        LOGGER.debug("Received Unhold event")
+        self.unhold_events += 1
+
+    def run(self):
+        ''' Run the test and create an AMI connection '''
+
+        super(SIPHold, self).run()
+        self.create_ami_factory()
+
+
+def main():
+    ''' Run the test and check the results '''
+    test = SIPHold()
+    reactor.run()
+
+    if (test.moh_start_events != len(test.sipp_scn_phone_a)):
+        LOGGER.error("Failed to receive %d MOH start events (received %d)" %
+                     (len(test.sipp_scn_phone_a), test.moh_start_events))
+        test.passed = False
+    if (test.moh_stop_events != len(test.sipp_scn_phone_a)):
+        LOGGER.error("Failed to receive %d MOH stop events (received %d)" %
+                     (len(test.sipp_scn_phone_a), test.moh_stop_events))
+        test.passed = False
+    if (test.hold_events != len(test.sipp_scn_phone_a)):
+        LOGGER.error("Failed to receive %d Hold events (received %d)" %
+                     (len(test.sipp_scn_phone_a), test.hold_events))
+        test.passed = False
+    if (test.unhold_events != len(test.sipp_scn_phone_a)):
+        LOGGER.error("Failed to receive %d Unhold events (received %d)" %
+                     (len(test.sipp_scn_phone_a), test.unhold_events))
+        test.passed = False
+    if (test.user_events != len(test.sipp_scn_phone_a)):
+        LOGGER.error("Failed to receive %d user test events (received %d)" %
+                     (len(test.sipp_scn_phone_a), test.user_events))
+        test.passed = False
+    if (test.status_inuse_events != len(test.sipp_scn_phone_a) * 2):
+        LOGGER.error("ExtensionStatus - InUse: %d / %d" %
+                     (len(test.sipp_scn_phone_a) * 2,
+                      test.status_inuse_events))
+        test.passed = False
+    if (test.status_onhold_events != len(test.sipp_scn_phone_a)):
+        LOGGER.error("ExtensionStatus - Hold: %d / %d" %
+                     (len(test.sipp_scn_phone_a),
+                      test.status_onhold_events))
+        test.passed = False
+    if (test.status_notinuse_events != len(test.sipp_scn_phone_a)):
+        LOGGER.error("ExtensionStatus - NotInUse: %d / %d" %
+                     (len(test.sipp_scn_phone_a),
+                      test.status_notinuse_events))
+        test.passed = False
+
+    if test.passed:
+        return 0
+    else:
+        return 1
+
+
+if __name__ == "__main__":
+    sys.exit(main())
+
+
+# vim:sw=4:ts=4:expandtab:textwidth=79

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/run-test
------------------------------------------------------------------------------
    svn:executable = *

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

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

Added: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/inject.csv
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/inject.csv?view=auto&rev=6091
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/inject.csv (added)
+++ asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/inject.csv Fri Dec 12 08:15:54 2014
@@ -1,0 +1,2 @@
+SEQUENTIAL
+phone_A;phone_B;basicdial

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/inject.csv
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/inject.csv
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/inject.csv
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_A.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_A.xml?view=auto&rev=6091
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_A.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_A.xml Fri Dec 12 08:15:54 2014
@@ -1,0 +1,92 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Phone A Hold with IP and Media Restrictions">
+
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[field2]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
+			To: <sip:[field2]@[remote_ip]:[remote_port];user=phone>
+			CSeq: 1 INVITE
+			Call-ID: [call_id]
+			Contact: <sip:[field0]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Allow-Events: talk,hold,conference
+			Max-Forwards: 70
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1324901698 1324901698 IN IP4 [local_ip]
+			s=Polycom IP Phone
+			c=IN IP4 [local_ip]
+			t=0 0
+			a=sendrecv
+			m=audio 2226 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="180" optional="true" />
+
+	<recv response="183" optional="true" />
+
+	<recv response="200" />
+
+	<send>
+		<![CDATA[
+			ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field0] <sip:[field0]@[remote_ip]>;tag=[call_number]
+			To: <sip:[field1]@[remote_ip];user=phone>[peer_tag_param]
+			CSeq: 1 ACK
+			Call-ID: [call_id]
+			Contact: <sip:[field0]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Max-Forwards: 70
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv request="BYE"/>
+
+	<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:[field0]@[local_ip]:[local_port];transport=[transport]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			Supported: 100rel,replaces
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1324901698 1324901698 IN IP4 [local_ip]
+			s=Polycom IP Phone
+			c=IN IP4 [local_ip]
+			t=0 0
+			a=sendrecv
+			m=audio 2226 RTP/AVP 0 101
+			a=sendrecv
+			a=rtpmap:0 PCMU/8000
+			a=rtpmap:101 telephone-event/8000
+		]]>
+	</send>
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_A.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_A.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_A.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_IP_media_restrict.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_IP_media_restrict.xml?view=auto&rev=6091
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_IP_media_restrict.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_IP_media_restrict.xml Fri Dec 12 08:15:54 2014
@@ -1,0 +1,220 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Phone B Hold with IP and Media Restrictions">
+	<Global variables="global_call_id"/>
+	<Global variables="prime_tag"/>
+
+	<recv request="INVITE" crlf="true">
+		<action>
+			<ereg regexp=".*"
+				header="Call-ID:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="global_call_id"/>
+			<ereg regexp="tag=.*"
+				header="From:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="prime_tag"/>
+		</action>
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 100 Trying
+			[last_Via:]
+			[last_From:]
+			[last_To:];tag=[call_number]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Content-Length: 0
+		]]>
+	</send>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 180 Ringing
+			[last_Via:]
+			[last_From:]
+			[last_To:];tag=[call_number]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Allow-Events: talk,hold,conference
+			Accept-Language: en
+			Content-Length: 0
+		]]>
+	</send>
+
+	<pause milliseconds="200"/>
+
+	<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:[field1]@[local_ip]:[local_port];transport=[transport]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			Supported: 100rel,replaces
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1325003603 1325003604 IN IP4 [local_ip]
+			s=Polycom IP Phone
+			c=IN IP4 [local_ip]
+			t=0 0
+			a=sendrecv
+			m=audio 2226 RTP/AVP 0 101
+			a=sendrecv
+			a=rtpmap:0 PCMU/8000
+			a=rtpmap:101 telephone-event/8000
+		]]>
+	</send>
+
+	<!-- RECV ACK -->
+	<recv request="ACK"/>
+
+	<!-- Wait some period of time -->
+	<pause milliseconds="3000"/>
+
+	<!-- Modify RTP session to be inactive -->
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+			To: [field0] <sip:[field1]@[remote_ip]>;[$prime_tag]
+			CSeq: [cseq] INVITE
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Supported: 100rel,replaces
+			Allow-Events: talk,hold,conference
+			Max-Forwards: 70
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1325003603 1325003604 IN IP4 [local_ip]
+			s=Polycom IP Phone
+			c=IN IP4 0.0.0.0
+			t=0 0
+			m=audio 2226 RTP/AVP 0 101
+			a=inactive
+			a=rtpmap:0 PCMU/8000
+			a=rtpmap:101 telephone-event/8000
+		]]>
+	</send>
+
+	<recv response="100" optional="true" />
+
+	<recv response="200" />
+
+	<pause milliseconds="200"/>
+
+	<send>
+		<![CDATA[
+			ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]>;tag=[call_number]
+			To: <sip:[field0]@[remote_ip];user=[field0]>[peer_tag_param]
+			CSeq: [cseq] ACK
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Max-Forwards: 70
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Wait some period of time, then send the un-hold -->
+	<pause milliseconds="3000"/>
+
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+			To: [field0] <sip:[field1]@[remote_ip]>;[$prime_tag]
+			CSeq: [cseq] INVITE
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Supported: 100rel,replaces
+			Allow-Events: talk,hold,conference
+			Max-Forwards: 70
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1325003603 1325003605 IN IP4 [local_ip]
+			s=Polycom IP Phone
+			c=IN IP4 [local_ip]
+			t=0 0
+			a=sendrecv
+			m=audio 2226 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="200" />
+
+	<send>
+		<![CDATA[
+			ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]>;tag=[call_number]
+			To: <sip:[field0]@[remote_ip];user=[field0]>[peer_tag_param]
+			CSeq: [cseq] ACK
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Max-Forwards: 70
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Wait some period of time -->
+	<pause milliseconds="500"/>
+
+	<send>
+		<![CDATA[
+			BYE sip:[field1]@1[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/UDP [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+			To: [field0] <sip:[field1]@[remote_ip]>[peer_tag_param]
+			CSeq: [cseq] BYE
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Max-Forwards: 70
+			Content-Length: 0
+		]]>
+	</send>
+
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_IP_media_restrict.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_IP_media_restrict.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_IP_media_restrict.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_duplicate_hold.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_duplicate_hold.xml?view=auto&rev=6091
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_duplicate_hold.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_duplicate_hold.xml Fri Dec 12 08:15:54 2014
@@ -1,0 +1,267 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Phone B Hold">
+	<Global variables="global_call_id"/>
+	<Global variables="prime_tag"/>
+
+	<recv request="INVITE" crlf="true">
+		<action>
+			<ereg regexp=".*"
+				header="Call-ID:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="global_call_id"/>
+			<ereg regexp="tag=.*"
+				header="From:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="prime_tag"/>
+		</action>
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 100 Trying
+			[last_Via:]
+			[last_From:]
+			[last_To:];tag=[call_number]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Content-Length: 0
+		]]>
+	</send>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 180 Ringing
+			[last_Via:]
+			[last_From:]
+			[last_To:];tag=[call_number]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Allow-Events: talk,hold,conference
+			Accept-Language: en
+			Content-Length: 0
+		]]>
+	</send>
+
+	<pause milliseconds="200"/>
+
+	<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:[field1]@[local_ip]:[local_port];transport=[transport]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			Supported: 100rel,replaces
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1325003603 1325003604 IN IP4 [local_ip]
+			s=Polycom IP Phone
+			c=IN IP4 [local_ip]
+			t=0 0
+			a=sendrecv
+			m=audio 2226 RTP/AVP 0 101
+			a=sendrecv
+			a=rtpmap:0 PCMU/8000
+			a=rtpmap:101 telephone-event/8000
+		]]>
+	</send>
+
+	<!-- RECV ACK -->
+	<recv request="ACK"/>
+
+	<!-- Wait some period of time -->
+	<pause milliseconds="2000"/>
+
+	<!-- Modify RTP session to be inactive -->
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+			To: [field0] <sip:[field1]@[remote_ip]>;[$prime_tag]
+			CSeq: [cseq] INVITE
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Supported: 100rel,replaces
+			Allow-Events: talk,hold,conference
+			Max-Forwards: 70
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1325003603 1325003604 IN IP4 [local_ip]
+			s=Polycom IP Phone
+			c=IN IP4 [local_ip]
+			t=0 0
+			a=inactive
+			m=audio 2226 RTP/AVP 0 101
+			a=inactive
+			a=rtpmap:0 PCMU/8000
+			a=rtpmap:101 telephone-event/8000
+		]]>
+	</send>
+
+	<recv response="100" optional="true" />
+
+	<recv response="200" />
+
+	<pause milliseconds="200"/>
+
+	<send>
+		<![CDATA[
+			ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]>;tag=[call_number]
+			To: <sip:[field0]@[remote_ip];user=[field0]>[peer_tag_param]
+			CSeq: [cseq] ACK
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Max-Forwards: 70
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Wait some period of time -->
+	<pause milliseconds="2000"/>
+
+	<!-- Modify RTP session to be inactive -->
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+			To: [field0] <sip:[field1]@[remote_ip]>;[$prime_tag]
+			CSeq: [cseq] INVITE
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Supported: 100rel,replaces
+			Allow-Events: talk,hold,conference
+			Max-Forwards: 70
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1325003603 1325003604 IN IP4 [local_ip]
+			s=Polycom IP Phone
+			c=IN IP4 [local_ip]
+			t=0 0
+			a=inactive
+			m=audio 2226 RTP/AVP 0 101
+			a=inactive
+			a=rtpmap:0 PCMU/8000
+			a=rtpmap:101 telephone-event/8000
+		]]>
+	</send>
+
+	<recv response="100" optional="true" />
+
+	<recv response="200" />
+
+	<pause milliseconds="200"/>
+
+	<send>
+		<![CDATA[
+			ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]>;tag=[call_number]
+			To: <sip:[field0]@[remote_ip];user=[field0]>[peer_tag_param]
+			CSeq: [cseq] ACK
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Max-Forwards: 70
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Wait some period of time, then send the un-hold as reinvite without SDP -->
+	<pause milliseconds="2000"/>
+
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+			To: [field0] <sip:[field1]@[remote_ip]>;[$prime_tag]
+			CSeq: [cseq] INVITE
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Supported: 100rel,replaces
+			Allow-Events: talk,hold,conference
+			Max-Forwards: 70
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv response="100" optional="true" />
+
+	<recv response="200" />
+
+	<send>
+		<![CDATA[
+			ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]>;tag=[call_number]
+			To: <sip:[field0]@[remote_ip];user=[field0]>[peer_tag_param]
+			CSeq: [cseq] ACK
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Max-Forwards: 70
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Wait some period of time -->
+	<pause milliseconds="2000"/>
+
+	<send>
+		<![CDATA[
+			BYE sip:[field1]@1[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/UDP [local_ip]:[local_port];branch=[branch]
+			From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+			To: [field0] <sip:[field1]@[remote_ip]>[peer_tag_param]
+			CSeq: [cseq] BYE
+			Call-ID: [$global_call_id]
+			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Max-Forwards: 70
+			Content-Length: 0
+		]]>
+	</send>
+
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_duplicate_hold.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_duplicate_hold.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_duplicate_hold.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_hold_update.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_hold_update.xml?view=auto&rev=6091
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_hold_update.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/hold_inactive/sipp/phone_B_hold_update.xml Fri Dec 12 08:15:54 2014
@@ -1,0 +1,267 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Phone B Hold">
+	<Global variables="global_call_id"/>
+	<Global variables="prime_tag"/>
+
+	<recv request="INVITE" crlf="true">
+		<action>
+			<ereg regexp=".*"
+				header="Call-ID:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="global_call_id"/>
+			<ereg regexp="tag=.*"
+				header="From:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="prime_tag"/>
+		</action>
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 100 Trying
+			[last_Via:]
+			[last_From:]
+			[last_To:];tag=[call_number]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Content-Length: 0
+		]]>
+	</send>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 180 Ringing
+			[last_Via:]
+			[last_From:]
+			[last_To:];tag=[call_number]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Allow-Events: talk,hold,conference
+			Accept-Language: en
+			Content-Length: 0
+		]]>
+	</send>
+
+	<pause milliseconds="200"/>
+
+	<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:[field1]@[local_ip]:[local_port];transport=[transport]>
+			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+			Supported: 100rel,replaces
+			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+			Accept-Language: en
+			Content-Type: application/sdp

[... 729 lines stripped ...]



More information about the asterisk-commits mailing list