aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_moh.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-11 03:14:05 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-11 03:14:05 +0000
commit5f90b9bebddfa06f9d08b63e9c48830071480f38 (patch)
tree47f92d29e3216d69801be7bdb5d15fef7aab9a4d /funcs/func_moh.c
parent7acc893dad48c008eaced05bfbedb0d17735bc47 (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_moh.c')
-rw-r--r--funcs/func_moh.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/funcs/func_moh.c b/funcs/func_moh.c
index 07a78234a..f7cebff93 100644
--- a/funcs/func_moh.c
+++ b/funcs/func_moh.c
@@ -27,32 +27,58 @@
#include "asterisk.h"
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
#include "asterisk/stringfields.h"
-static char *function_moh_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static char *moh_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
{
ast_copy_string(buf, chan->musicclass, len);
return buf;
}
-static void function_moh_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
+static void moh_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
{
ast_string_field_set(chan, musicclass, value);
}
-#ifndef BUILTIN_FUNC
-static
-#endif
-struct ast_custom_function moh_function = {
+static struct ast_custom_function moh_function = {
.name = "MUSICCLASS",
.synopsis = "Read or Set the MusicOnHold class",
.syntax = "MUSICCLASS()",
.desc = "This function will read or set the music on hold class for a channel.\n",
- .read = function_moh_read,
- .write = function_moh_write,
+ .read = moh_read,
+ .write = moh_write,
};
+static char *tdesc = "Music-on-hold dialplan function";
+
+int unload_module(void)
+{
+ return ast_custom_function_unregister(&moh_function);
+}
+
+int load_module(void)
+{
+ return ast_custom_function_register(&moh_function);
+}
+
+char *description(void)
+{
+ return tdesc;
+}
+
+int usecount(void)
+{
+ return 0;
+}
+
+char *key()
+{
+ return ASTERISK_GPL_KEY;
+}