[asterisk-commits] kmoore: testsuite/asterisk/trunk r6047 - in /asterisk/trunk: lib/python/aster...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 8 09:48:20 CST 2014


Author: kmoore
Date: Mon Dec  8 09:48:14 2014
New Revision: 6047

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6047
Log:
Testsuite: Add Stasis external interaction tests

This reorganizes existing tests that affect channels in Stasis() via
external mechanisms and adds new tests to cover other interactions not
yet represented in the testsuite. An additional, more comprehensive
test for attended transfers has been added as well as tests for bridged
and unbridged channels in Stasis() being affected by AMI Bridge and
Redirect actions. The bug reported in ASTERISK-24591 was found while
writing these tests.

This also modifies the ARI python libraries to allow parameters to have
substituted variables.

This covers tests 1.3, 2.1.1, 2.10.1, 3.1, and 3.2 from the
StasisStart/StasisEnd test plan available here:
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=30279826

The two existing attended and blind transfer tests cover tests 1.4 and
1.9.

Review: https://reviewboard.asterisk.org/r/4226/
ASTERISK-24537 #close

Added:
    asterisk/trunk/tests/rest_api/external_interaction/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/configs/
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/configs/
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/tests.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/attended_transfer.py   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/sipp/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/sipp/referee.xml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/sipp/referer.xml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app/configs/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app/sipp/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app/sipp/referee.xml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app/sipp/referer.xml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/tests.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/
    asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/stasis_bridge_to_same_stasis_app/
    asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/stasis_bridge_to_same_stasis_app/blind_transfer.py   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/stasis_bridge_to_same_stasis_app/configs/
    asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/stasis_bridge_to_same_stasis_app/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/stasis_bridge_to_same_stasis_app/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/stasis_bridge_to_same_stasis_app/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/stasis_bridge_to_same_stasis_app/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/tests.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/tests.yaml   (with props)
Removed:
    asterisk/trunk/tests/rest_api/bridges/attended_transfer/
    asterisk/trunk/tests/rest_api/bridges/blind_transfer/
Modified:
    asterisk/trunk/lib/python/asterisk/ari.py
    asterisk/trunk/tests/rest_api/bridges/tests.yaml
    asterisk/trunk/tests/rest_api/tests.yaml

Modified: asterisk/trunk/lib/python/asterisk/ari.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/ari.py?view=diff&rev=6047&r1=6046&r2=6047
==============================================================================
--- asterisk/trunk/lib/python/asterisk/ari.py (original)
+++ asterisk/trunk/lib/python/asterisk/ari.py Mon Dec  8 09:48:14 2014
@@ -525,10 +525,11 @@
         uri = var_replace(self.uri, values)
         url = self.ari.build_url(uri)
         requests_method = getattr(requests, self.method)
+        params = dict((key, var_replace(val, values)) for key, val in self.params.iteritems())
 
         response = requests_method(
             url,
-            params=self.params,
+            params=params,
             data=self.body,
             headers=self.headers,
             auth=self.ari.userpass)

Modified: asterisk/trunk/tests/rest_api/bridges/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/tests.yaml?view=diff&rev=6047&r1=6046&r2=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/tests.yaml (original)
+++ asterisk/trunk/tests/rest_api/bridges/tests.yaml Mon Dec  8 09:48:14 2014
@@ -5,8 +5,6 @@
     - test: 'move'
     - test: 'delete'
     - test: 'add_recording_channel'
-    - test: 'blind_transfer'
-    - test: 'attended_transfer'
     - test: 'bridge_by_id'
     - test: 'bridge_record'
     - test: 'id_propagate'

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/ast1/extensions.conf?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/ast1/extensions.conf Mon Dec  8 09:48:14 2014
@@ -1,0 +1,5 @@
+[default]
+exten => echo,1,Answer()
+same => n,Echo()
+same => n,Hangup()
+

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/test-config.yaml?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/test-config.yaml Mon Dec  8 09:48:14 2014
@@ -1,0 +1,95 @@
+testinfo:
+    summary: Test that ensures that unbridged channels can be stolen properly.
+    description: |
+        "This test originates one Local channel into Stasis() and Echo() and
+        another Local channel into a pair of echo applications. It then uses
+        the AMI bridge action to pull the Local channel half with uniqueid
+        StasisChannel and Local channel half with uniqueid EchoChannel into
+        a bridge and hangs them up. This test verifies that all expected
+        events are received."
+
+test-modules:
+    add-test-to-search-path: True
+    test-object:
+        typename: ari.AriBaseTestObject
+    modules:
+        -
+            config-section: pluggable-config
+            typename: 'pluggable_modules.EventActionModule'
+
+pluggable-config:
+    -
+        ami-start:
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'channels/EchoChannel'
+                params:
+                    endpoint: 'Local/echo at default'
+                    extension: 'echo'
+                    otherChannelId: 'SecondEchoChan'
+            -
+                method: 'post'
+                uri: 'channels/StasisChannel'
+                params:
+                    endpoint: 'Local/echo at default'
+                    app: 'testsuite'
+                    otherChannelId: 'SecondStasisChan'
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: testsuite
+                args: []
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+        ami-actions:
+            action:
+                action: 'Bridge'
+                Channel1: 'StasisChannel'
+                Channel2: 'EchoChannel'
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: testsuite
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: BridgeEnter
+                    uniqueid: 'StasisChannel'
+            count: 1
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: BridgeEnter
+                    uniqueid: 'EchoChannel'
+            count: 1
+        ami-actions:
+            -
+                action:
+                    action: 'Hangup'
+                    Channel: 'StasisChannel'
+            -
+                action:
+                    action: 'Hangup'
+                    Channel: 'EchoChannel'
+        stop_test:
+
+properties:
+    minversion: '12.8.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : app_echo
+    tags:
+        - ARI

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/ast1/extensions.conf?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/ast1/extensions.conf Mon Dec  8 09:48:14 2014
@@ -1,0 +1,5 @@
+[default]
+exten => echo,1,Answer()
+same => n,Echo()
+same => n,Hangup()
+

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/test-config.yaml?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/test-config.yaml Mon Dec  8 09:48:14 2014
@@ -1,0 +1,128 @@
+testinfo:
+    summary: Test that ensures bridged channels in Stasis() can be stolen properly.
+    description: |
+        "This test originates one Local channel into Stasis() and Echo() and
+        another Local channel into a pair of echo applications. It then puts
+        the Stasis() Local channel half with uniqueid StasisChannel into a
+        bridge and uses the AMI bridge action to pull StasisChannel and
+        EchoChannel into a bridge and hangs them up. This test verifies that
+        the appropriate events are generated."
+
+test-modules:
+    add-test-to-search-path: True
+    test-object:
+        typename: ari.AriBaseTestObject
+    modules:
+        -
+            config-section: pluggable-config
+            typename: 'pluggable_modules.EventActionModule'
+
+pluggable-config:
+    -
+        ami-start:
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'channels/EchoChannel'
+                params:
+                    endpoint: 'Local/echo at default'
+                    extension: 'echo'
+                    otherChannelId: 'SecondEchoChan'
+            -
+                method: 'post'
+                uri: 'channels/StasisChannel'
+                params:
+                    endpoint: 'Local/echo at default'
+                    app: 'testsuite'
+                    otherChannelId: 'SecondStasisChan'
+            -
+                method: 'post'
+                uri: 'bridges/test_bridge'
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: testsuite
+                args: []
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+        ari-requests:
+            method: 'post'
+            uri: 'bridges/test_bridge/addChannel'
+            params:
+                channel: 'StasisChannel'
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+        ami-actions:
+            action:
+                action: 'Bridge'
+                Channel1: 'StasisChannel'
+                Channel2: 'EchoChannel'
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: testsuite
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: BridgeEnter
+                    uniqueid: 'StasisChannel'
+                nomatch:
+                    bridgeuniqueid: 'test_bridge'
+            count: 1
+        ami-actions:
+            -
+                action:
+                    action: 'Hangup'
+                    Channel: 'StasisChannel'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: BridgeEnter
+                    uniqueid: 'EchoChannel'
+            count: 1
+        ami-actions:
+            -
+                action:
+                    action: 'Hangup'
+                    Channel: 'EchoChannel'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Hangup
+                    uniqueid: 'EchoChannel'
+            count: 1
+        stop_test:
+
+properties:
+    minversion: '12.8.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : res_ari_bridges
+        - asterisk : app_echo
+    tags:
+        - ARI

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml Mon Dec  8 09:48:14 2014
@@ -1,0 +1,3 @@
+tests:
+    - test: 'stasis_bridge'
+    - test: 'stasis_app'

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/configs/ast1/extensions.conf?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/configs/ast1/extensions.conf Mon Dec  8 09:48:14 2014
@@ -1,0 +1,5 @@
+[default]
+exten => echo,1,Answer()
+same => n,Echo()
+same => n,Hangup()
+

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/test-config.yaml?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/test-config.yaml Mon Dec  8 09:48:14 2014
@@ -1,0 +1,85 @@
+testinfo:
+    summary: Test that ensures unbridged channels in Stasis() can be stolen properly using AMI Redirect.
+    description: |
+        "This test originates a Local channel into Stasis() and Echo() and
+        uses the AMI redirect action to move the Local channel half with
+        uniqueid StasisChannel into default,echo,1 which leads to the Echo()
+        application. Once the channel reaches the Echo() application, it is
+        hung up. This test verifies that the appropriate events are generated."
+
+test-modules:
+    test-object:
+        typename: ari.AriBaseTestObject
+    modules:
+        -
+            config-section: pluggable-config
+            typename: 'pluggable_modules.EventActionModule'
+
+pluggable-config:
+    -
+        ami-start:
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'channels/StasisChannel'
+                params:
+                    endpoint: 'Local/echo at default'
+                    app: 'testsuite'
+                    otherChannelId: 'SecondStasisChan'
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: testsuite
+                args: []
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+        ami-actions:
+            action:
+                action: 'Redirect'
+                Channel: 'StasisChannel'
+                context: 'default'
+                exten: 'echo'
+                priority: '1'
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: testsuite
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Newexten
+                    uniqueid: 'StasisChannel'
+                    application: 'Echo'
+            count: 1
+        ami-actions:
+            -
+                action:
+                    action: 'Hangup'
+                    Channel: 'StasisChannel'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Hangup
+                    uniqueid: 'StasisChannel'
+            count: 1
+        stop_test:
+
+properties:
+    minversion: '12.8.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : app_echo
+    tags:
+        - ARI

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/configs/ast1/extensions.conf?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/configs/ast1/extensions.conf Mon Dec  8 09:48:14 2014
@@ -1,0 +1,9 @@
+[default]
+exten => echo,1,Answer()
+same => n,Echo()
+same => n,Hangup()
+
+exten => stasis,1,Answer()
+same => n,Stasis(testsuite)
+same => n,Hangup()
+

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/test-config.yaml?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/test-config.yaml Mon Dec  8 09:48:14 2014
@@ -1,0 +1,111 @@
+testinfo:
+    summary: Test that ensures bridged channels in Stasis() can be stolen properly using AMI Redirect.
+    description: |
+        "This test originates a Local channel into Stasis() and Echo(), puts
+        the Stasis() channel into a bridge, and uses the AMI redirect action
+        to move the Local channel half with uniqueid StasisChannel into
+        default,echo,1 which leads to the Echo() application. Once the channel
+        reaches the Echo() application, it is hung up. This test verifies that
+        the appropriate events are generated."
+
+test-modules:
+    test-object:
+        typename: ari.AriBaseTestObject
+    modules:
+        -
+            config-section: pluggable-config
+            typename: 'pluggable_modules.EventActionModule'
+
+pluggable-config:
+    -
+        ami-start:
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'channels/StasisChannel'
+                params:
+                    endpoint: 'Local/echo at default'
+                    otherChannelId: 'SecondStasisChan'
+                    context: 'default'
+                    extension: 'stasis'
+                    priority: '1'
+            -
+                method: 'post'
+                uri: 'bridges/test_bridge'
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: testsuite
+                args: []
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+        ari-requests:
+            method: 'post'
+            uri: 'bridges/test_bridge/addChannel'
+            params:
+                channel: 'StasisChannel'
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+        ami-actions:
+            action:
+                action: 'Redirect'
+                Channel: 'StasisChannel'
+                context: 'default'
+                exten: 'echo'
+                priority: '1'
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: testsuite
+                channel:
+                    id: 'StasisChannel'
+            count: 1
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Newexten
+                    uniqueid: 'StasisChannel'
+                    application: 'Echo'
+            count: 1
+        ami-actions:
+            -
+                action:
+                    action: 'Hangup'
+                    Channel: 'StasisChannel'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Hangup
+                    uniqueid: 'StasisChannel'
+            count: 1
+        stop_test:
+
+properties:
+    minversion: '12.8.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : res_ari_bridges
+        - asterisk : app_echo
+    tags:
+        - ARI

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/stasis_bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/tests.yaml?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/tests.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/tests.yaml Mon Dec  8 09:48:14 2014
@@ -1,0 +1,3 @@
+tests:
+    - test: 'stasis_bridge'
+    - test: 'stasis_app'

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/attended_transfer.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/attended_transfer.py?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/attended_transfer.py (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/attended_transfer.py Mon Dec  8 09:48:14 2014
@@ -1,0 +1,38 @@
+'''
+Copyright (C) 2014, Digium, Inc.
+Joshua Colp <jcolp at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import logging
+from sys import path
+
+path.append("lib/python/asterisk")
+from sipp import SIPpScenario
+
+LOGGER = logging.getLogger(__name__)
+
+def on_kickoff_start(test_object, triggered_by, ari, event):
+    LOGGER.debug("on_kickoff_start(%r)" % event)
+
+    def _start_referer_scenario(referer_scenario, test_object):
+        referer_scenario.run(test_object)
+
+    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_referee.run(test_object)
+
+    # The 3pcc scenario that first uses sendCmd (sipp_referer) will establish
+    # a TCP socket with the other scenario (sipp_referee). This _must_ start
+    # after sipp_referee - give it a few seconds to get the process off the
+    # ground.
+    from twisted.internet import reactor
+    reactor.callLater(3, _start_referer_scenario, sipp_referer, test_object)
+
+    return True
+

Propchange: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/attended_transfer.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/attended_transfer.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/attended_transfer.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/attended_transfer.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/extensions.conf?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/extensions.conf Mon Dec  8 09:48:14 2014
@@ -1,0 +1,14 @@
+[default]
+
+exten => s,1,NoOp()
+	same => n,Answer()
+	same => n,Stasis(testsuite)
+	same => n,Hangup()
+
+exten => 1000,1,Answer
+	same => n,Echo()
+	same => n,Hangup
+
+exten => stasis,1,NoOp()
+	same => n,Answer()
+	same => n,Stasis(testsuite,test)

Propchange: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/pjsip.conf?view=auto&rev=6047
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_non_stasis_app/configs/ast1/pjsip.conf Mon Dec  8 09:48:14 2014
@@ -1,0 +1,11 @@
+[local]
+type=transport
+protocol=udp
+bind=127.0.0.1:5060
+
+[bob]
+type=endpoint
+context=default
+disallow=all
+allow=ulaw
+direct_media=no


[... 1431 lines stripped ...]



More information about the asterisk-commits mailing list