mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-28 14:14:16 +00:00
FS-2936 stage 1
This commit is contained in:
1 parent
f41020a625
commit
e58ed35d17
8 files changed
+22
-8
No files matched your search
@@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <switch.h>
|
||||
#include <curl/curl.h>
|
||||
#include <switch_curl.h>
|
||||
|
||||
#define SWITCH_REWIND_STREAM(s) s.end = s.data
|
||||
|
||||
@@ -839,6 +839,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cidlookup_load)
|
||||
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);
|
||||
@@ -852,7 +854,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cidlookup_load)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <switch.h>
|
||||
#include <curl/curl.h>
|
||||
#include <switch_curl.h>
|
||||
#include <json.h>
|
||||
|
||||
/* Prototypes */
|
||||
@@ -412,6 +412,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_curl_load)
|
||||
|
||||
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);
|
||||
@@ -426,7 +428,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_curl_load)
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_curl_shutdown)
|
||||
{
|
||||
/* Cleanup dynamically allocated config settings */
|
||||
|
||||
switch_curl_destroy();
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*
|
||||
*/
|
||||
#include <switch.h>
|
||||
#include <curl/curl.h>
|
||||
#include <switch_curl.h>
|
||||
|
||||
/* Defines module interface to FreeSWITCH */
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_http_cache_shutdown);
|
||||
@@ -205,6 +205,7 @@ static switch_status_t http_put(switch_core_session_t *session, const char *url,
|
||||
}
|
||||
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);
|
||||
@@ -1011,7 +1012,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load)
|
||||
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;
|
||||
@@ -1022,6 +1023,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load)
|
||||
*/
|
||||
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);
|
||||
|
||||
Reference in new issue
Block a user