12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #include "asterisk.h"
- ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
- #include "asterisk/module.h"
- #include "asterisk/pbx.h"
- static int ifmodule_read(struct ast_channel *chan, const char *cmd, char *data,
- char *buf, size_t len)
- {
- char *ret = "0";
- *buf = '\0';
- if (data)
- if (ast_module_check(data))
- ret = "1";
- ast_copy_string(buf, ret, len);
- return 0;
- }
- static struct ast_custom_function ifmodule_function = {
- .name = "IFMODULE",
- .read = ifmodule_read,
- .read_max = 2,
- };
- static int unload_module(void)
- {
- return ast_custom_function_unregister(&ifmodule_function);
- }
- static int load_module(void)
- {
- return ast_custom_function_register(&ifmodule_function);
- }
- AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Checks if Asterisk module is loaded in memory");
|