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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 15 12:04:25 CDT 2011


Author: mjordan
Date: Thu Sep 15 12:04:23 2011
New Revision: 2280

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2280
Log:
Patch to fix bouncing test check_voicemail_new_user

This patch to the voicemail test base class will hopefully fix the bouncing test
check_voicemail_new_user.  When performing the new_user operations in voicemail
where the sound greetings are being recorded, there are some fairly tight timing
constraints in which different DTMF tones must be sent.  Because these were being
set along with the TALK_AUDIO variable, at times the user would timeout and be
prematurely kicked out of voicemail.  This patch caches the last set TALK_AUDIO and
DTMF_TO_SEND variables to reduce the number of calls to cli_exec.  If this doesn't
fix the timing issue, a special extension can be written for that test to bypass
the useage of variables.

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

Modified: asterisk/trunk/lib/python/asterisk/voicemail.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/voicemail.py?view=diff&rev=2280&r1=2279&r2=2280
==============================================================================
--- asterisk/trunk/lib/python/asterisk/voicemail.py (original)
+++ asterisk/trunk/lib/python/asterisk/voicemail.py Thu Sep 15 12:04:23 2011
@@ -80,6 +80,8 @@
         self.amiSender = None
         self.astSender = None
         self.__testConditions = {}
+        self.__previous_audio = ""
+        self.__previous_dtmf = ""
         self.senderChannel = VoiceMailTest.defaultSenderChannel
 
     """
@@ -122,7 +124,9 @@
             TestCase.testStateController.changeState(FailureTestState(self.controller))
             return
 
-        self.astSender.cli_exec("dialplan set global DTMF_TO_SEND " + dtmfToSend)
+        if (self.__previous_dtmf != dtmfToSend):
+            self.astSender.cli_exec("dialplan set global DTMF_TO_SEND " + dtmfToSend)
+            self.__previous_dtmf = dtmfToSend
 
         """
         Redirect to the DTMF extension - note that we assume that we only have one channel to
@@ -146,7 +150,9 @@
             TestCase.testStateController.changeState(FailureTestState(self.controller))
             return
 
-        self.astSender.cli_exec("dialplan set global TALK_AUDIO " + audioFile)
+        if (self.__previous_audio != audioFile):
+            self.astSender.cli_exec("dialplan set global TALK_AUDIO " + audioFile)
+            self.__previous_audio = audioFile
 
         """
         Redirect to the send sound file extension - note that we assume that we only have one channel to
@@ -174,8 +180,12 @@
             TestCase.testStateController.changeState(FailureTestState(self.controller))
             return
 
-        self.astSender.cli_exec("dialplan set global TALK_AUDIO " + audioFile)
-        self.astSender.cli_exec("dialplan set global DTMF_TO_SEND " + dtmfToSend)
+        if (self.__previous_audio != audioFile):
+            self.astSender.cli_exec("dialplan set global TALK_AUDIO " + audioFile)
+            self.__previous_audio = audioFile
+        if (self.__previous_dtmf != dtmfToSend):
+            self.astSender.cli_exec("dialplan set global DTMF_TO_SEND " + dtmfToSend)
+            self.__previous_dtmf = dtmfToSend
 
         """
         Redirect to the send sound file extension - note that we assume that we only have one channel to




More information about the asterisk-commits mailing list