[Freeswitch-svn] [commit] r10258 - freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr

Freeswitch SVN anthm at freeswitch.org
Wed Nov 5 15:16:45 EST 2008


Author: anthm
Date: Wed Nov  5 15:16:44 2008
New Revision: 10258

Modified:
   freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c

Log:
google commit

Modified: freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c	Wed Nov  5 15:16:44 2008
@@ -36,7 +36,12 @@
 #include "mod_radius_cdr.h"
 
 SWITCH_MODULE_LOAD_FUNCTION(mod_radius_cdr_load);
-SWITCH_MODULE_DEFINITION(mod_radius_cdr, mod_radius_cdr_load, NULL, NULL);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_radius_shutdown);
+SWITCH_MODULE_DEFINITION(mod_radius_cdr, mod_radius_cdr_load, mod_cdr_radius_shutdown, NULL);
+
+static struct {
+	int shutdown
+} globals = { 0 };
 
 static char cf[] = "mod_radius_cdr.conf";
 static char my_dictionary[PATH_MAX];
@@ -368,6 +373,10 @@
 	switch_time_exp_t tm;
 	char buffer[32] = "";
 
+	if (globals.shutdown) {
+		return SWITCH_STATUS_FALSE;
+	}
+
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "[mod_radius_cdr] Entering my_on_hangup\n");
 
 	rad_config = my_radius_init();
@@ -684,6 +693,15 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
+
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_radius_csv_shutdown)
+{
+
+	globals.shutdown = 1;
+	switch_core_remove_state_handler(&state_handlers);
+	return SWITCH_STATUS_SUCCESS;
+}
+
 /* For Emacs:
  * Local Variables:
  * mode:c



More information about the Freeswitch-svn mailing list