[svn-commits] kmoore: testsuite/asterisk/trunk r4428 - /asterisk/trunk/tests/apps/bridge/br...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Dec 11 09:04:58 CST 2013


Author: kmoore
Date: Wed Dec 11 09:04:52 2013
New Revision: 4428

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4428
Log:
Fix a bouncing test by ensuring that the correct channel is hung up

Modified:
    asterisk/trunk/tests/apps/bridge/bridge_transfer_callee/run-test

Modified: asterisk/trunk/tests/apps/bridge/bridge_transfer_callee/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/bridge/bridge_transfer_callee/run-test?view=diff&rev=4428&r1=4427&r2=4428
==============================================================================
--- asterisk/trunk/tests/apps/bridge/bridge_transfer_callee/run-test (original)
+++ asterisk/trunk/tests/apps/bridge/bridge_transfer_callee/run-test Wed Dec 11 09:04:52 2013
@@ -28,7 +28,7 @@
         self.current_test = 0
         self.total_tests = 4
         self.create_asterisk()
-        self.channel1 = None
+        self.hangup_channel = None
 
     def run(self):
         TestCase.run(self)
@@ -103,15 +103,18 @@
             LOGGER.error("A bridge failed. That's rather abnormal.")
 
     def bridge_enter_event(self, ami, event):
-        if self.channel1 is None:
-            self.channel1 = event['channel']
-            LOGGER.info("Got first channel %s in bridge %s" % (self.channel1, event['bridgeuniqueid']))
+        if self.hangup_channel is None:
+            self.hangup_channel = event['channel']
+            LOGGER.info("Got first channel %s in bridge %s" % (self.hangup_channel, event['bridgeuniqueid']))
             return
 
+        if self.hangup_channel.find("call2") == -1:
+            self.hangup_channel = event['channel']
+
         LOGGER.info("Got second channel %s in bridge %s, hanging up %s" %
-            (event['channel'], event['bridgeuniqueid'], self.channel1))
-        ami.hangup(self.channel1)
-        self.channel1 = None
+            (event['channel'], event['bridgeuniqueid'], self.hangup_channel))
+        ami.hangup(self.hangup_channel)
+        self.hangup_channel = None
 
     def match_starts(self, string1, string2):
         pattern = re.compile(string1)




More information about the svn-commits mailing list