diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2006-02-11 03:14:05 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2006-02-11 03:14:05 +0000 |
commit | a38a7eec61eaad39440b37da1e73a9e626adb34a (patch) | |
tree | 47f92d29e3216d69801be7bdb5d15fef7aab9a4d /funcs/func_language.c | |
parent | c7da92d2ea7fa551daf28e05917745a751677e48 (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_language.c')
-rw-r--r-- | funcs/func_language.c | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/funcs/func_language.c b/funcs/func_language.c index 2ca98ef18..f6bc1a4c9 100644 --- a/funcs/func_language.c +++ b/funcs/func_language.c @@ -26,8 +26,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" @@ -35,23 +36,20 @@ #include "asterisk/app.h" #include "asterisk/stringfields.h" -static char *builtin_function_language_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) +static char *language_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) { ast_copy_string(buf, chan->language, len); return buf; } -static void builtin_function_language_write(struct ast_channel *chan, char *cmd, char *data, const char *value) +static void language_write(struct ast_channel *chan, char *cmd, char *data, const char *value) { if (value) ast_string_field_set(chan, language, value); } -#ifndef BUILTIN_FUNC -static -#endif -struct ast_custom_function language_function = { +static struct ast_custom_function language_function = { .name = "LANGUAGE", .synopsis = "Gets or sets the channel's language.", .syntax = "LANGUAGE()", @@ -63,10 +61,37 @@ struct ast_custom_function language_function = { "will play the normal 'demo-congrats'. For some language codes,\n" "changing the language also changes the syntax of some Asterisk\n" "functions, like SayNumber.\n", - .read = builtin_function_language_read, - .write = builtin_function_language_write, + .read = language_read, + .write = language_write, }; +static char *tdesc = "Channel language dialplan function"; + +int unload_module(void) +{ + return ast_custom_function_unregister(&language_function); +} + +int load_module(void) +{ + return ast_custom_function_register(&language_function); +} + +char *description(void) +{ + return tdesc; +} + +int usecount(void) +{ + return 0; +} + +char *key() +{ + return ASTERISK_GPL_KEY; +} + /* Local Variables: mode: C |