mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-04 13:21:54 +00:00 
			
		
		
		
	Fix bug where a NULL timeout would make things explode if SendDTMF was called with it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		@@ -60,7 +60,7 @@ static int senddtmf_exec(struct ast_channel *chan, void *vdata)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	int res = 0;
 | 
						int res = 0;
 | 
				
			||||||
	char *data;
 | 
						char *data;
 | 
				
			||||||
	int timeout, duration;
 | 
						int timeout = 0, duration = 0;
 | 
				
			||||||
	AST_DECLARE_APP_ARGS(args,
 | 
						AST_DECLARE_APP_ARGS(args,
 | 
				
			||||||
		AST_APP_ARG(digits);
 | 
							AST_APP_ARG(digits);
 | 
				
			||||||
		AST_APP_ARG(timeout);
 | 
							AST_APP_ARG(timeout);
 | 
				
			||||||
@@ -75,8 +75,10 @@ static int senddtmf_exec(struct ast_channel *chan, void *vdata)
 | 
				
			|||||||
	data = ast_strdupa(vdata);
 | 
						data = ast_strdupa(vdata);
 | 
				
			||||||
	AST_STANDARD_APP_ARGS(args, data);
 | 
						AST_STANDARD_APP_ARGS(args, data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	timeout = atoi(args.timeout);
 | 
						if (!ast_strlen_zero(args.timeout))
 | 
				
			||||||
	duration = atoi(args.duration);
 | 
							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);
 | 
						res = ast_dtmf_stream(chan, NULL, args.digits, timeout <= 0 ? 250 : timeout, duration);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return res;
 | 
						return res;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user