diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-05 05:39:33 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-05 05:39:33 +0000 |
commit | 6a262d98eeee9e0b4bfac92d88aacad6c4fab935 (patch) | |
tree | d1f6c678019f87fb5730998dc62af2c209dc66d6 /funcs/pbx_functions.c | |
parent | 7fe9220d99afa1950199d7effe66b81aa2ec64b7 (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: http://svn.digium.com/svn/asterisk/trunk@5583 f38db490-d61c-443f-a65b-d21fe96a405b
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; +} |