Revision
17466
Author
brian
Date
2010-05-01 19:49:17 -0500 (Sat, 01 May 2010)

Log Message

 XML-26

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c (17465 => 17466)


--- freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c	2010-05-02 00:45:55 UTC (rev 17465)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c	2010-05-02 00:49:17 UTC (rev 17466)
@@ -67,6 +67,7 @@
 	int disable100continue;
 	int rotate;
 	int auth_scheme;
+	int timeout;
 	switch_memory_pool_t *pool;
 } globals;
 
@@ -326,9 +327,10 @@
 		if (globals.ssl_cacert_file) {
 			curl_easy_setopt(curl_handle, CURLOPT_CAINFO, globals.ssl_cacert_file);
 		}
+		
+		curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, globals.timeout);
 
 		/* these were used for testing, optionally they may be enabled if someone desires
-		   curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, 120); // tcp timeout
 		   curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1); // 302 recursion level
 		 */
 
@@ -499,6 +501,14 @@
 				}
 			} else if (!strcasecmp(var, "log-http-and-disk")) {
 				globals.log_http_and_disk = switch_true(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")) {