12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #include "asterisk.h"
- ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
- #include "asterisk/module.h"
- #include "asterisk/pbx.h"
- static int md5(struct ast_channel *chan, const char *cmd, char *data,
- char *buf, size_t len)
- {
- if (ast_strlen_zero(data)) {
- ast_log(LOG_WARNING, "Syntax: MD5(<data>) - missing argument!\n");
- return -1;
- }
- ast_md5_hash(buf, data);
- buf[32] = '\0';
- return 0;
- }
- static struct ast_custom_function md5_function = {
- .name = "MD5",
- .read = md5,
- .read_max = 33,
- };
- static int unload_module(void)
- {
- return ast_custom_function_unregister(&md5_function);
- }
- static int load_module(void)
- {
- return ast_custom_function_register(&md5_function);
- }
- AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MD5 digest dialplan functions");
|