[asterisk-commits] branch group/new_loader_completion r22339 - /team/group/new_loader_completion...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Apr 24 15:26:31 MST 2006


Author: kpfleming
Date: Mon Apr 24 17:26:31 2006
New Revision: 22339

URL: http://svn.digium.com/view/asterisk?rev=22339&view=rev
Log:
pbx modules update

Modified:
    team/group/new_loader_completion/pbx/pbx_ael.c
    team/group/new_loader_completion/pbx/pbx_config.c
    team/group/new_loader_completion/pbx/pbx_dundi.c
    team/group/new_loader_completion/pbx/pbx_loopback.c
    team/group/new_loader_completion/pbx/pbx_realtime.c
    team/group/new_loader_completion/pbx/pbx_spool.c

Modified: team/group/new_loader_completion/pbx/pbx_ael.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx/pbx_ael.c?rev=22339&r1=22338&r2=22339&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx/pbx_ael.c (original)
+++ team/group/new_loader_completion/pbx/pbx_ael.c Mon Apr 24 17:26:31 2006
@@ -67,7 +67,6 @@
 
 static int aeldebug = 0;
 
-static char *dtext = "Asterisk Extension Language Compiler v2";
 static char *config = "extensions.ael";
 static char *registrar = "pbx_ael";
 
@@ -121,8 +120,6 @@
 static pval *current_db;
 static pval *current_context;
 static pval *current_extension;
-static const char *description(void);
-static const char *key(void);
 
 static char *match_context;
 static char *match_exten;
@@ -3504,37 +3501,30 @@
 /*
  * Standard module functions ...
  */
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	ast_context_destroy(NULL, registrar);
 	ast_cli_unregister_multiple(ael2_cli, sizeof(ael2_cli)/ sizeof(ael2_cli[0]));
 	return 0;
 }
 
-
-static int load_module(void *mod)
+static int load_module(void)
 {
 	ast_cli_register_multiple(ael2_cli, sizeof(ael2_cli)/ sizeof(ael2_cli[0]));
 	return (pbx_load_module());
 }
 
-static int reload(void *mod)
+static int reload(void)
 {
 	ast_context_destroy(NULL, registrar);
 	return pbx_load_module();
 }
 
-static const char *description(void)
-{
-	return dtext;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "Asterisk Extension Language Compiler",
+		.load = load_module,
+		.unload = unload_module,
+		.reload = reload,
+	       );
 
 /* DESTROY the PVAL tree ============================================================================ */
 

Modified: team/group/new_loader_completion/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx/pbx_config.c?rev=22339&r1=22338&r2=22339&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx/pbx_config.c (original)
+++ team/group/new_loader_completion/pbx/pbx_config.c Mon Apr 24 17:26:31 2006
@@ -1323,7 +1323,7 @@
 /*!
  * Standard module functions ...
  */
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	ast_cli_unregister(&context_add_extension_cli);
 	if (static_config && !write_protect_config)
@@ -1512,7 +1512,7 @@
 	return 0;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	if (pbx_load_module())
 		return -1;
@@ -1530,7 +1530,7 @@
 	return 0;
 }
 
-static int reload(void *mod)
+static int reload(void)
 {
 	if (clearglobalvars_config)
 		pbx_builtin_clear_globals();
@@ -1538,15 +1538,8 @@
 	return 0;
 }
 
-static const char *description(void)
-{
-	return "Text Extension Configuration";
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-/* XXX really no usecount ? */
-STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "Text Extension Configuration",
+		.load = load_module,
+		.unload = unload_module,
+		.reload = reload,
+	       );

Modified: team/group/new_loader_completion/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx/pbx_dundi.c?rev=22339&r1=22338&r2=22339&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx/pbx_dundi.c (original)
+++ team/group/new_loader_completion/pbx/pbx_dundi.c Mon Apr 24 17:26:31 2006
@@ -2753,8 +2753,6 @@
 static struct ast_cli_entry  cli_queryeid =
 	{ { "dundi", "query", NULL }, dundi_do_query, "Query a DUNDi EID", query_usage };
 
-LOCAL_USER_DECL;
-
 static struct dundi_transaction *create_transaction(struct dundi_peer *p)
 {
 	struct dundi_transaction *trans;
@@ -3840,7 +3838,7 @@
 	int results;
 	int x;
 	int bypass = 0;
-	struct localuser *u;
+	struct ast_module_user *u;
 	struct dundi_result dr[MAX_RESULTS];
 
 	buf[0] = '\0';
@@ -3850,7 +3848,7 @@
 		return -1;
 	}
 
-	LOCAL_USER_ADD(u);
+	u = ast_module_user_add(chan);
 
 	context = strchr(num, '|');
 	if (context) {
@@ -3877,7 +3875,7 @@
 		}
 	}
 
-	LOCAL_USER_REMOVE(u);
+	ast_module_user_remove(u);
 
 	return 0;
 }
@@ -4606,9 +4604,9 @@
 	return 0;
 }
 
-static int unload_module(void *mod)
-{
-	STANDARD_HANGUP_LOCALUSERS;
+static int unload_module(void)
+{
+	ast_module_user_hangup_all();
 
 	ast_cli_unregister(&cli_debug);
 	ast_cli_unregister(&cli_store_history);
@@ -4632,20 +4630,19 @@
 	return 0;
 }
 
-static int reload(void *mod)
+static int reload(void)
 {
 	struct sockaddr_in sin;
 	set_config("dundi.conf",&sin);
 	return 0;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	int res = 0;
 	struct sockaddr_in sin;
 	char iabuf[INET_ADDRSTRLEN];
 
-	__mod_desc = mod;
 	dundi_set_output(dundi_debug_output);
 	dundi_set_error(dundi_error_output);
 	
@@ -4713,15 +4710,9 @@
 	return res;
 }
 
-static const char *description(void)
-{
-	return "Distributed Universal Number Discovery (DUNDi)";
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT | NO_UNLOAD, reload, NULL, NULL);
-
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "Distributed Universal Number Discovery (DUNDi)",
+		.load = load_module,
+		.unload = unload_module,
+		.reload = reload,
+	       );
+

Modified: team/group/new_loader_completion/pbx/pbx_loopback.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx/pbx_loopback.c?rev=22339&r1=22338&r2=22339&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx/pbx_loopback.c (original)
+++ team/group/new_loader_completion/pbx/pbx_loopback.c Mon Apr 24 17:26:31 2006
@@ -161,34 +161,23 @@
 static struct ast_switch loopback_switch =
 {
         name:                   "Loopback",
-        description:    		"Loopback Dialplan Switch",
+        description:   		"Loopback Dialplan Switch",
         exists:                 loopback_exists,
         canmatch:               loopback_canmatch,
         exec:                   loopback_exec,
         matchmore:              loopback_matchmore,
 };
 
-static const char *description(void)
-{
-	return "Loopback Switch";
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	ast_unregister_switch(&loopback_switch);
 	return 0;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	ast_register_switch(&loopback_switch);
 	return 0;
 }
 
-/* XXX really no unload ? */
-STD_MOD(MOD_1 | NO_USECOUNT | NO_UNLOAD, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Loopback Switch");

Modified: team/group/new_loader_completion/pbx/pbx_realtime.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx/pbx_realtime.c?rev=22339&r1=22338&r2=22339&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx/pbx_realtime.c (original)
+++ team/group/new_loader_completion/pbx/pbx_realtime.c Mon Apr 24 17:26:31 2006
@@ -238,33 +238,23 @@
 static struct ast_switch realtime_switch =
 {
         name:                   "Realtime",
-        description:    		"Realtime Dialplan Switch",
+        description:   		"Realtime Dialplan Switch",
         exists:                 realtime_exists,
         canmatch:               realtime_canmatch,
         exec:                   realtime_exec,
         matchmore:              realtime_matchmore,
 };
 
-static const char *description(void)
-{
-	return "Realtime Switch";
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	ast_unregister_switch(&realtime_switch);
 	return 0;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	ast_register_switch(&realtime_switch);
 	return 0;
 }
 
-STD_MOD(MOD_1 | NO_USECOUNT | NO_UNLOAD, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Realtime Switch");

Modified: team/group/new_loader_completion/pbx/pbx_spool.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx/pbx_spool.c?rev=22339&r1=22338&r2=22339&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx/pbx_spool.c (original)
+++ team/group/new_loader_completion/pbx/pbx_spool.c Mon Apr 24 17:26:31 2006
@@ -403,12 +403,12 @@
 	return NULL;
 }
 
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return -1;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	pthread_t thread;
 	pthread_attr_t attr;
@@ -427,14 +427,4 @@
 	return 0;
 }
 
-static const char *description(void)
-{
-	return "Outgoing Spool Support";
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT | NO_UNLOAD, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Outgoing Spool Support");



More information about the asterisk-commits mailing list