diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-05-05 05:39:33 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-05-05 05:39:33 +0000 |
commit | 4d2537ae1136e6885c3b1214ebed6ccab2bdbec2 (patch) | |
tree | d1f6c678019f87fb5730998dc62af2c209dc66d6 /funcs/pbx_functions.c | |
parent | e8bd5968ff53cd8e2acc82c4f80902bc0c404d54 (diff) |
major re-work of dialplan functions, including:
- locking of functions list during registration/unregistration/searching
- rename of function description structure to be consistent with the rest of the API
- addition of 'desc' element to description structure, for detailed description (like applications)
- addition of 'show function' CLI command to show function details
- conversion of existing functions to use uppercase names to match policy
- creation of new 'pbx_functions.so' module to contain standard 'builtin' functions
- removal of all builtin functions from pbx.c and apps and placement into new 'funcs' directory
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/pbx_functions.c')
-rwxr-xr-x | funcs/pbx_functions.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/funcs/pbx_functions.c b/funcs/pbx_functions.c new file mode 100755 index 000000000..59925dafd --- /dev/null +++ b/funcs/pbx_functions.c @@ -0,0 +1,58 @@ +/* + * Asterisk -- A telephony toolkit for Linux. + * + * Builtin dialplan functions + * + * Copyright (C) 2005, Digium, Inc. + * + * Kevin P. Fleming <kpfleming@digium.com> + * + * This program is free software, distributed under the terms of + * the GNU General Public License + */ + +#include <sys/types.h> +#include <stdlib.h> + +#include "asterisk/module.h" +#include "asterisk/pbx.h" +#include "pbx_functions.h" + +static char *tdesc = "Builtin dialplan functions"; + +int unload_module(void) +{ + int x; + + for (x = 0; x < (sizeof(builtins) / sizeof(builtins[0])); x++) { + ast_custom_function_unregister(builtins[x]); + } + + return 0; +} + +int load_module(void) +{ + int x; + + for (x = 0; x < (sizeof(builtins) / sizeof(builtins[0])); x++) { + ast_custom_function_register(builtins[x]); + } + + return 0; +} + +char *description(void) +{ + return tdesc; +} + +int usecount(void) +{ + return 0; +} + +char *key() +{ + return ASTERISK_GPL_KEY; +} |