]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Add exclude-error-log-from-xml-cdr config parameter and exclude_error_log_from...
authorAndrey Volk <andywolk@gmail.com>
Wed, 3 Mar 2021 22:29:10 +0000 (01:29 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:42 +0000 (22:00 +0300)
src/switch_core.c
src/switch_ivr.c

index c3ddc5124e57236e9b533f25bbdd5cfac9be9ee0..50ce348c95c1e2e3935efc01eefdbc8dbf02f225 100644 (file)
@@ -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)) {
index 51875e4c2592be4e190140be0811f55292b3528e..4f9d2d0cbd69f5dac6334bc1536a6dbdbadbf93d 100644 (file)
@@ -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;