[asterisk-commits] mmichelson: testsuite/asterisk/trunk r3580 - /asterisk/trunk/lib/python/aster...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 19 16:27:29 CST 2012


Author: mmichelson
Date: Wed Dec 19 16:27:25 2012
New Revision: 3580

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3580
Log:
Delay hanging up calls in bridge tests if the calls are not currently bridged.

This is expected to clear up some timing-related failures Jonathan Rose is
seeing while developing automon tests. The suspicion is that the hangup is
being issued while the bridge is broken and the automon is being stopped.
If we wait until the bridge is re-formed, then the hangup should be handled
properly.

The only reason this is required is due to two issues being seen in the test

1) Sometimes there is no BRIDGE_END CEL event issued.
2) When the hangup is issued while the bridge is broken, the CEL HANGUP event
   has incorrect hangupsource set.


Modified:
    asterisk/trunk/lib/python/asterisk/BridgeTestCase.py

Modified: asterisk/trunk/lib/python/asterisk/BridgeTestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/BridgeTestCase.py?view=diff&rev=3580&r1=3579&r2=3580
==============================================================================
--- asterisk/trunk/lib/python/asterisk/BridgeTestCase.py (original)
+++ asterisk/trunk/lib/python/asterisk/BridgeTestCase.py Wed Dec 19 16:27:25 2012
@@ -117,6 +117,7 @@
         self.uut_bob_hungup = False
         self.current_feature = 0
         self.infeatures = False
+        self.issue_hangups_on_bridged = False
 
         # Step 1: Initiate a call from Alice to Bob
         LOGGER.info("Originating call")
@@ -176,6 +177,8 @@
             LOGGER.debug("Bridge is up")
             LOGGER.debug("Type of bridge is %s" % event.get('bridgetype'))
             self.bridged = True
+            if self.issue_hangups_on_bridged:
+                self.send_hangup()
         else:
             LOGGER.debug("Bridge is down")
             self.bridged = False
@@ -289,6 +292,11 @@
             LOGGER.info("No hangup set. Hang up will happen externally")
             return
 
+        if not self.bridged:
+            LOGGER.info("Delaying hangup until call is re-bridged")
+            self.issue_hangups_on_bridged = True
+            return
+
         LOGGER.info("Sending a hangup to %s" % self.hangup)
         if self.hangup == 'alice':
             ami = self.ami_alice




More information about the asterisk-commits mailing list