diff --git a/src/switch_core.c b/src/switch_core.c index c3ddc5124e..50ce348c95 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -2309,6 +2309,13 @@ static void switch_load_core_config(const char *file) switch_core_set_variable("spawn_instead_of_system", "false"); } #endif + } else if (!strcasecmp(var, "exclude-error-log-from-xml-cdr") && !zstr(val)) { + int v = switch_true(val); + if (v) { + switch_core_set_variable("exclude_error_log_from_xml_cdr", "true"); + } else { + switch_core_set_variable("exclude_error_log_from_xml_cdr", "false"); + } } else if (!strcasecmp(var, "min-idle-cpu") && !zstr(val)) { switch_core_min_idle_cpu(atof(val)); } else if (!strcasecmp(var, "tipping-point") && !zstr(val)) { diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 51875e4c25..4f9d2d0cbd 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -2690,6 +2690,7 @@ SWITCH_DECLARE(int) switch_ivr_set_xml_call_stats(switch_xml_t xml, switch_core_ int loff = 0; switch_rtp_stats_t *stats = switch_core_media_get_stats(session, type, NULL); char var_val[35] = ""; + switch_bool_t exclude_error_log_from_xml_cdr = switch_true(switch_core_get_variable("exclude_error_log_from_xml_cdr")); if (!stats) return off; @@ -2727,7 +2728,7 @@ SWITCH_DECLARE(int) switch_ivr_set_xml_call_stats(switch_xml_t xml, switch_core_ add_stat_double(x_in, stats->inbound.mos, "mos"); - if (stats->inbound.error_log) { + if (stats->inbound.error_log && !exclude_error_log_from_xml_cdr) { switch_xml_t x_err_log, x_err; switch_error_period_t *ep; int eoff = 0;