Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "asterisk.h"
00034
00035 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 125055 $")
00036
00037 #include <curl/curl.h>
00038
00039 #include "asterisk/module.h"
00040
00041 static int unload_module(void)
00042 {
00043 int res = 0;
00044
00045
00046 if (ast_module_check("func_curl.so")) {
00047 ast_log(LOG_ERROR, "func_curl.so (dependent module) is still loaded. Cannot unload res_curl.so\n");
00048 return -1;
00049 }
00050
00051 if (ast_module_check("res_config_curl.so")) {
00052 ast_log(LOG_ERROR, "res_config_curl.so (dependent module) is still loaded. Cannot unload res_curl.so\n");
00053 return -1;
00054 }
00055
00056 curl_global_cleanup();
00057
00058 return res;
00059 }
00060
00061 static int load_module(void)
00062 {
00063 int res = 0;
00064
00065 if (curl_global_init(CURL_GLOBAL_ALL)) {
00066 ast_log(LOG_ERROR, "Unable to initialize the CURL library. Cannot load res_curl\n");
00067 return AST_MODULE_LOAD_DECLINE;
00068 }
00069
00070 return res;
00071 }
00072
00073 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "cURL Resource Module");
00074
00075