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_groupcount.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_groupcount.c')
-rw-r--r-- | funcs/func_groupcount.c | 64 |
1 files changed, 47 insertions, 17 deletions
diff --git a/funcs/func_groupcount.c b/funcs/func_groupcount.c index bf389a61d..a4a133056 100644 --- a/funcs/func_groupcount.c +++ b/funcs/func_groupcount.c @@ -27,8 +27,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" @@ -57,10 +58,7 @@ static char *group_count_function_read(struct ast_channel *chan, char *cmd, char return buf; } -#ifndef BUILTIN_FUNC -static -#endif -struct ast_custom_function group_count_function = { +static struct ast_custom_function group_count_function = { .name = "GROUP_COUNT", .syntax = "GROUP_COUNT([groupname][@category])", .synopsis = "Counts the number of channels in the specified group", @@ -85,10 +83,7 @@ static char *group_match_count_function_read(struct ast_channel *chan, char *cmd return buf; } -#ifndef BUILTIN_FUNC -static -#endif -struct ast_custom_function group_match_count_function = { +static struct ast_custom_function group_match_count_function = { .name = "GROUP_MATCH_COUNT", .syntax = "GROUP_MATCH_COUNT(groupmatch[@category])", .synopsis = "Counts the number of channels in the groups matching the specified pattern", @@ -130,10 +125,7 @@ static void group_function_write(struct ast_channel *chan, char *cmd, char *data ast_log(LOG_WARNING, "Setting a group requires an argument (group name)\n"); } -#ifndef BUILTIN_FUNC -static -#endif -struct ast_custom_function group_function = { +static struct ast_custom_function group_function = { .name = "GROUP", .syntax = "GROUP([category])", .synopsis = "Gets or sets the channel group.", @@ -171,10 +163,7 @@ static char *group_list_function_read(struct ast_channel *chan, char *cmd, char return buf; } -#ifndef BUILTIN_FUNC -static -#endif -struct ast_custom_function group_list_function = { +static struct ast_custom_function group_list_function = { .name = "GROUP_LIST", .syntax = "GROUP_LIST()", .synopsis = "Gets a list of the groups set on a channel.", @@ -183,6 +172,47 @@ struct ast_custom_function group_list_function = { .write = NULL, }; +static char *tdesc = "Channel group dialplan functions"; + +int unload_module(void) +{ + int res = 0; + + res |= ast_custom_function_unregister(&group_count_function); + res |= ast_custom_function_unregister(&group_match_count_function); + res |= ast_custom_function_unregister(&group_list_function); + res |= ast_custom_function_unregister(&group_function); + + return res; +} + +int load_module(void) +{ + int res = 0; + + res |= ast_custom_function_register(&group_count_function); + res |= ast_custom_function_register(&group_match_count_function); + res |= ast_custom_function_register(&group_list_function); + res |= ast_custom_function_register(&group_function); + + return res; +} + +char *description(void) +{ + return tdesc; +} + +int usecount(void) +{ + return 0; +} + +char *key() +{ + return ASTERISK_GPL_KEY; +} + /* Local Variables: mode: C |