2 * Asterisk -- A telephony toolkit for Linux.
4 * App to send DTMF digits
6 * Copyright (C) 1999, Mark Spencer
8 * Mark Spencer <markster@linux-support.net>
10 * This program is free software, distributed under the terms of
11 * the GNU General Public License
14 #include <asterisk/lock.h>
15 #include <asterisk/file.h>
16 #include <asterisk/logger.h>
17 #include <asterisk/channel.h>
18 #include <asterisk/pbx.h>
19 #include <asterisk/module.h>
20 #include <asterisk/translate.h>
21 #include <asterisk/options.h>
22 #include <asterisk/utils.h>
27 static char *tdesc = "Send DTMF digits Application";
29 static char *app = "SendDTMF";
31 static char *synopsis = "Sends arbitrary DTMF digits";
33 static char *descrip =
34 " SendDTMF(digits): Sends DTMF digits on a channel. \n"
35 " Accepted digits: 0-9, *#abcd\n"
36 " Returns 0 on success or -1 on a hangup.\n";
42 static int senddtmf_exec(struct ast_channel *chan, void *data)
48 if (!digits || ast_strlen_zero(digits)) {
49 ast_log(LOG_WARNING, "SendDTMF requires an argument (digits or *#aAbBcCdD)\n");
53 res = ast_dtmf_stream(chan,NULL,digits,250);
58 int unload_module(void)
60 STANDARD_HANGUP_LOCALUSERS;
61 return ast_unregister_application(app);
66 return ast_register_application(app, senddtmf_exec, synopsis, descrip);
69 char *description(void)
77 STANDARD_USECOUNT(res);
83 return ASTERISK_GPL_KEY;