2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 2005-2006, Digium, Inc.
5 * Copyright (C) 2005, Olle E. Johansson, Edvina.net
6 * Copyright (C) 2005, Russell Bryant <russelb@clemson.edu>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
21 * \brief MD5 digest related dialplan functions
23 * \author Olle E. Johansson <oej@edvina.net>
24 * \author Russell Bryant <russelb@clemson.edu>
29 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
34 #include <sys/types.h>
36 #include "asterisk/module.h"
37 #include "asterisk/channel.h"
38 #include "asterisk/pbx.h"
39 #include "asterisk/logger.h"
40 #include "asterisk/utils.h"
41 #include "asterisk/app.h"
43 static int md5(struct ast_channel *chan, char *cmd, char *data,
44 char *buf, size_t len)
46 if (ast_strlen_zero(data)) {
47 ast_log(LOG_WARNING, "Syntax: MD5(<data>) - missing argument!\n");
51 ast_md5_hash(buf, data);
57 static struct ast_custom_function md5_function = {
59 .synopsis = "Computes an MD5 digest",
60 .syntax = "MD5(<data>)",
64 static int unload_module(void)
66 return ast_custom_function_unregister(&md5_function);
69 static int load_module(void)
71 return ast_custom_function_register(&md5_function);
74 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MD5 digest dialplan functions");