diff --git a/src/modules/http_async_client/doc/http_async_client_admin.xml b/src/modules/http_async_client/doc/http_async_client_admin.xml
index 73fdf32841c..5a050bf424e 100644
--- a/src/modules/http_async_client/doc/http_async_client_admin.xml
+++ b/src/modules/http_async_client/doc/http_async_client_admin.xml
@@ -299,6 +299,11 @@ modparam("http_async_client", "tls_ca_path", "/etc/kamailio/ssl/ca/")
If defined to a non-zero value, TCP keepalive will be enabled on cURL connections.
+
+
+ Requires libcurl >= 7.25.0
+
+
Default value is 0 (disabled).
diff --git a/src/modules/http_async_client/http_multi.c b/src/modules/http_async_client/http_multi.c
index 43936a78de8..948171b5194 100644
--- a/src/modules/http_async_client/http_multi.c
+++ b/src/modules/http_async_client/http_multi.c
@@ -529,6 +529,7 @@ int new_request(str *query, http_m_params_t *query_params, http_multi_cbe_t cb,
/* enable tcp keepalives for the handler */
if (cell->params.tcp_keepalive) {
+#ifdef CURLOPT_TCP_KEEPALIVE
LM_DBG("Enabling TCP keepalives\n");
curl_easy_setopt(cell->easy, CURLOPT_TCP_KEEPALIVE, 1L);
@@ -541,6 +542,9 @@ int new_request(str *query, http_m_params_t *query_params, http_multi_cbe_t cb,
curl_easy_setopt(cell->easy, CURLOPT_TCP_KEEPINTVL, cell->params.tcp_ka_interval);
LM_DBG("CURLOPT_TCP_KEEPINTERVAL set to %d\n", cell->params.tcp_ka_interval);
}
+#else
+ LM_DBG("tcp_keepalive configured, but installed cURL version doesn't include CURLOPT_TCP_KEEPINTERVAL.\n");
+#endif
}
LM_DBG("Adding easy %p to multi %p (%.*s)\n", cell->easy, g->multi, query->len, query->s);