]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
remove stuff from the db on unload
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 22 Aug 2008 17:18:26 +0000 (17:18 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 22 Aug 2008 17:18:26 +0000 (17:18 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9351 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core_sqldb.c

index e0f1f3e58e73ec6526d1353c815d2b874fd67d9b..e59ea53682e9fbc2a606d37a5a11a7ab745c7401 100644 (file)
@@ -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;
        }