From: Anthony Minessale Date: Fri, 22 Aug 2008 17:18:26 +0000 (+0000) Subject: remove stuff from the db on unload X-Git-Tag: v1.0.2~1390 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5708d0b6bd8b31b7965dcd9dcfbeed4adeed1199;p=thirdparty%2Ffreeswitch.git remove stuff from the db on unload git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9351 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index e0f1f3e58e..e59ea53682 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -355,6 +355,15 @@ static void core_event_handler(switch_event_t *event) } break; } + case SWITCH_EVENT_MODULE_UNLOAD: + { + const char *type = switch_event_get_header_nil(event, "type"); + const char *name = switch_event_get_header_nil(event, "name"); + if (!switch_strlen_zero(type) && !switch_strlen_zero(name)) { + sql = switch_mprintf("delete from interfaces where type='%q' and name='%q'", type, name); + } + break; + } default: break; }