diff options
author | diruggles <diruggles@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-26 20:49:57 +0000 |
---|---|---|
committer | diruggles <diruggles@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-26 20:49:57 +0000 |
commit | e92b7c929bc9635ba1bfab723aa4109ffe810200 (patch) | |
tree | 1357dd571f4216ce7b6a28247343f2e01b850316 /apps/app_senddtmf.c | |
parent | ed049a9f9ddc6d42634bfa6d6ca06e604119ba50 (diff) |
Code clean up in app_senddtmf
Pushes code clean up done in app_externalivr back
into app_senddtmf
Review: https://reviewboard.asterisk.org/r/473/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243346 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_senddtmf.c')
-rw-r--r-- | apps/app_senddtmf.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c index 395ae28c9..16ca4b513 100644 --- a/apps/app_senddtmf.c +++ b/apps/app_senddtmf.c @@ -83,10 +83,10 @@ static int senddtmf_exec(struct ast_channel *chan, const char *vdata) { int res = 0; char *data; - int timeout = 0, duration = 0; + int dinterval = 0, duration = 0; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(digits); - AST_APP_ARG(timeout); + AST_APP_ARG(dinterval); AST_APP_ARG(duration); ); @@ -98,11 +98,14 @@ static int senddtmf_exec(struct ast_channel *chan, const char *vdata) data = ast_strdupa(vdata); AST_STANDARD_APP_ARGS(args, data); - 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); + if (!ast_strlen_zero(args.dinterval)) { + ast_app_parse_timelen(args.dinterval, &dinterval, TIMELEN_MILLISECONDS); + } + if (!ast_strlen_zero(args.duration)) { + ast_app_parse_timelen(args.duration, &duration, TIMELEN_MILLISECONDS); + } + + res = ast_dtmf_stream(chan, NULL, args.digits, dinterval <= 0 ? 250 : dinterval, duration); return res; } |