[asterisk-commits] jbigelow: testsuite/asterisk/trunk r6407 - in /asterisk/trunk/tests/rest_api/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 13 12:54:15 CST 2015


Author: jbigelow
Date: Fri Feb 13 12:54:13 2015
New Revision: 6407

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6407
Log:
Testsuite: Attended transfers from non-Stasis to a Stasis bridge.

This adds the Attended Transfers from non-Stasis to a Stasis bridge tests 1.1
& 1.2 as described on the StasisStart/StasisEnd Test Plan at:
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=30279826

Notes:
* The tests may occasionally fail due to bug ASTERISK-24755.
* These tests constantly fail due to ASTERISK-24782. The YAML config
'expected-result: False' has been set for the tests. Once the bug has been
resolved the config line should be removed from both.

(closes issue ASTERISK-24578)
Review: https://reviewboard.asterisk.org/r/4415/


Added:
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/tests.yaml

Added: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/extensions.conf?view=auto&rev=6407
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/extensions.conf Fri Feb 13 12:54:13 2015
@@ -1,0 +1,16 @@
+[default]
+
+exten => dummy,1,NoOp()
+	same => n,Answer()
+	same => n,Stasis(testsuite,dummy)
+	same => n,Hangup()
+
+exten => echo,1,Answer
+	same => n,Echo()
+	same => n,Hangup
+
+exten => stasis,1,NoOp()
+	same => n,Answer()
+	same => n,Stasis(testsuite,test)
+	same => n,Hangup
+

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

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

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

Added: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/pjsip.conf?view=auto&rev=6407
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/pjsip.conf Fri Feb 13 12:54:13 2015
@@ -1,0 +1,40 @@
+[global]
+type=global
+debug=yes
+
+[system]
+type=system
+
+[local]
+type=transport
+protocol=udp
+bind=127.0.0.1:5060
+
+[alice]
+type=endpoint
+context=default
+disallow=all
+allow=ulaw
+direct_media=no
+media_address=127.0.0.1
+aors=alice
+
+[alice]
+type=aor
+max_contacts=1
+contact=sip:alice at 127.0.0.1:5061\;transport=udp
+
+[bob]
+type=endpoint
+context=default
+disallow=all
+allow=ulaw
+direct_media=no
+media_address=127.0.0.1
+aors=bob
+
+[bob]
+type=aor
+max_contacts=1
+contact=sip:bob at 127.0.0.1:5062\;transport=udp
+

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

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

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

Added: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/test-config.yaml?view=auto&rev=6407
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/test-config.yaml Fri Feb 13 12:54:13 2015
@@ -1,0 +1,309 @@
+testinfo:
+    summary: "Transfer (attended) non-Stasis app to Stasis bridge"
+    description: |
+        "Upon the kick off local channel entering into the Stasis(testsuite)
+         app, the Stasis bridge 'test_bridge' is created. A call is made from
+         the 'alice' PJSUA account and put into the Echo() app. Alice begins
+         an attended transfer by making another call that is put into the
+         Stasis(testsuite) app and then added to the 'test_bridge' stasis
+         bridge. A channel is then originated to the 'bob' PJSUA account and
+         put into the same Stasis(testsuite) app and added to the 'test_bridge'
+         stasis bridge with the second call from alice.
+
+         Alice then completes the attended transfer essentially transferring
+         the Echo() app to the Stasis bridge. Asterisk does this by creating a
+         Local channel where half masquerades into the Echo() app and the other
+         half is swapped with the channel of the second call from alice. After
+         the transfer is successful with the local replacement channel half in
+         the 'test_bridge' stasis bridge with bob, bob is hung up. This then
+         initiates the tear down of the local channels and destruction of the
+         stasis bridge.
+
+         This test verifies that a non-Stasis app can be transferred (attended)
+         to a Stasis bridge. It also verifies that the StasisStart & StasisEnd
+         events occur for the alice, bob, and local replacement channels."
+    issues:
+        - jira: 'ASTERISK-24782'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'ari.AriOriginateTestObject'
+    modules:
+        -
+            config-section: 'pjsua-config'
+            typename: 'phones.PjsuaPhoneController'
+        -
+            config-section: pluggable-config
+            typename: 'pluggable_modules.EventActionModule'
+
+test-object-config:
+    apps: testsuite
+    test-iterations:
+        -
+            channelId: 'dummy'
+            endpoint: 'Local/dummy at default'
+            context: 'default'
+            extension: 'echo'
+            priority: '1'
+
+pjsua-config:
+    transports:
+        -
+            name: 'local-ipv4-1'
+            bind: '127.0.0.1'
+            bindport: '5061'
+        -
+            name: 'local-ipv4-2'
+            bind: '127.0.0.1'
+            bindport: '5062'
+    accounts:
+        -
+            name: 'alice'
+            username: 'alice'
+            domain: '127.0.0.1'
+            transport: 'local-ipv4-1'
+        -
+            name: 'bob'
+            username: 'bob'
+            domain: '127.0.0.1'
+            transport: 'local-ipv4-2'
+
+pluggable-config:
+    # Upon kickoff channel entering Stasis app: create a bridge, don't add
+    # kickoff channel to bridge, instruct alice to place call into Echo().
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: ['dummy']
+                channel:
+                    id: 'dummy;2'
+            count: 1
+        ari-requests:
+            method: 'post'
+            uri: 'bridges/test_bridge'
+        pjsua_phone:
+            action: 'call'
+            pjsua_account: 'alice'
+            call_uri: 'sip:echo at 127.0.0.1'
+    # Ensure alice's first channel is answered. Then instruct alice to place a
+    # call into Stasis(testsuite,test).
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Newexten'
+                    Channel: 'PJSIP/alice-.*'
+                    ChannelStateDesc: 'Up'
+                    Application: 'Echo'
+            count: 1
+        pjsua_phone:
+            action: 'call'
+            pjsua_account: 'alice'
+            call_uri: 'sip:stasis at 127.0.0.1'
+    # Upon alice entering the Stasis app: add the channel to the bridge and
+    # originate a call to bob.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: ['test']
+                channel:
+                    name: 'PJSIP/alice-.*'
+            count: 1
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'bridges/test_bridge/addChannel'
+                params:
+                    channel: '{channel.id}'
+            -
+                method: 'post'
+                uri: 'channels/bob'
+                params:
+                    endpoint: 'PJSIP/bob'
+                    context: 'default'
+                    extension: 'stasis'
+                    priority: '1'
+    # Ensure alice enters the Stasis bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'PJSIP/alice-.*'
+                application: 'testsuite'
+            count: 1
+    # Upon bob entering Stasis app: add the channel to the bridge.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: ['test']
+                channel:
+                    name: 'PJSIP/bob-.*'
+            count: 1
+        ari-requests:
+            method: 'post'
+            uri: 'bridges/test_bridge/addChannel'
+            params:
+                channel: '{channel.id}'
+    # Ensure bob enters the Stasis bridge. Then instruct alice to perform an
+    # attended transfer. This is to transfer the remote side of the first
+    # channel which is Echo() to the remote side of the second channel which
+    # is the Stasis bridge. Essentially bob will be in the stasis bridge with a
+    # local channel that is in the Echo() app.
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'PJSIP/bob-.*'
+                application: 'testsuite'
+            count: 1
+        pjsua_phone:
+            action: 'transfer'
+            pjsua_account: 'alice'
+            transfer_type: 'attended'
+    # Ensure the attended transfer occurs with the proper info.
+    -
+        ari-events:
+            match:
+                type: BridgeAttendedTransfer
+                application: 'testsuite'
+                transferer_first_leg:
+                    name: 'PJSIP/alice-.*'
+                transferer_second_leg:
+                    name: 'PJSIP/alice-.*'
+                transferer_second_leg_bridge:
+                    id: 'test_bridge'
+                replace_channel:
+                    name: 'Local/_attended at transfer-.*'
+                result: 'Success'
+            count: 1
+    # Ensure the local channel half for the transfer that is replacing Alice's
+    # channel enters the Stasis(testsuite) application.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: []
+                channel:
+                    name: 'Local/_attended at transfer-.*'
+                replace_channel:
+                    name: 'PJSIP/alice-.*'
+            count: 1
+    # Ensure alice leaves the Stasis bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                application: 'testsuite'
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'PJSIP/alice-.*'
+            count: 1
+    # Ensure the local channel half for the transfer enters the Stasis bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                application: 'testsuite'
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'Local/_attended at transfer-.*'
+            count: 1
+    # Ensure the alice channel exits the Stasis app. Then hang up bob.
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'testsuite'
+                channel:
+                    name: 'PJSIP/alice-.*'
+            count: 1
+        ami-actions:
+            action:
+               action: 'Hangup'
+               channel: '/^PJSIP/bob-.*$/'
+    # Upon hanging up bob, ensure bob leaves the bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                application: 'testsuite'
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'PJSIP/bob-.*'
+            count: 1
+    # Ensure bob exits the Stasis app.
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'testsuite'
+                channel:
+                    name: 'PJSIP/bob-.*'
+            count: 1
+    # Ensure the bridged local channel half used for the transfer leaves the
+    # bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                application: 'testsuite'
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'Local/_attended at transfer-.*'
+            count: 1
+    # Ensure the bridged local channel half used for the transfer exits the
+    # Stasis app. Then hang up the kickoff local channel halves and destroy
+    # the bridge.
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'testsuite'
+                channel:
+                    name: 'Local/_attended at transfer-.*'
+            count: 1
+        ami-actions:
+            action:
+               action: 'Hangup'
+               channel: '/^Local/dummy at default-.*;2$/'
+        ari-requests:
+            method: 'delete'
+            uri: 'bridges/test_bridge'
+
+properties:
+    minversion: '13.1.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - python : pjsua
+        - asterisk : app_stasis
+        - asterisk : app_echo
+        - asterisk : res_ari_channels
+        - asterisk : res_ari_bridges
+        - asterisk : res_pjsip
+    tags:
+        - ARI
+        - pjsip
+    # Expect test to fail until ASTERISK-24782 is resolved.
+    expected-result: False
+

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

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

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

Added: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/extensions.conf?view=auto&rev=6407
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/extensions.conf Fri Feb 13 12:54:13 2015
@@ -1,0 +1,20 @@
+[default]
+
+exten => dummy,1,NoOp()
+	same => n,Answer()
+	same => n,Stasis(testsuite,dummy)
+	same => n,Hangup()
+
+exten => echo,1,Answer
+        same => n,Echo()
+        same => n,Hangup
+
+exten => bob,1,NoOp()
+	same => n,Dial(PJSIP/bob)
+	same => n,Hangup
+
+exten => stasis,1,NoOp()
+	same => n,Answer()
+	same => n,Stasis(testsuite,test)
+	same => n,Hangup
+

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

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

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

Added: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/pjsip.conf?view=auto&rev=6407
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/pjsip.conf Fri Feb 13 12:54:13 2015
@@ -1,0 +1,54 @@
+[global]
+type=global
+debug=yes
+
+[system]
+type=system
+
+[local]
+type=transport
+protocol=udp
+bind=127.0.0.1:5060
+
+[alice]
+type=endpoint
+context=default
+disallow=all
+allow=ulaw
+direct_media=no
+media_address=127.0.0.1
+aors=alice
+
+[alice]
+type=aor
+max_contacts=1
+contact=sip:alice at 127.0.0.1:5061\;transport=udp
+
+[bob]
+type=endpoint
+context=default
+disallow=all
+allow=ulaw
+direct_media=no
+media_address=127.0.0.1
+aors=bob
+
+[bob]
+type=aor
+max_contacts=1
+contact=sip:bob at 127.0.0.1:5062\;transport=udp
+
+[carol]
+type=endpoint
+context=default
+disallow=all
+allow=ulaw
+direct_media=no
+media_address=127.0.0.1
+aors=carol
+
+[carol]
+type=aor
+max_contacts=1
+contact=sip:carol at 127.0.0.1:5063\;transport=udp
+

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

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

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

Added: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml?view=auto&rev=6407
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml Fri Feb 13 12:54:13 2015
@@ -1,0 +1,398 @@
+testinfo:
+    summary: "Transfer (attended) non-Stasis bridge to Stasis bridge"
+    description: |
+        "Upon the kick off local channel entering into the Stasis(testsuite)
+         app, a call is made from the 'alice' PJSUA account that executes the
+         Dial() app and calls the 'bob' PJSUA account. Once alice and bob are
+         in a non-Stasis bridge, alice begins an attended transfer by making
+         another call. The second alice channel is put into the
+         Stasis(testsuite) app, the Stasis bridge 'test_bridge' is created, and
+         the second alice channel is added to Stasis bridge. A channel is then
+         originated to the 'carol' PJSUA account and put into the same
+         Stasis(testsuite) app and added to the Stasis bridge 'test_bridge'
+         with the second alice channel.
+
+         Alice then completes the attended transfer essentially transferring
+         the non-Stasis bridge to the Stasis bridge. Asterisk does this by
+         creating a Local channel where each half is swapped in place of the
+         two alice channels. After the transfer is successful with a local
+         replacement channel half in the non-Stasis bridge with bob and another
+         in the Stasis bridge with carol, bob is hung up. This then initiates
+         the hang up of the local replacement channel half that was in the
+         non-Stasis bridge with bob and the hang up of the local replacement
+         channel half that was in the Stasis bridge with carol. Carol is then
+         hung up which initiates the hung up of the kick off local channel and
+         the destruction of the stasis bridge.
+
+         This test verifies that a non-Stasis bridge can be transferred
+         (attended) to a Stasis bridge. It also verifies that the StasisStart &
+         StasisEnd events occur for the alice(second), carol, and local
+         replacement channels."
+    issues:
+        - jira: 'ASTERISK-24782'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'ari.AriOriginateTestObject'
+    modules:
+        -
+            config-section: 'pjsua-config'
+            typename: 'phones.PjsuaPhoneController'
+        -
+            config-section: pluggable-config
+            typename: 'pluggable_modules.EventActionModule'
+
+test-object-config:
+    apps: testsuite
+    test-iterations:
+        -
+            channelId: 'dummy'
+            endpoint: 'Local/dummy at default'
+            context: 'default'
+            extension: 'echo'
+            priority: '1'
+
+pjsua-config:
+    transports:
+        -
+            name: 'local-ipv4-1'
+            bind: '127.0.0.1'
+            bindport: '5061'
+        -
+            name: 'local-ipv4-2'
+            bind: '127.0.0.1'
+            bindport: '5062'
+        -
+            name: 'local-ipv4-3'
+            bind: '127.0.0.1'
+            bindport: '5063'
+    accounts:
+        -
+            name: 'alice'
+            username: 'alice'
+            domain: '127.0.0.1'
+            transport: 'local-ipv4-1'
+        -
+            name: 'bob'
+            username: 'bob'
+            domain: '127.0.0.1'
+            transport: 'local-ipv4-2'
+        -
+            name: 'carol'
+            username: 'carol'
+            domain: '127.0.0.1'
+            transport: 'local-ipv4-3'
+
+pluggable-config:
+    # Upon kickoff channel entering Stasis app: create a bridge, don't add
+    # kickoff channel to bridge, instruct alice to place call to bob via the
+    # Dial() app.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: ['dummy']
+                channel:
+                    id: 'dummy;2'
+            count: 1
+        pjsua_phone:
+            action: 'call'
+            pjsua_account: 'alice'
+            call_uri: 'sip:bob at 127.0.0.1'
+    # Ensure alice's first channel and bob are bridged. Then instruct alice to
+    # place another call, this time into Stasis(testsuite).
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'BridgeEnter'
+                    Channel: 'PJSIP/(alice|bob)-.*'
+                    BridgeNumChannels: '2'
+            count: 1
+        pjsua_phone:
+            action: 'call'
+            pjsua_account: 'alice'
+            call_uri: 'sip:stasis at 127.0.0.1'
+
+    # Upon alice entering the Stasis app: create the stasis bridge
+    # 'test_bridge', add  alice's second channel to the Stasis bridge, and
+    # originate a call to carol.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: ['test']
+                channel:
+                    name: 'PJSIP/alice-.*'
+            count: 1
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'bridges/test_bridge'
+            -
+                method: 'post'
+                uri: 'bridges/test_bridge/addChannel'
+                params:
+                    channel: '{channel.id}'
+            -
+                method: 'post'
+                uri: 'channels/carol'
+                params:
+                    endpoint: 'PJSIP/carol'
+                    context: 'default'
+                    extension: 'stasis'
+                    priority: '1'
+    # Ensure alice's second channel enters the Stasis bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'PJSIP/alice-.*'
+                application: 'testsuite'
+            count: 1
+    # Ensure carol enters the Stasis app. Then add carol to the Stasis bridge
+    # with alice's second channel.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: ['test']
+                channel:
+                    name: 'PJSIP/carol-.*'
+            count: 1
+        ari-requests:
+            method: 'post'
+            uri: 'bridges/test_bridge/addChannel'
+            params:
+                channel: '{channel.id}'
+    # Ensure carol enters the Stasis bridge. Then instruct alice to perform an
+    # attended transfer. This is to transfer the remote side of the first
+    # channel which is a non-Stasis bridge to the remote side of the second
+    # channel which is a Stasis bridge. Essentially bob will be in the
+    # non-Stasis bridge, carol will be in the Stasis bridge, and the halves of
+    # a local channel will be in each thus linking the non-Stasis bridge with
+    # the Stasis bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'PJSIP/carol-.*'
+                application: 'testsuite'
+            count: 1
+        pjsua_phone:
+            action: 'transfer'
+            pjsua_account: 'alice'
+            transfer_type: 'attended'
+    # Ensure the attended transfer occurs with the proper info.
+    -
+        ari-events:
+            match:
+                type: BridgeAttendedTransfer
+                application: 'testsuite'
+                transferer_first_leg:
+                    name: 'PJSIP/alice-.*'
+                transferer_first_leg_bridge:
+                    bridge_class: 'basic'
+                transferer_second_leg:
+                    name: 'PJSIP/alice-.*'
+                transferer_second_leg_bridge:
+                    id: 'test_bridge'
+                    bridge_class: 'stasis'
+                transferee:
+                    name: 'PJSIP/bob-.*'
+                transfer_target:
+                    id: 'carol'
+                destination_type: 'link'
+                destination_link_first_leg:
+                    name: 'Local/_attended at transfer-.*;1'
+                destination_link_second_leg:
+                    name: 'Local/_attended at transfer-.*;2'
+                result: 'Success'
+            count: 1
+    # Ensure alice's first channel leaves the non-Stasis bridge.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'BridgeLeave'
+                    Channel: 'PJSIP/alice-.*'
+                nomatch:
+                    BridgeUniqueid: 'test_bridge'
+            count: 1
+    # Ensure alice's first channel is hung up.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Hangup'
+                    Channel: 'PJSIP/alice-.*'
+                    ConnectedLineNum: 'bob'
+            count: 1
+    # Ensure the local channel half for the transfer that is replacing alice's
+    # second channel enters the Stasis(testsuite) application.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: []
+                channel:
+                    name: 'Local/_attended at transfer-.*;2'
+                replace_channel:
+                    name: 'PJSIP/alice-.*'
+            count: 1
+    # Ensure alice's second channel leaves the Stasis bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                application: 'testsuite'
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'PJSIP/alice-.*'
+            count: 1
+    # Ensure the local channel half for the transfer enters the Stasis bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                application: 'testsuite'
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'Local/_attended at transfer-.*;2'
+            count: 1
+    # Ensure alice's second channel exits the Stasis app. Then hang up bob.
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'testsuite'
+                channel:
+                    name: 'PJSIP/alice-.*'
+            count: 1
+        ami-actions:
+            action:
+               action: 'Hangup'
+               channel: '/^PJSIP/bob-.*$/'
+    # Upon hanging up bob, ensure bob leaves the non-Stasis bridge and is hung
+    # up.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'BridgeLeave'
+                    Channel: 'PJSIP/bob-.*'
+                nomatch:
+                    BridgeUniqueid: 'test_bridge'
+            count: 1
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Hangup'
+                    Channel: 'PJSIP/bob-.*'
+            count: 1
+    # Ensure the local channel half that was bridged with bob in the non-Stasis
+    # bridge leaves the bridge and is hung up.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'BridgeLeave'
+                    Channel: 'Local/_attended-.*;1'
+                nomatch:
+                    BridgeUniqueid: 'test_bridge'
+            count: 1
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Hangup'
+                    Channel: 'Local/_attended-.*;1'
+            count: 1
+    # Ensure the local channel half in Stasis bridge with carol leaves the
+    # bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                application: 'testsuite'
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'Local/_attended-.*;2'
+            count: 1
+    # Ensure the local channel half in Stasis bridge with carol exits the
+    # Stasis app. Then hang up carol.
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'testsuite'
+                channel:
+                    name: 'Local/_attended-.*;2'
+            count: 1
+        ari-requests:
+            method: 'delete'
+            uri: 'channels/carol'
+    # Ensure carol leaves the Stasis bridge.
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                application: 'testsuite'
+                bridge:
+                    id: 'test_bridge'
+                channel:
+                    name: 'PJSIP/carol-.*'
+            count: 1
+    # Ensure carol exits the Stasis app. Then hang up the kickoff local channel
+    # halves and destroy the Stasis bridge.
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'testsuite'
+                channel:
+                    name: 'PJSIP/carol-.*'
+            count: 1
+        ami-actions:
+            action:
+               action: 'Hangup'
+               channel: '/^Local/dummy at default-.*;2$/'
+        ari-requests:
+            method: 'delete'
+            uri: 'bridges/test_bridge'
+
+properties:
+    minversion: '13.1.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - python : pjsua
+        - asterisk : app_stasis
+        - asterisk : app_echo
+        - asterisk : app_dial
+        - asterisk : res_ari_channels
+        - asterisk : res_ari_bridges
+        - asterisk : res_pjsip
+    tags:
+        - ARI
+        - pjsip
+    # Expect test to fail until ASTERISK-24782 is resolved.
+    expected-result: False
+

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

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

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

Modified: asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/tests.yaml?view=diff&rev=6407&r1=6406&r2=6407
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/tests.yaml (original)
+++ asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/tests.yaml Fri Feb 13 12:54:13 2015
@@ -1,4 +1,6 @@
 tests:
     - test: 'stasis_bridge_to_non_stasis_app'
     - test: 'stasis_bridge_to_stasis_app'
+    - test: 'non_stasis_app_to_stasis_bridge'
+    - test: 'non_stasis_bridge_to_stasis_bridge'
 




More information about the asterisk-commits mailing list