[asterisk-commits] mjordan: testsuite/asterisk/trunk r3814 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 31 12:35:40 CDT 2013


Author: mjordan
Date: Fri May 31 12:35:38 2013
New Revision: 3814

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3814
Log:
Always listen for AMI connections in the Originator pluggable module

While we don't always want to register for as a scenario start observer
(which only the SIPp based test object supports), we do want to always
register for AMI connections. Otherwise the module itself can't function.

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

Modified: asterisk/trunk/lib/python/asterisk/PluggableModules.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/PluggableModules.py?view=diff&rev=3814&r1=3813&r2=3814
==============================================================================
--- asterisk/trunk/lib/python/asterisk/PluggableModules.py (original)
+++ asterisk/trunk/lib/python/asterisk/PluggableModules.py Fri May 31 12:35:38 2013
@@ -19,6 +19,7 @@
     def __init__(self, module_config, test_object):
         '''Initialize config and register test_object callbacks.'''
         self.ami = None
+        test_object.register_ami_observer(self.ami_connect)
         self.test_object = test_object
         self.current_destination = 0
         self.ami_callback = None
@@ -42,9 +43,7 @@
             if k in self.config:
                 self.config[k] = module_config[k]
 
-        if self.config['trigger'] == 'ami_connect':
-            test_object.register_ami_observer(self.ami_connect)
-        elif self.config['trigger'] == 'scenario_start':
+        if self.config['trigger'] == 'scenario_start':
             test_object.register_scenario_started_observer(self.scenario_started)
         elif self.config['trigger'] == 'event':
             if not self.config['event']:
@@ -63,7 +62,8 @@
         LOGGER.info("AMI %s connected" % (str(ami.id)))
         if str(ami.id) == self.config['id']:
             self.ami = ami
-            self.originate_call()
+            if self.config['trigger'] == 'ami_connect':
+                self.originate_call()
         return
 
     def failure(self, result):




More information about the asterisk-commits mailing list