From 9a26e0cc2bbf153610eaf45d9ea72045aa29f2fb Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Tue, 31 Aug 2010 13:48:48 -0400 Subject: [PATCH] freetdm: crash on assert --- libs/freetdm/mod_freetdm/mod_freetdm.c | 7 +++++++ 1 file changed, 7 insertions(+) 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);