aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_senddtmf.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-06 21:59:32 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-06 21:59:32 +0000
commit16644dc35c9d96a7cb92320a9b508c22d0d50186 (patch)
treec72315bf830e0ae8c79bacdd9cad210d5a0723fe /apps/app_senddtmf.c
parente8820a04915e9c541e5330eef7435d68c6215327 (diff)
Fix bug where a NULL timeout would make things explode if SendDTMF was called with it.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@78279 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_senddtmf.c')
-rw-r--r--apps/app_senddtmf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c
index fab83360e..de04b0c23 100644
--- a/apps/app_senddtmf.c
+++ b/apps/app_senddtmf.c
@@ -60,7 +60,7 @@ static int senddtmf_exec(struct ast_channel *chan, void *vdata)
{
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 @@ static int senddtmf_exec(struct ast_channel *chan, void *vdata)
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;