[asterisk-commits] jbigelow: testsuite/asterisk/trunk r4186 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 13 13:23:52 CDT 2013


Author: jbigelow
Date: Fri Sep 13 13:23:50 2013
New Revision: 4186

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4186
Log:
Add a slight delay before calling the scenario start callbacks

In some cases when a test module's scenario start callback function is called
it performs an action before the SIPp process is ready. This is the case when
using PluggableModules.Originator to originate an outbound call to SIPp. This
simply adds a slight delay to allow time for the SIPp process to be ready
before calling the scenario start callbacks.


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

Modified: asterisk/trunk/lib/python/asterisk/sipp.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/sipp.py?view=diff&rev=4186&r1=4185&r2=4186
==============================================================================
--- asterisk/trunk/lib/python/asterisk/sipp.py (original)
+++ asterisk/trunk/lib/python/asterisk/sipp.py Fri Sep 13 13:23:50 2013
@@ -197,9 +197,14 @@
 
 
     def _scenario_start_callback_fn(self, result):
-        for observer in self._scenario_started_observers:
-            observer(result)
-        return result
+        def __run_callback(result):
+            """ Notify others that the scenario has started """
+            for observer in self._scenario_started_observers:
+                observer(result)
+            return result
+
+        # Allow some time for the SIPp process to come up 
+        reactor.callLater(.25, __run_callback, result)
 
 
     def _scenario_stop_callback_fn(self, result):




More information about the asterisk-commits mailing list