diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-11 03:14:05 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-11 03:14:05 +0000 |
commit | 5f90b9bebddfa06f9d08b63e9c48830071480f38 (patch) | |
tree | 47f92d29e3216d69801be7bdb5d15fef7aab9a4d /funcs/func_db.c | |
parent | 7acc893dad48c008eaced05bfbedb0d17735bc47 (diff) |
build function modules independently (no more pbx_functions.so)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9469 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_db.c')
-rw-r--r-- | funcs/func_db.c | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/funcs/func_db.c b/funcs/func_db.c index 3125d8eca..efce117c8 100644 --- a/funcs/func_db.c +++ b/funcs/func_db.c @@ -32,8 +32,9 @@ #include "asterisk.h" -/* ASTERISK_FILE_VERSION(__FILE__, "$Revision$") */ +ASTERISK_FILE_VERSION(__FILE__, "$Revision$") +#include "asterisk/module.h" #include "asterisk/channel.h" #include "asterisk/pbx.h" #include "asterisk/logger.h" @@ -111,10 +112,7 @@ static void function_db_write(struct ast_channel *chan, char *cmd, char *data, c } } -#ifndef BUILTIN_FUNC -static -#endif -struct ast_custom_function db_function = { +static struct ast_custom_function db_function = { .name = "DB", .synopsis = "Read or Write from/to the Asterisk database", .syntax = "DB(<family>/<key>)", @@ -167,10 +165,7 @@ static char *function_db_exists(struct ast_channel *chan, char *cmd, char *data, return buf; } -#ifndef BUILTIN_FUNC -static -#endif -struct ast_custom_function db_exists_function = { +static struct ast_custom_function db_exists_function = { .name = "DB_EXISTS", .synopsis = "Check to see if a key exists in the Asterisk database", .syntax = "DB_EXISTS(<family>/<key>)", @@ -180,3 +175,41 @@ struct ast_custom_function db_exists_function = { "also set the variable DB_RESULT to the key's value if it exists.\n", .read = function_db_exists, }; + +static char *tdesc = "Database (astdb) related dialplan functions"; + +int unload_module(void) +{ + int res = 0; + + res |= ast_custom_function_unregister(&db_function); + res |= ast_custom_function_unregister(&db_exists_function); + + return res; +} + +int load_module(void) +{ + int res = 0; + + res |= ast_custom_function_register(&db_function); + res |= ast_custom_function_register(&db_exists_function); + + return res; +} + +char *description(void) +{ + return tdesc; +} + +int usecount(void) +{ + return 0; +} + +char *key() +{ + return ASTERISK_GPL_KEY; +} + |