[asterisk-commits] mjordan: testsuite/asterisk/trunk r4298 - /asterisk/trunk/tests/apps/dial/dia...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Oct 27 18:26:31 CDT 2013
Author: mjordan
Date: Sun Oct 27 18:26:29 2013
New Revision: 4298
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4298
Log:
Delay slightly when sending the DTMF to cancel the parallel dial attempts
If the DTMF is sent too fast, the hangup cause code frame might not have been
enqueued yet on the channels. This results in a lack of hangup cause information
which can cause the tests to fail. This updates the python code that sends the
DTMF to cancel the test to wait just slightly after the beginning of the dial
attempt to give the channel driver some time to catch up.
Modified:
asterisk/trunk/tests/apps/dial/dial_parallel/dial_parallel_all_cancel/send_dtmf.py
Modified: asterisk/trunk/tests/apps/dial/dial_parallel/dial_parallel_all_cancel/send_dtmf.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/dial/dial_parallel/dial_parallel_all_cancel/send_dtmf.py?view=diff&rev=4298&r1=4297&r2=4298
==============================================================================
--- asterisk/trunk/tests/apps/dial/dial_parallel/dial_parallel_all_cancel/send_dtmf.py (original)
+++ asterisk/trunk/tests/apps/dial/dial_parallel/dial_parallel_all_cancel/send_dtmf.py Sun Oct 27 18:26:29 2013
@@ -8,14 +8,21 @@
import logging
+from twisted.internet import reactor
+
LOGGER = logging.getLogger(__name__)
def send_dtmf(ami, event):
''' Callback called when we detect dial has started.
'''
+ def actually_send_dtmf(ami, channel):
+ LOGGER.info('Sending DTMF to hangup channel %s' % channel)
+ ami.redirect(channel, 'default', 'dtmf', '1')
+
channel = event['channel'][:len(event['channel']) - 2]
channel += ';1'
- LOGGER.info('Sending DTMF to hangup channel %s' % channel)
- ami.redirect(channel, 'default', 'dtmf', '1')
+
+ reactor.callLater(2, actually_send_dtmf, ami, channel)
+
return True
More information about the asterisk-commits
mailing list