[Freeswitch-svn] [commit] r6142 - freeswitch/trunk/src/mod/applications/mod_limit

Freeswitch SVN anthm at freeswitch.org
Fri Nov 2 13:23:39 EDT 2007


Author: anthm
Date: Fri Nov  2 13:23:38 2007
New Revision: 6142

Modified:
   freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c

Log:
small fix

Modified: freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c	Fri Nov  2 13:23:38 2007
@@ -170,6 +170,7 @@
     switch_status_t status = SWITCH_STATUS_SUCCESS;
     char *odbc_user = NULL;
     char *odbc_pass = NULL;
+    char *sql = NULL;
 
 	if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
@@ -237,6 +238,12 @@
 
  done:
 
+    sql = switch_mprintf("delete from limit_data where hostname='%q';", globals.hostname);
+    limit_execute_sql(sql, globals.mutex);
+    switch_safe_free(sql);
+
+    switch_xml_free(xml);
+
     return status;
 
 }
@@ -259,7 +266,6 @@
         realm = switch_channel_get_variable(channel, "limit_realm");
         sql = switch_mprintf("delete from limit_data where uuid='%q' and hostname='%q' and realm='%q'and id='%q';", 
                              switch_core_session_get_uuid(session), globals.hostname, realm, id);
-        printf("wtf [%s]\n", sql);
         limit_execute_sql(sql, globals.mutex);
         switch_safe_free(sql);
         switch_core_event_hook_remove_state_change(session, hanguphook);



More information about the Freeswitch-svn mailing list