[Asterisk-code-review] Change in testsuite[master]: non_stasis_bridge_to_stasis_bridge: hangup race
Matt Jordan (Code Review)
asteriskteam at digium.com
Thu Apr 16 13:11:35 CDT 2015
Matt Jordan has submitted this change and it was merged.
Change subject: non_stasis_bridge_to_stasis_bridge: hangup race
......................................................................
non_stasis_bridge_to_stasis_bridge: hangup race
During the transfer process there is a chance for a hang up to occur on the
channel being transfered (in this case bob) but before the transfer has time
to fully complete. If this happens not all expected events are raised, thus
not received. Addressed the possibility of this scenario occurring by adjusting
the expected events in question to accept at most one of the event, consequently
allowing zero as well.
ASTERISK-24782 #close
Reported by: John Bigelow
Review: https://gerrit.asterisk.org/#/c/125/
Change-Id: Ic4ef9fff4830670137dbfb587f30eaf33a43a2d6
---
M tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml
1 file changed, 34 insertions(+), 29 deletions(-)
Approvals:
Matt Jordan: Looks good to me, approved; Verified
diff --git a/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml b/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml
index 2ec68b6..b350152 100644
--- a/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml
+++ b/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml
@@ -1,7 +1,12 @@
testinfo:
summary: "Transfer (attended) non-Stasis bridge to Stasis bridge"
description: |
- "Upon the kick off local channel entering into the Stasis(testsuite)
+ "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.
+
+ 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
@@ -12,24 +17,23 @@
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.
+ In the nominal scenario, 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 also 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'
+ However, it is possible, and valid, for alice to send a 'bye' to bob
+ immediately after the refer has been received. If this occurs bob is
+ hung up and the transfer process stops. The expected transfer events
+ are thus not raised and received. This test accounts for this
+ possibility."
test-modules:
test-object:
@@ -218,7 +222,7 @@
destination_link_second_leg:
name: 'Local/_attended at transfer-.*;2'
result: 'Success'
- count: 1
+ count: <1
# Ensure alice's first channel leaves the non-Stasis bridge.
-
ami-events:
@@ -250,7 +254,7 @@
name: 'Local/_attended at transfer-.*;2'
replace_channel:
name: 'PJSIP/alice-.*'
- count: 1
+ count: <1
# Ensure alice's second channel leaves the Stasis bridge.
-
ari-events:
@@ -272,7 +276,7 @@
id: 'test_bridge'
channel:
name: 'Local/_attended at transfer-.*;2'
- count: 1
+ count: <1
# Ensure alice's second channel exits the Stasis app. Then hang up bob.
-
ari-events:
@@ -297,6 +301,7 @@
nomatch:
BridgeUniqueid: 'test_bridge'
count: 1
+ # Once bob is hungup, hang up carol as well.
-
ami-events:
conditions:
@@ -304,6 +309,9 @@
Event: 'Hangup'
Channel: 'PJSIP/bob-.*'
count: 1
+ ari-requests:
+ method: 'delete'
+ uri: 'channels/carol'
# Ensure the local channel half that was bridged with bob in the non-Stasis
# bridge leaves the bridge and is hung up.
-
@@ -314,14 +322,14 @@
Channel: 'Local/_attended at transfer-.*;1'
nomatch:
BridgeUniqueid: 'test_bridge'
- count: 1
+ count: <1
-
ami-events:
conditions:
match:
Event: 'Hangup'
Channel: 'Local/_attended at transfer-.*;1'
- count: 1
+ count: <1
# Ensure the local channel half in Stasis bridge with carol leaves the
# bridge.
-
@@ -333,9 +341,9 @@
id: 'test_bridge'
channel:
name: 'Local/_attended at transfer-.*;2'
- count: 1
+ count: <1
# Ensure the local channel half in Stasis bridge with carol exits the
- # Stasis app. Then hang up carol.
+ # Stasis app.
-
ari-events:
match:
@@ -343,10 +351,7 @@
application: 'testsuite'
channel:
name: 'Local/_attended at transfer-.*;2'
- count: 1
- ari-requests:
- method: 'delete'
- uri: 'channels/carol'
+ count: <1
# Ensure carol leaves the Stasis bridge.
-
ari-events:
--
To view, visit https://gerrit.asterisk.org/125
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic4ef9fff4830670137dbfb587f30eaf33a43a2d6
Gerrit-PatchSet: 2
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: John Bigelow <jbigelow at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
More information about the asterisk-code-review
mailing list