*/
#include <switch.h>
-#include <curl/curl.h>
+#include <switch_curl.h>
#define SWITCH_REWIND_STREAM(s) s.end = s.data
return SWITCH_STATUS_TERM;
}
+ switch_curl_init();
+
SWITCH_ADD_API(api_interface, "cidlookup", "cidlookup API", cidlookup_function, SYNTAX);
SWITCH_ADD_APP(app_interface, "cidlookup", "Perform a CID lookup", "Perform a CID lookup",
cidlookup_app_function, "[number [skipurl]]", SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC);
Macro expands to: switch_status_t mod_cidlookup_shutdown() */
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cidlookup_shutdown)
{
-
+ switch_curl_destroy();
switch_event_unbind(&reload_xml_event);
return SWITCH_STATUS_SUCCESS;
}
*/
#include <switch.h>
-#include <curl/curl.h>
+#include <switch_curl.h>
#include <json.h>
/* Prototypes */
globals.pool = pool;
+ switch_curl_init();
+
SWITCH_ADD_API(api_interface, "curl", "curl API", curl_function, SYNTAX);
SWITCH_ADD_APP(app_interface, "curl", "Perform a http request", "Perform a http request",
curl_app_function, SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_curl_shutdown)
{
/* Cleanup dynamically allocated config settings */
-
+ switch_curl_destroy();
return SWITCH_STATUS_SUCCESS;
}
*
*/
#include <switch.h>
-#include <curl/curl.h>
+#include <switch_curl.h>
/* Defines module interface to FreeSWITCH */
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_http_cache_shutdown);
}
curl_easy_setopt(curl_handle, CURLOPT_UPLOAD, 1);
curl_easy_setopt(curl_handle, CURLOPT_PUT, 1);
+ curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl_handle, CURLOPT_URL, url);
curl_easy_setopt(curl_handle, CURLOPT_READDATA, file_to_put);
curl_easy_setopt(curl_handle, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size);
setup_dir(&gcache);
/* init CURL */
- curl_global_init(CURL_GLOBAL_ALL);
+ switch_curl_init();
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
*/
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_http_cache_shutdown)
{
+ switch_curl_destroy();
url_cache_clear(&gcache, NULL);
switch_core_hash_destroy(&gcache.map);
switch_mutex_destroy(gcache.mutex);
*/
#include <sys/stat.h>
#include <switch.h>
-#include <curl/curl.h>
+#include <switch_curl.h>
#include <json.h>
#define MAX_URLS 20
curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl_handle, CURLOPT_POST, 1);
+ curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, curl_json_text);
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-json/1.0");
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, httpCallBack);
globals.retries++;
+ switch_curl_init();
set_json_cdr_log_dirs();
switch_xml_free(xml);
globals.shutdown = 1;
+ switch_curl_destroy();
switch_safe_free(globals.log_dir);
for (;err_dir_index < globals.err_dir_count; err_dir_index++) {
}
curl_easy_setopt(curl_handle, CURLOPT_URL, url);
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1);
+ curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 10);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, hash_callback);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) &config_data);
method, url_p, data, switch_str_nil(cred), co->function ? "yes" : "no");
curl_easy_setopt(co->curl_handle, CURLOPT_URL, url_p);
+ curl_easy_setopt(co->curl_handle, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(co->curl_handle, CURLOPT_WRITEFUNCTION, file_callback);
curl_easy_setopt(co->curl_handle, CURLOPT_WRITEDATA, (void *) co);
curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl_handle, CURLOPT_POST, 1);
+ curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, curl_xml_text);
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-xml/1.0");
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, httpCallBack);
memset(&runtime, 0, sizeof(runtime));
gethostname(runtime.hostname, sizeof(runtime.hostname));
+ switch_ssl_init_ssl_locks();
+
runtime.max_db_handles = 50;
runtime.db_handle_timeout = 5000000;;
switch_uuid_get(&uuid);
switch_uuid_format(runtime.uuid_str, &uuid);
- switch_ssl_init_ssl_locks();
+
return SWITCH_STATUS_SUCCESS;
}