2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (c) 2008, Digium, Inc.
6 * Tilghman Lesher <res_curl_v1@the-tilghman.com>
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 curl resource engine
23 * \author Tilghman Lesher <res_curl_v1@the-tilghman.com>
25 * \extref Depends on the CURL library - http://curl.haxx.se/
35 ASTERISK_FILE_VERSION(__FILE__
, "$Revision$")
37 #include <curl/curl.h>
39 #include "asterisk/module.h"
41 static int unload_module(void)
45 /* If the dependent modules are still in memory, forbid unload */
46 if (ast_module_check("func_curl.so")) {
47 ast_log(LOG_ERROR
, "func_curl.so (dependent module) is still loaded. Cannot unload res_curl.so\n");
51 if (ast_module_check("res_config_curl.so")) {
52 ast_log(LOG_ERROR
, "res_config_curl.so (dependent module) is still loaded. Cannot unload res_curl.so\n");
56 curl_global_cleanup();
61 static int load_module(void)
65 if (curl_global_init(CURL_GLOBAL_ALL
)) {
66 ast_log(LOG_ERROR
, "Unable to initialize the CURL library. Cannot load res_curl\n");
67 return AST_MODULE_LOAD_DECLINE
;
73 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY
, "cURL Resource Module");