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>
30 <support_level>core</support_level>
35 #include "asterisk/module.h"
36 #include "asterisk/pbx.h"
39 <function name="MD5" language="en_US">
41 Computes an MD5 digest.
44 <parameter name="data" required="true" />
47 <para>Computes an MD5 digest.</para>
52 static int md5(struct ast_channel *chan, const char *cmd, char *data,
53 char *buf, size_t len)
55 if (ast_strlen_zero(data)) {
56 ast_log(LOG_WARNING, "Syntax: MD5(<data>) - missing argument!\n");
60 ast_md5_hash(buf, data);
66 static struct ast_custom_function md5_function = {
72 static int unload_module(void)
74 return ast_custom_function_unregister(&md5_function);
77 static int load_module(void)
79 return ast_custom_function_register(&md5_function);
82 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MD5 digest dialplan functions");