[asterisk-commits] Fix test: callee initiated attended transfer w/Replaces, dir... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 8 08:11:29 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: Fix test: callee initiated attended transfer w/Replaces, direct media, hold
......................................................................


Fix test: callee initiated attended transfer w/Replaces, direct media, hold

The test has been bouncing due to an additional occurrence of an event.
This should fix the test from bouncing by allowing more than one
occurrence of the event while only performing the hold on the first
occurrence.

This also clarifies the docstring regarding the 'trigger-on-count'
option for the event action module.

ASTERISK-25149 #close
Reported by Joshua Colp

Change-Id: I44d232dc281ac4b4b136f8dba0f578dc5de591d8
---
M lib/python/asterisk/ami.py
M tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local_direct_media/test-config.yaml
2 files changed, 8 insertions(+), 2 deletions(-)

Approvals:
  Matt Jordan: Looks good to me, approved; Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/lib/python/asterisk/ami.py b/lib/python/asterisk/ami.py
index 3cbeeaf..365d206 100644
--- a/lib/python/asterisk/ami.py
+++ b/lib/python/asterisk/ami.py
@@ -675,7 +675,10 @@
     Events can be set to 'trigger-on-count' meaning (when set to True) the
     trigger callback will not be called until the min count is reached. For
     event/actions this means actions won't be executed until an event reaches
-    its specified count.
+    its specified count. If the configured count allows for an infinite max
+    (ie. '>1'), the actions will only be executed upon the minimum count being
+    reached. Additional occurrences of the event will not trigger the actions
+    again.
     """
 
     def __init__(self, test_object, triggered_callback, config, data):
diff --git a/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local_direct_media/test-config.yaml b/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local_direct_media/test-config.yaml
index 898660f..2ca69b8 100644
--- a/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local_direct_media/test-config.yaml
+++ b/tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local_direct_media/test-config.yaml
@@ -88,6 +88,8 @@
             pjsua_account: 'alice'
             call_uri: 'sip:101 at 127.0.0.1'
     # Ensure alice and bob are remotely bridged. Then bob places alice on hold.
+    # The remote bridge may be setup twice depending on how fast things occur
+    # but the hold is only executed upon the first occurrence of the event.
     -
         ami-events:
             conditions:
@@ -96,7 +98,8 @@
                     UserEvent: 'RemoteRTPBridgeStarted'
                     Endpoint1: '(bob|alice)'
                     Endpoint2: '(bob|alice)'
-            count: 1
+            count: '>1'
+            trigger-on-count: True
         pjsua_phone:
             action: 'hold'
             pjsua_account: 'bob'

-- 
To view, visit https://gerrit.asterisk.org/597
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I44d232dc281ac4b4b136f8dba0f578dc5de591d8
Gerrit-PatchSet: 3
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: John Bigelow <jbigelow at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list