<!-- HTTP(S) logging -->
<!-- URL where to POST JSON CDRs. Leave empty for no URL logging. Up to 20 URLs may be specified. -->
<param name="url" value=""/>
+ <!-- optional timeout : second -->
+ <param name="timeout" value="5"/>
<!-- Authentication scheme for the above URL. May be one of basic|digest|NTLM|GSS-NEGOTIATE|any-->
<param name="auth-scheme" value="basic"/>
<!-- Credentials in the form username:password if auth-scheme is used. Leave empty for no authentication. -->
int disable100continue;
int rotate;
long auth_scheme;
+ int timeout;
switch_memory_pool_t *pool;
switch_event_node_t *node;
int encode_values;
switch_curl_easy_setopt(curl_handle, CURLOPT_CAINFO, globals.ssl_cacert_file);
}
+ // tcp timeout
+ switch_curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, globals.timeout);
+
/* these were used for testing, optionally they may be enabled if someone desires
- switch_curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, 120); // tcp timeout
switch_curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1); // 302 recursion level
*/
globals.log_http_and_disk = switch_true(val);
} else if (!strcasecmp(var, "log-errors-to-disk")) {
globals.log_errors_to_disk = !switch_false(val);
+ } else if (!strcasecmp(var, "timeout")) {
+ int tmp = atoi(val);
+ if (tmp >= 0) {
+ globals.timeout = tmp;
+ } else {
+ globals.timeout = 0;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't set a negative timeout!\n");
+ }
} else if (!strcasecmp(var, "delay") && !zstr(val)) {
globals.delay = (uint32_t) atoi(val);
} else if (!strcasecmp(var, "log-b-leg")) {