[Asterisk-code-review] rest_api/bridges/softmix_unhold - add test (testsuite[16])

Kevin Harwell asteriskteam at digium.com
Mon Nov 18 11:07:22 CST 2019


Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/13221 )


Change subject: rest_api/bridges/softmix_unhold - add test
......................................................................

rest_api/bridges/softmix_unhold - add test

Add a test to make sure a channel is taken off of hold when it enters a
softmix bridge.

ASTERISK-28618

Change-Id: I5aa63dd3474429eadce756dd9a4715ef89f89e12
---
A tests/rest_api/bridges/softmix_unhold/configs/ast1/extensions.conf
A tests/rest_api/bridges/softmix_unhold/test-config.yaml
M tests/rest_api/bridges/tests.yaml
3 files changed, 144 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/21/13221/1

diff --git a/tests/rest_api/bridges/softmix_unhold/configs/ast1/extensions.conf b/tests/rest_api/bridges/softmix_unhold/configs/ast1/extensions.conf
new file mode 100644
index 0000000..59c7f03
--- /dev/null
+++ b/tests/rest_api/bridges/softmix_unhold/configs/ast1/extensions.conf
@@ -0,0 +1,6 @@
+[default]
+
+exten => s,1,NoOp()
+	same => n,Answer()
+	same => n,Echo()
+	same => n,Hangup()
diff --git a/tests/rest_api/bridges/softmix_unhold/test-config.yaml b/tests/rest_api/bridges/softmix_unhold/test-config.yaml
new file mode 100644
index 0000000..a85b119
--- /dev/null
+++ b/tests/rest_api/bridges/softmix_unhold/test-config.yaml
@@ -0,0 +1,137 @@
+testinfo:
+    summary: 'Test channel unhold when bridge transitions to softmix'
+    description: |
+        This tests that a channel on hold is taken off hold if the bridge
+        it's currently in transitions to softmix.
+
+        Add two channels to a mixing bridge. Then put one channel on hold.
+        Lastly, add a third channel to the bridge, and make sure the
+        appropriate unhold events are raised signifying that the channel
+        was take off of hold.
+
+properties:
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : app_echo
+    tags:
+        - ARI
+
+test-modules:
+    test-object:
+        config-section: test-object
+        typename: ari.AriBaseTestObject
+    modules:
+        -   typename: pluggable_modules.EventActionModule
+            config-section: event-actions
+
+test-object:
+    reactor-timeout: 15
+    subscribe-all: True
+
+event-actions:
+    -
+        ari-start:
+        ari-requests:
+            -
+                # Make sure we have a bridge to put everyone in
+                method: 'post'
+                uri: 'bridges/lebridge'
+                params:
+                    app: 'testsuite'
+            -
+                # Go ahead and originate alice
+                method: 'post'
+                uri: 'channels'
+                params:
+                    app: 'testsuite'
+                    endpoint: 'Local/s at default'
+                    channelId: 'alice'
+            -
+                # Go ahead and originate bob
+                method: 'post'
+                uri: 'channels'
+                params:
+                    app: 'testsuite'
+                    endpoint: 'Local/s at default'
+                    channelId: 'bob'
+    -
+        ari-events:
+            match:
+                type: 'StasisStart'
+                application: 'testsuite'
+                channel:
+                    id: 'alice|bob'
+            count: 2
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'bridges/lebridge/addChannel'
+                params:
+                    channel: '{channel.id}'
+    -
+        ari-events:
+            match:
+                type: 'ChannelEnteredBridge'
+                channel:
+                    id: 'alice'
+            count: 1
+        ari-requests:
+            -
+                # Once alice is in the bridge apply the hold
+                method: 'post'
+                uri: 'channels/alice/hold'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'MusicOnHoldStart'
+                    Uniqueid: 'alice'
+            count: 1
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'channels'
+                params:
+                    app: 'testsuite'
+                    endpoint: 'Local/s at default'
+                    channelId: 'charlie'
+    -
+        ari-events:
+            match:
+                type: 'StasisStart'
+                application: 'testsuite'
+                channel:
+                    id: 'charlie'
+            count: 1
+        ari-requests:
+            -
+                # Adding charlie will switch the bridging tech to softmix
+                method: 'post'
+                uri: 'bridges/lebridge/addChannel'
+                params:
+                    channel: '{channel.id}'
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'MusicOnHoldStop'
+                    Uniqueid: 'alice'
+            count: 1
+        ari-requests:
+            -
+                method: 'delete'
+                uri: 'channels/alice'
+            -
+                method: 'delete'
+                uri: 'channels/bob'
+            -
+                method: 'delete'
+                uri: 'channels/charlie'
+            -
+                method: 'delete'
+                uri: 'bridges/lebridge'
+        stop_test:
diff --git a/tests/rest_api/bridges/tests.yaml b/tests/rest_api/bridges/tests.yaml
index 791faad..9a3f1de 100644
--- a/tests/rest_api/bridges/tests.yaml
+++ b/tests/rest_api/bridges/tests.yaml
@@ -11,4 +11,5 @@
     - test: 'id_propagate'
     - test: 'no_id_propagate'
     - dir: 'playback'
+    - test: 'softmix_unhold'
     - test: 'video'

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/13221
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 16
Gerrit-Change-Id: I5aa63dd3474429eadce756dd9a4715ef89f89e12
Gerrit-Change-Number: 13221
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191118/b8d36f4c/attachment-0001.html>


More information about the asterisk-code-review mailing list