mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 11:58:40 +00:00
Mostly cleanup of documentation to substitute the pipe with the comma, but a few other formatting cleanups, too.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user