Skip to content
Snippets Groups Projects
Commit 0375f18c authored by David Ruggles's avatar David Ruggles
Browse files

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: https://origsvn.digium.com/svn/asterisk/trunk@243346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent c277952c
No related branches found
No related tags found
No related merge requests found
...@@ -83,10 +83,10 @@ static int senddtmf_exec(struct ast_channel *chan, const char *vdata) ...@@ -83,10 +83,10 @@ static int senddtmf_exec(struct ast_channel *chan, const char *vdata)
{ {
int res = 0; int res = 0;
char *data; char *data;
int timeout = 0, duration = 0; int dinterval = 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(dinterval);
AST_APP_ARG(duration); AST_APP_ARG(duration);
); );
...@@ -98,11 +98,14 @@ static int senddtmf_exec(struct ast_channel *chan, const char *vdata) ...@@ -98,11 +98,14 @@ static int senddtmf_exec(struct ast_channel *chan, const char *vdata)
data = ast_strdupa(vdata); data = ast_strdupa(vdata);
AST_STANDARD_APP_ARGS(args, data); AST_STANDARD_APP_ARGS(args, data);
if (!ast_strlen_zero(args.timeout)) if (!ast_strlen_zero(args.dinterval)) {
timeout = atoi(args.timeout); ast_app_parse_timelen(args.dinterval, &dinterval, TIMELEN_MILLISECONDS);
if (!ast_strlen_zero(args.duration)) }
duration = atoi(args.duration); if (!ast_strlen_zero(args.duration)) {
res = ast_dtmf_stream(chan, NULL, args.digits, timeout <= 0 ? 250 : timeout, 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; return res;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment