From 35f6c75a77ab93fa8be1c3a72d39756f5a62182c Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Thu, 30 Aug 2007 15:24:54 +0000 Subject: [PATCH] Add ReadExten app and VALID_EXTEN function (closes issue #10082) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81378 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_readexten.c | 266 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 266 insertions(+) create mode 100644 apps/app_readexten.c diff --git a/apps/app_readexten.c b/apps/app_readexten.c new file mode 100644 index 0000000000..9a8e7533a5 --- /dev/null +++ b/apps/app_readexten.c @@ -0,0 +1,266 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2007 Dave Chappell + * + * David Chappell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * + * \brief Trivial application to read an extension into a variable + * + * \author David Chappell + * + * \ingroup applications + */ + +#include "asterisk.h" + +ASTERISK_FILE_VERSION(__FILE__, "$Revision$") + +#include +#include +#include + +#include "asterisk/lock.h" +#include "asterisk/file.h" +#include "asterisk/logger.h" +#include "asterisk/channel.h" +#include "asterisk/pbx.h" +#include "asterisk/app.h" +#include "asterisk/module.h" +#include "asterisk/options.h" +#include "asterisk/utils.h" +#include "asterisk/indications.h" + +enum { + OPT_SKIP = (1 << 0), + OPT_INDICATION = (1 << 1), + OPT_NOANSWER = (1 << 2), +} readexten_option_flags; + +AST_APP_OPTIONS(readexten_app_options, { + AST_APP_OPTION('s', OPT_SKIP), + AST_APP_OPTION('i', OPT_INDICATION), + AST_APP_OPTION('n', OPT_NOANSWER), +}); + +static char *app = "ReadExten"; + +static char *synopsis = "Read an extension into a variable"; + +static char *descrip = +" ReadExten([,[][,[][,[