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

Freeswitch SVN cparker at freeswitch.org
Wed Mar 5 11:18:11 EST 2008


Author: cparker
Date: Wed Mar  5 11:18:11 2008
New Revision: 7792

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.conf.xml

Log:
Updated module to handle new radius_deadtime option in radiusclient

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 Mar  5 11:18:11 2008
@@ -40,6 +40,7 @@
 
 static char		cf[] = "mod_radius_cdr.conf";
 static char		my_dictionary[PATH_MAX];
+static char *		my_deadtime; /* 0 */
 static char *		my_timeout; /* 5 */
 static char *		my_retries; /* 3 */
 static char		my_servers[SERVER_MAX][255];
@@ -58,7 +59,7 @@
 	rad_config = rc_config_init(rad_config);
 
 	if (rad_config == NULL) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "[mod_radius_cdr] Error initializing radius config!\n");
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error initializing radius config!\n");
 		rc_destroy(rad_config);
 		return NULL;
 	}	
@@ -66,14 +67,14 @@
 	/* Some hardcoded ( for now ) defaults needed to initialize radius */
 	if (rc_add_config(rad_config, "auth_order", "radius", "mod_radius_cdr.c", 0) != 0) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, 
-					"[mod_radius_cdr] failed setting auth_order = radius\n");
+					"setting auth_order = radius failed\n");
 		rc_destroy(rad_config);
 		return NULL;
 	}
 
 	if (rc_add_config(rad_config, "seqfile", "/var/run/radius.seq", "mod_radius_cdr.c", 0) != 0) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, 
-					"failed setting seqfile =  /var/run/radius.seq\n");
+					"setting seqfile =  /var/run/radius.seq failed\n");
 		rc_destroy(rad_config);
 		return NULL;
 	}
@@ -96,16 +97,23 @@
 		return NULL;
 	}
 
+	if (rc_add_config(rad_config, "radius_deadtime", my_deadtime, cf, 0) != 0) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, 
+				"setting radius_deadtime = %s failed\n", my_deadtime);
+		rc_destroy(rad_config);
+		return NULL;
+	}
+
 	if (rc_add_config(rad_config, "radius_timeout", my_timeout, cf, 0) != 0) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, 
-				"failed setting radius_timeout = %s failed\n", my_timeout);
+				"setting radius_timeout = %s failed\n", my_timeout);
 		rc_destroy(rad_config);
 		return NULL;
 	}
 
 	if (rc_add_config(rad_config, "radius_retries", my_retries, cf, 0) != 0) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, 
-				"failed setting radius_retries = %s failed\n", my_retries);
+				"setting radius_retries = %s failed\n", my_retries);
 		rc_destroy(rad_config);
 	        return NULL;
 	}
@@ -113,7 +121,7 @@
 	/* Read the dictionary file(s) */
 	if (rc_read_dictionary(rad_config, rc_conf_str(rad_config, "dictionary")) != 0) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, 
-				"failed reading dictionary file(s): %s\n", my_dictionary);
+				"reading dictionary file(s): %s\n", my_dictionary);
 		rc_destroy(rad_config);
 		return NULL;
 	}

Modified: freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.conf.xml
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.conf.xml	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.conf.xml	Wed Mar  5 11:18:11 2008
@@ -6,6 +6,18 @@
 		<param name="radius_retries" value="3"/>
 		<!-- number of seconds to wait between retries -->
 		<param name="radius_timeout" value="5"/>
+
+		<!-- The length of time in seconds that we skip a nonresponsive RADIUS
+			 server for transaction requests. Server(s) being in the "dead" state
+			 are tried only after all other non-dead servers have been tried and
+			 failed or timeouted. The deadtime interval starts when the server
+			 does not respond to an authentication/accounting request transmissions.
+			 When the interval expires, the "dead" server would be re-tried again,
+			 and if it's still down then it will be considered "dead" for another
+			 such interval and so on. This option is no-op if there is only one
+			 server in the list. Set to 0 in order to disable the feature. -->
+		<param name="radius_deadtime" value="0"/>
+
 		<!-- accounting servers, up to 8 allowed -->
 		<!-- value is "host:port:secret", port is optional -->
 		<!-- use IP ADDRESSES, not hostnames -->



More information about the Freeswitch-svn mailing list