aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_senddtmf.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-31 01:10:47 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-31 01:10:47 +0000
commit356721a45cdb0b1f733602287d432f861fb24102 (patch)
treecc270243ba13c3006e7988529a8665655a65060e /apps/app_senddtmf.c
parentc3f03b34444ec12eb2a7fcef062b070bfe48f876 (diff)
Mostly cleanup of documentation to substitute the pipe with the comma, but a few other formatting cleanups, too.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77808 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_senddtmf.c')
-rw-r--r--apps/app_senddtmf.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c
index 1389542ee..66e31c850 100644
--- a/apps/app_senddtmf.c
+++ b/apps/app_senddtmf.c
@@ -50,35 +50,32 @@ static char *app = "SendDTMF";
static char *synopsis = "Sends arbitrary DTMF digits";
static char *descrip =
-" SendDTMF(digits[|timeout_ms]): Sends DTMF digits on a channel. \n"
+" SendDTMF(digits[,timeout_ms]): Sends DTMF digits on a channel. \n"
" Accepted digits: 0-9, *#abcd, w (.5s pause)\n"
" The application will either pass the assigned digits or terminate if it\n"
" encounters an error.\n";
-static int senddtmf_exec(struct ast_channel *chan, void *data)
+static int senddtmf_exec(struct ast_channel *chan, void *vdata)
{
int res = 0;
- char *digits = NULL, *to = NULL;
- int timeout = 250;
+ char *data;
+ int timeout;
+ AST_DECLARE_APP_ARGS(args,
+ AST_APP_ARG(digits);
+ AST_APP_ARG(timeout);
+ );
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "SendDTMF requires an argument (digits or *#aAbBcCdD)\n");
return 0;
}
- digits = ast_strdupa(data);
+ data = ast_strdupa(vdata);
+ AST_STANDARD_APP_ARGS(args, data);
- if ((to = strchr(digits,'|'))) {
- *to = '\0';
- to++;
- timeout = atoi(to);
- }
-
- if (timeout <= 0)
- timeout = 250;
-
- res = ast_dtmf_stream(chan,NULL,digits,timeout);
+ timeout = atoi(args.timeout);
+ res = ast_dtmf_stream(chan, NULL, args.digits, timeout <= 0 ? 250 : timeout);
return res;
}