FS-5914 --resolve

This commit is contained in:
Marc Olivier Chouinard 2014-02-24 20:37:10 -05:00
parent 9f98ccc105
commit 7c440105ac

View File

@ -64,6 +64,7 @@ static struct {
uint32_t enable_ssl_verifyhost; uint32_t enable_ssl_verifyhost;
int encode; int encode;
int log_http_and_disk; int log_http_and_disk;
switch_bool_t log_errors_to_disk;
int log_b; int log_b;
int prefix_a; int prefix_a;
int disable100continue; int disable100continue;
@ -386,6 +387,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
curl_handle = NULL; curl_handle = NULL;
/* if we are here the web post failed for some reason */ /* if we are here the web post failed for some reason */
if (globals.log_errors_to_disk) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to post to web server, writing to file\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to post to web server, writing to file\n");
for (err_dir_index = 0; err_dir_index < globals.err_dir_count; err_dir_index++) { for (err_dir_index = 0; err_dir_index < globals.err_dir_count; err_dir_index++) {
@ -416,6 +418,9 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
switch_safe_free(path); switch_safe_free(path);
} }
} }
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to post to web server, not writing to file\n");
}
} }
success: success:
status = SWITCH_STATUS_SUCCESS; status = SWITCH_STATUS_SUCCESS;
@ -484,6 +489,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_json_cdr_load)
} }
globals.log_http_and_disk = 0; globals.log_http_and_disk = 0;
globals.log_errors_to_disk = SWITCH_TRUE;
globals.log_b = 1; globals.log_b = 1;
globals.disable100continue = 0; globals.disable100continue = 0;
globals.pool = pool; globals.pool = pool;
@ -513,6 +519,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_json_cdr_load)
} }
} else if (!strcasecmp(var, "log-http-and-disk")) { } else if (!strcasecmp(var, "log-http-and-disk")) {
globals.log_http_and_disk = switch_true(val); 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, "delay") && !zstr(val)) { } else if (!strcasecmp(var, "delay") && !zstr(val)) {
globals.delay = (uint32_t) atoi(val); globals.delay = (uint32_t) atoi(val);
} else if (!strcasecmp(var, "log-b-leg")) { } else if (!strcasecmp(var, "log-b-leg")) {