[asterisk-commits] file: trunk r78279 - /trunk/apps/app_senddtmf.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 6 16:59:33 CDT 2007


Author: file
Date: Mon Aug  6 16:59:32 2007
New Revision: 78279

URL: http://svn.digium.com/view/asterisk?view=rev&rev=78279
Log:
Fix bug where a NULL timeout would make things explode if SendDTMF was called with it.

Modified:
    trunk/apps/app_senddtmf.c

Modified: trunk/apps/app_senddtmf.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_senddtmf.c?view=diff&rev=78279&r1=78278&r2=78279
==============================================================================
--- trunk/apps/app_senddtmf.c (original)
+++ trunk/apps/app_senddtmf.c Mon Aug  6 16:59:32 2007
@@ -60,7 +60,7 @@
 {
 	int res = 0;
 	char *data;
-	int timeout, duration;
+	int timeout = 0, duration = 0;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(digits);
 		AST_APP_ARG(timeout);
@@ -75,8 +75,10 @@
 	data = ast_strdupa(vdata);
 	AST_STANDARD_APP_ARGS(args, data);
 
-	timeout = atoi(args.timeout);
-	duration = atoi(args.duration);
+	if (!ast_strlen_zero(args.timeout))
+		timeout = atoi(args.timeout);
+	if (!ast_strlen_zero(args.duration))
+		duration = atoi(args.duration);
 	res = ast_dtmf_stream(chan, NULL, args.digits, timeout <= 0 ? 250 : timeout, duration);
 
 	return res;




More information about the asterisk-commits mailing list