[svn-commits] mjordan: testsuite/asterisk/trunk r4299 - /asterisk/trunk/tests/apps/dial/dia...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Oct 27 18:29:21 CDT 2013


Author: mjordan
Date: Sun Oct 27 18:29:20 2013
New Revision: 4299

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4299
Log:
Delay slightly before sending the DTMF to cancel the call

Similar to dial_parallel_all_cancel, we should wait slightly before sending the
DTMF that cancels the call. This gives the control frame containing the hangup
cause information to be enqueued and processed.S

Modified:
    asterisk/trunk/tests/apps/dial/dial_dtmf_hangup_cancel/send_dtmf.py

Modified: asterisk/trunk/tests/apps/dial/dial_dtmf_hangup_cancel/send_dtmf.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/dial/dial_dtmf_hangup_cancel/send_dtmf.py?view=diff&rev=4299&r1=4298&r2=4299
==============================================================================
--- asterisk/trunk/tests/apps/dial/dial_dtmf_hangup_cancel/send_dtmf.py (original)
+++ asterisk/trunk/tests/apps/dial/dial_dtmf_hangup_cancel/send_dtmf.py Sun Oct 27 18:29:20 2013
@@ -8,15 +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.
     '''
-    if 'channel' not in event:
-        return True
+
+    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')
-    return True
+
+    reactor.callLater(2, actually_send_dtmf, ami, channel)
+
+    return True




More information about the svn-commits mailing list