[Freeswitch-svn] [commit] r4383 - freeswitch/branches/cparker/src/mod/event_handlers/mod_radius_cdr

Freeswitch SVN cparker at freeswitch.org
Fri Feb 23 17:37:57 EST 2007


Author: cparker
Date: Fri Feb 23 17:37:57 2007
New Revision: 4383

Added:
   freeswitch/branches/cparker/src/mod/event_handlers/mod_radius_cdr/Makefile
Modified:
   freeswitch/branches/cparker/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c

Log:
Added makefile, and corrected .c file to correctly compile

Added: freeswitch/branches/cparker/src/mod/event_handlers/mod_radius_cdr/Makefile
==============================================================================
--- (empty file)
+++ freeswitch/branches/cparker/src/mod/event_handlers/mod_radius_cdr/Makefile	Fri Feb 23 17:37:57 2007
@@ -0,0 +1,16 @@
+LDFLAGS += -lfreeradius-client
+
+all:	$(MODNAME).$(DYNAMIC_LIB_EXTEN)
+
+%.o:  %.c
+	$(CC) -fPIC $(CFLAGS) -c -o $@ $<
+
+$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c
+	$(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o 
+	$(LINKER) $(SOLINK) -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(MODNAME).o $(LDFLAGS)
+
+clean:
+	rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~
+
+install:
+	cp -f $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(PREFIX)/mod

Modified: freeswitch/branches/cparker/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
==============================================================================
--- freeswitch/branches/cparker/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c	(original)
+++ freeswitch/branches/cparker/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c	Fri Feb 23 17:37:57 2007
@@ -59,15 +59,15 @@
 	char 	dictionary[PATH_MAX] = "/usr/local/freeswitch/conf/radius/dictionary";
 	int 	num_servers = 0;
 	char 	*timeout = NULL;
-	int	*retries = NULL;
+	char	*retries = 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);
                 return SWITCH_STATUS_TERM;
         }
 
-	rh = rc_new();
-	if (rh == NULL) {
+	rad_config = rc_new();
+	if (rad_config == NULL) {
                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "initialization of radius_cdr_config structure failed\n");
                 return SWITCH_STATUS_TERM;
         }
@@ -80,7 +80,7 @@
                         char *val = (char *) switch_xml_attr_soft(param, "value");
 
                         if (!strcmp(var, "acctserver")) {
-				if (num_servers < MAX_SERVERS) {
+				if (num_servers < SERVER_MAX) {
 					if (rc_add_config(rad_config, var, val, cf, 0) != 0) {
 			                	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, 
 								"failed setting %s = %s failed\n", var, val);
@@ -90,7 +90,7 @@
 					num_servers++;
 				} else {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, 
-						"you can only specify %d radius servers, ignoring excess server entry\n", MAX_SERVERS);
+						"you can only specify %d radius servers, ignoring excess server entry\n", SERVER_MAX);
 				}
 			}
                         if (!strcmp(var, "dictionary")) {
@@ -143,7 +143,7 @@
 		}
 
 		/* Read the dictionary file(s) */
-		if (rc_read_dictionary(rh, rc_conf_str(rh, "dictionary")) != 0) {
+		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", dictionary);
 			rc_destroy(rad_config);
@@ -158,7 +158,7 @@
 	}
 
 	/* If we made it this far, we succeeded */
-	return SWITCH_STATUS_SUCCESS
+	return SWITCH_STATUS_SUCCESS;
 }
 
 static const switch_state_handler_table_t state_handlers = {



More information about the Freeswitch-svn mailing list