lib_LTLIBRARIES = libfreeswitch.la
libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(AM_CFLAGS)
libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_DEPLIBS)
-libfreeswitch_la_LIBADD = $(CORE_LIBS)
+libfreeswitch_la_LIBADD = $(CORE_LIBS) $(LIBCURL)
libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES)
if HAVE_ODBC
libs/libteletone/src/libteletone_generate.h \
libs/libteletone/src/libteletone.h \
src/include/switch_limit.h \
- src/include/switch_odbc.h
+ src/include/switch_odbc.h \
+ src/include/switch_curl.h
nodist_libfreeswitch_la_SOURCES = \
src/include/switch_frame.h \
src/switch_pcm.c \
src/switch_profile.c \
src/switch_json.c \
+ src/switch_curl.c \
libs/stfu/stfu.c \
libs/libteletone/src/libteletone_detect.c \
libs/libteletone/src/libteletone_generate.c \
MAKE_OPTS = `test -n "$(VERBOSE)" || echo -s`
RECURSE_MODNAME=`pwd | sed -e 's|^.*/||'`
RECURSE_SOURCEFILE=`if test -f "$$modname.cpp" -o -f "$(MODDIR)/$$modname.cpp"; then echo "$$modname.cpp"; else echo "$$modname.c"; fi`
-RECURSE_OUR_DEPS=`test -z "$(WANT_CURL)" || if test ! -z "$(LIBCURL_DEPS)"; then echo $(CURLLA); fi `
-RECURSE_OUR_CFLAGS=`test -z "$(WANT_CURL)" || echo $(LIBCURL_CPPFLAGS) ; $(LOCAL_INSERT_CFLAGS) `
-RECURSE_OUR_LDFLAGS=`test -z "$(WANT_CURL)" || echo $(LIBCURL) ; $(LOCAL_INSERT_LDFLAGS) `
+RECURSE_OUR_DEPS=
+RECURSE_OUR_CFLAGS=`$(LOCAL_INSERT_CFLAGS)`
+RECURSE_OUR_LDFLAGS=`$(LOCAL_INSERT_LDFLAGS)`
RECURSE_MODDIR=`if test -z $(MODDIR); then pwd | sed -e 's|$(switch_builddir)|$(switch_srcdir)|'; else echo $(MODDIR); fi`
RECURSE_MAKE=+modname="$(RECURSE_MODNAME)" ; \
sourcefile="$(RECURSE_SOURCEFILE)" ; \
LIBCURL_DEPS='${switch_builddir}/libs/curl/lib/libcurl.la'
LIBCURL='${switch_builddir}/libs/curl/lib/libcurl.la'
LIBCURL_CPPFLAGS='-I${switch_srcdir}/libs/curl/include'
+else
+ AC_CHECK_LIB(curl, curl_global_init, have_curl=yes, have_curl=no)
+ if test "x$have_curl" = "xyes" ; then
+ APR_ADDTO(SWITCH_AM_LDFLAGS, -lcurl)
+ fi
fi
AC_SUBST(LIBCURL_DEPS)
#include "switch_odbc.h"
#include "switch_json.h"
#include "switch_limit.h"
+#ifndef WIN32
+#include "switch_curl.h"
+#endif
#include <libteletone.h>
-WANT_CURL=yes
BASE=../../../..
include $(BASE)/build/modmake.rules
json-c=json-c-0.9
BASE=../../../..
-WANT_CURL=yes
JSON_DIR=$(switch_srcdir)/libs/$(json-c)
JSON_BUILDDIR=$(switch_builddir)/libs/$(json-c)
MEMCACHED=libmemcached-0.32
BASE=../../../..
-WANT_CURL=yes
-
MEMCACHED_DIR=$(switch_srcdir)/libs/$(MEMCACHED)
MEMCACHED_BUILDDIR=$(switch_builddir)/libs/$(MEMCACHED)
json-c=json-c-0.9
BASE=../../../..
-WANT_CURL=yes
JSON_DIR=$(switch_srcdir)/libs/$(json-c)
JSON_BUILDDIR=$(switch_builddir)/libs/$(json-c)
MPG123=mpg123-1.13.2
BASE=../../../..
-WANT_CURL=yes
-
LAME_DIR=$(switch_srcdir)/libs/$(LAME)
SHOUT_DIR=$(switch_srcdir)/libs/$(SHOUT)
MPG123_DIR=$(switch_srcdir)/libs/$(MPG123)
supported_formats[0] = "shout";
supported_formats[1] = "mp3";
- curl_global_init(CURL_GLOBAL_ALL);
-
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_shout_shutdown)
{
- curl_global_cleanup();
mpg123_exit();
return SWITCH_STATUS_SUCCESS;
}
url = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
filename = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
- curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
if (!strncasecmp(url, "https", 5)) {
curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
JS_ValueToInt32(cx, argv[1], &buffer_size);
}
- curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
if (!strncasecmp(url, "https", 5)) {
curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
SWITCH_ADD_APP(app_interface, "javascript", "Launch JS ivr", "Run a javascript ivr on a channel", js_dp_function, "<script> [additional_vars [...]]",
SAF_SUPPORT_NOMEDIA);
- curl_global_init(CURL_GLOBAL_ALL);
-
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_NOUNLOAD;
}
// this causes a crash
//JS_DestroyRuntime(globals.rt);
- curl_global_cleanup();
-
switch_core_hash_destroy(&module_manager.mod_hash);
switch_core_hash_destroy(&module_manager.load_hash);
return SWITCH_STATUS_SUCCESS;
SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t ** module_interface)
{
- curl_global_init(CURL_GLOBAL_ALL);
*module_interface = &curl_module_interface;
return SWITCH_STATUS_SUCCESS;
}
-WANT_CURL=yes
include ../../../../build/modmake.rules
-WANT_CURL=yes
include ../../../../build/modmake.rules
globals.hash_root = NULL;
globals.hash_tail = NULL;
- if (do_config() == SWITCH_STATUS_SUCCESS) {
- curl_global_init(CURL_GLOBAL_ALL);
- } else {
+ if (do_config() != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_FALSE;
}
}
switch_xml_unbind_search_function_ptr(xml_url_fetch);
- curl_global_cleanup();
return SWITCH_STATUS_SUCCESS;
}
switch_core_set_variable("switch_serial", buf);
}
+
SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switch_bool_t console, const char **err)
{
switch_uuid_t uuid;
switch_uuid_get(&uuid);
switch_uuid_format(runtime.uuid_str, &uuid);
+#ifndef WIN32
+ switch_curl_init(runtime.memory_pool);
+#endif
+
return SWITCH_STATUS_SUCCESS;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Clean up modules.\n");
switch_loadable_module_shutdown();
+#ifndef WIN32
+ switch_curl_destroy();
+#endif
if (switch_test_flag((&runtime), SCF_USE_SQL)) {
switch_core_sqldb_stop();