diff --git a/configure.in b/configure.in index 8031700ac6..a343ad3e9e 100644 --- a/configure.in +++ b/configure.in @@ -425,6 +425,13 @@ fi fi +AC_ARG_ENABLE(deprecated-core-db-events, + [AS_HELP_STRING([--enable-deprecated-core-db-events], [Keep deprecated core db events])],,[enable_deprecated_core_db_events="no"]) + +if test x"$enable_deprecated_core_db_events" = x"yes" ; then + AC_DEFINE([SWITCH_DEPRECATED_CORE_DB], [1], [Define to 1 to enable deprecated core db events]) +fi + AC_ARG_ENABLE(timerfd-wrapper, [AC_HELP_STRING([--enable-timerfd-wrapper],[timerfd is in the kernel but not in your libc])],[enable_timer_fd_wrapper="$enableval"],[enable_timer_fd_wrapper="no"]) AM_CONDITIONAL([ENABLE_TIMERFD_WRAPPER],[test "x$enable_timer_fd_wrapper" != "xno"]) diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 64fc933d33..ba3f116d3c 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -1973,14 +1973,18 @@ static void core_event_handler(switch_event_t *event) case CS_NEW: case CS_DESTROY: case CS_REPORTING: - //case CS_HANGUP: /* marked for deprication */ +#ifndef SWITCH_DEPRECATED_CORE_DB + case CS_HANGUP: /* marked for deprication */ +#endif case CS_INIT: break; +#ifdef SWITCH_DEPRECATED_CORE_DB case CS_HANGUP: /* marked for deprication */ new_sql_a() = switch_mprintf("update channels set state='%s' where uuid='%s'", switch_event_get_header_nil(event, "channel-state"), switch_event_get_header_nil(event, "unique-id")); break; +#endif case CS_EXECUTE: if ((extra_cols = parse_presence_data_cols(event))) { new_sql() = switch_mprintf("update channels set state='%s',%s where uuid='%q'",