[asterisk-commits] mjordan: testsuite/asterisk/trunk r3066 - /asterisk/trunk/tests/channels/SIP/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Feb 26 17:21:15 CST 2012


Author: mjordan
Date: Sun Feb 26 17:21:11 2012
New Revision: 3066

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3066
Log:
Update SIP one legged transfer to be tolerant of multiple channel status results

Same problem as the SIP blind transfer tests: channel status sometimes returns
multiple status results.  Iterate over them to find the bridgedchannel result
that we care about.

Modified:
    asterisk/trunk/tests/channels/SIP/sip_one_legged_transfer/run-test

Modified: asterisk/trunk/tests/channels/SIP/sip_one_legged_transfer/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_one_legged_transfer/run-test?view=diff&rev=3066&r1=3065&r2=3066
==============================================================================
--- asterisk/trunk/tests/channels/SIP/sip_one_legged_transfer/run-test (original)
+++ asterisk/trunk/tests/channels/SIP/sip_one_legged_transfer/run-test Sun Feb 26 17:21:11 2012
@@ -55,16 +55,17 @@
         reactor.callLater(25, self.readResult)
 
 
-    def checkBridgeResult(self, result):
-        logger.debug('Result %s' % str(result))
-        if "bridgedchannel" not in result[0]:
-            logger.debug("bridgedchannel was not a valid key; checking for link")
-            if "link" not in result[0]:
-                logger.warn("'link' and 'bridgedchannel' not found")
-            elif result[0]['link'] == 'SIP/end_a-00000001': # check link for older versions of asterisk
+    def checkBridgeResult(self, results):
+        logger.debug('Result %s' % str(results))
+        for result in results:
+            if "bridgedchannel" not in result:
+                logger.debug("bridgedchannel was not a valid key; checking for link")
+                if "link" not in result:
+                    logger.warn("'link' and 'bridgedchannel' not found")
+                elif result['link'] == 'SIP/end_a-00000001': # check link for older versions of asterisk
+                    self.passed = True
+            elif result['bridgedchannel'] == 'SIP/end_a-00000001':
                 self.passed = True
-        elif result[0]['bridgedchannel'] == 'SIP/end_a-00000001':
-            self.passed = True
 
         if self.passed == True:
             logger.debug("Found Bridge!!!")




More information about the asterisk-commits mailing list