diff --git a/libs/freetdm/mod_freetdm/mod_freetdm.c b/libs/freetdm/mod_freetdm/mod_freetdm.c index c98117c807..e2ec6a8545 100755 --- a/libs/freetdm/mod_freetdm/mod_freetdm.c +++ b/libs/freetdm/mod_freetdm/mod_freetdm.c @@ -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);