[asterisk-commits] file: branch file/app_dial_tools r144633 - /team/file/app_dial_tools/apps/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 26 11:47:45 CDT 2008


Author: file
Date: Fri Sep 26 11:47:45 2008
New Revision: 144633

URL: http://svn.digium.com/view/asterisk?view=rev&rev=144633
Log:
Add a skeleton file for app_dial_tools.

Added:
    team/file/app_dial_tools/apps/app_dial_tools.c
      - copied, changed from r144631, team/file/app_dial_tools/apps/app_skel.c

Copied: team/file/app_dial_tools/apps/app_dial_tools.c (from r144631, team/file/app_dial_tools/apps/app_skel.c)
URL: http://svn.digium.com/view/asterisk/team/file/app_dial_tools/apps/app_dial_tools.c?view=diff&rev=144633&p1=team/file/app_dial_tools/apps/app_skel.c&r1=144631&p2=team/file/app_dial_tools/apps/app_dial_tools.c&r2=144633
==============================================================================
--- team/file/app_dial_tools/apps/app_skel.c (original)
+++ team/file/app_dial_tools/apps/app_dial_tools.c Fri Sep 26 11:47:45 2008
@@ -1,9 +1,9 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) <Year>, <Your Name Here>
+ * Copyright (C) 2008, Digium, Inc.
  *
- * <Your Name Here> <<Your Email Here>>
+ * Joshua Colp <jcolp at digium.com>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -18,17 +18,13 @@
 
 /*! \file
  *
- * \brief Skeleton application
+ * \brief Dialing and bridging tools application
  *
- * \author\verbatim <Your Name Here> <<Your Email Here>> \endverbatim
+ * \author\verbatim Joshua Colp <jcolp at digium.com> \endverbatim
  * 
- * This is a skeleton for development of an Asterisk application 
+ * This application is used for dialing and bridging channels.
  * \ingroup applications
  */
-
-/*** MODULEINFO
-	<defaultenabled>no</defaultenabled>
- ***/
 
 #include "asterisk.h"
 
@@ -41,81 +37,14 @@
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 
-static char *app = "Skel";
-static char *synopsis = 
-"Skeleton application.";
-static char *descrip = "This application is a template to build other applications from.\n"
- " It shows you the basic structure to create your own Asterisk applications.\n";
-
-enum {
-	OPTION_A = (1 << 0),
-	OPTION_B = (1 << 1),
-	OPTION_C = (1 << 2),
-} option_flags;
-
-enum {
-	OPTION_ARG_B = 0,
-	OPTION_ARG_C = 1,
-	/* This *must* be the last value in this enum! */
-	OPTION_ARG_ARRAY_SIZE = 2,
-} option_args;
-
-AST_APP_OPTIONS(app_opts,{
-	AST_APP_OPTION('a', OPTION_A),
-	AST_APP_OPTION_ARG('b', OPTION_B, OPTION_ARG_B),
-	AST_APP_OPTION_ARG('c', OPTION_C, OPTION_ARG_C),
-});
-
-
-static int app_exec(struct ast_channel *chan, void *data)
-{
-	int res = 0;
-	struct ast_flags flags;
-	char *parse, *opts[OPTION_ARG_ARRAY_SIZE];
-	AST_DECLARE_APP_ARGS(args,
-		AST_APP_ARG(dummy);
-		AST_APP_ARG(options);
-	);
-
-	if (ast_strlen_zero(data)) {
-		ast_log(LOG_WARNING, "%s requires an argument (dummy[,options])\n", app);
-		return -1;
-	}
-
-	/* Do our thing here */
-
-	/* We need to make a copy of the input string if we are going to modify it! */
-	parse = ast_strdupa(data);
-
-	AST_STANDARD_APP_ARGS(args, parse);
-
-	if (args.argc == 2)
-		ast_app_parse_options(app_opts, &flags, opts, args.options);
-
-	if (!ast_strlen_zero(args.dummy)) 
-		ast_log(LOG_NOTICE, "Dummy value is : %s\n", args.dummy);
-
-	if (ast_test_flag(&flags, OPTION_A))
-		ast_log(LOG_NOTICE, "Option A is set\n");
-
-	if (ast_test_flag(&flags, OPTION_B))
-		ast_log(LOG_NOTICE, "Option B is set with : %s\n", opts[OPTION_ARG_B] ? opts[OPTION_ARG_B] : "<unspecified>");
-
-	if (ast_test_flag(&flags, OPTION_C))
-		ast_log(LOG_NOTICE, "Option C is set with : %s\n", opts[OPTION_ARG_C] ? opts[OPTION_ARG_C] : "<unspecified>");
-
-	return res;
-}
-
 static int unload_module(void)
 {
-	return ast_unregister_application(app);
+	return 0;
 }
 
 static int load_module(void)
 {
-	return ast_register_application(app, app_exec, synopsis, descrip) ? 
-		AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;
+	return AST_MODULE_LOAD_SUCCESS;
 }
 
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Skeleton (sample) Application");
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialing and Bridging Tools Application");




More information about the asterisk-commits mailing list