]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
freetdm: crash on assert
authorMoises Silva <moy@sangoma.com>
Tue, 31 Aug 2010 17:48:48 +0000 (13:48 -0400)
committerMoises Silva <moy@sangoma.com>
Tue, 31 Aug 2010 17:48:48 +0000 (13:48 -0400)
libs/freetdm/mod_freetdm/mod_freetdm.c

index c98117c80752c15895f360f9ef17228d67d8b1b9..e2ec6a854532d4c628923fb449b942c691286dc1 100755 (executable)
@@ -87,6 +87,7 @@ static struct {
        analog_option_t analog_options;
        switch_hash_t *ss7_configs;
        int sip_headers;
+       uint8_t crash_on_assert;
 } globals;
 
 /* private data attached to each fs session */
@@ -2389,6 +2390,8 @@ static switch_status_t load_config(void)
                                globals.debug = atoi(val);
                        } else if (!strcasecmp(var, "hold-music")) {
                                switch_set_string(globals.hold_music, val);
+                       } else if (!strcasecmp(var, "crash-on-assert")) {
+                               globals.crash_on_assert = switch_true(val);
                        } else if (!strcasecmp(var, "sip-headers")) {
                                globals.sip_headers = switch_true(val);
                        } else if (!strcasecmp(var, "enable-analog-option")) {
@@ -3358,6 +3361,10 @@ static switch_status_t load_config(void)
                }
        }
 
+       if (globals.crash_on_assert) {
+               ftdm_log(FTDM_LOG_WARNING, "Crash on assert enabled\n");
+               ftdm_global_set_crash_policy(FTDM_CRASH_ON_ASSERT);
+       }
 
        switch_xml_free(xml);