summaryrefslogtreecommitdiff
path: root/funcs/func_db.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2006-02-11 03:14:05 +0000
committerKevin P. Fleming <kpfleming@digium.com>2006-02-11 03:14:05 +0000
commita38a7eec61eaad39440b37da1e73a9e626adb34a (patch)
tree47f92d29e3216d69801be7bdb5d15fef7aab9a4d /funcs/func_db.c
parentc7da92d2ea7fa551daf28e05917745a751677e48 (diff)
build function modules independently (no more pbx_functions.so)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/func_db.c')
-rw-r--r--funcs/func_db.c51
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;
+}
+