]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
google commit
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 5 Nov 2008 20:16:44 +0000 (20:16 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 5 Nov 2008 20:16:44 +0000 (20:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10258 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c

index 8b2b1daeab11a798093fe3c3b26123fefb6d8919..1e8c070bdfba16885650c633e57cb1f0bde1d63d 100644 (file)
 #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 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
        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 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_radius_cdr_load)
        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