Remove the code that decided when device state changes should be cached or not.
[asterisk-bristuff.git] / res / res_curl.c
blob9e3284bd7c4b099f8b07123f8e66bfa981300cdd
1 /*
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.
19 /*! \file
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/
29 /*** MODULEINFO
30 <depend>curl</depend>
31 ***/
33 #include "asterisk.h"
35 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
37 #include <curl/curl.h>
39 #include "asterisk/module.h"
41 static int unload_module(void)
43 int res = 0;
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");
48 return -1;
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");
53 return -1;
56 curl_global_cleanup();
58 return res;
61 static int load_module(void)
63 int res = 0;
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;
70 return res;
73 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "cURL Resource Module");