[asterisk-commits] russell: branch group/newcdr r201999 - in /team/group/newcdr: cel/ include/as...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 19 15:32:07 CDT 2009


Author: russell
Date: Fri Jun 19 15:32:04 2009
New Revision: 201999

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201999
Log:
doxygen updates, remove unnecessary casts, fix radius memory leak

Modified:
    team/group/newcdr/cel/cel_adaptive_odbc.c
    team/group/newcdr/cel/cel_manager.c
    team/group/newcdr/cel/cel_pgsql.c
    team/group/newcdr/cel/cel_radius.c
    team/group/newcdr/cel/cel_sqlite.c
    team/group/newcdr/cel/cel_tds.c
    team/group/newcdr/include/asterisk/cel.h
    team/group/newcdr/main/cel.c

Modified: team/group/newcdr/cel/cel_adaptive_odbc.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_adaptive_odbc.c?view=diff&rev=201999&r1=201998&r2=201999
==============================================================================
--- team/group/newcdr/cel/cel_adaptive_odbc.c (original)
+++ team/group/newcdr/cel/cel_adaptive_odbc.c Fri Jun 19 15:32:04 2009
@@ -367,9 +367,9 @@
 			ast_free(sql2);
 		return;
 	}
-	eventtype = (enum ast_cel_eventtype)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
-	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
-	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
+	eventtype = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	eventtime.tv_sec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
+	eventtime.tv_usec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
 	if (eventtype == CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}

Modified: team/group/newcdr/cel/cel_manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_manager.c?view=diff&rev=201999&r1=201998&r2=201999
==============================================================================
--- team/group/newcdr/cel/cel_manager.c (original)
+++ team/group/newcdr/cel/cel_manager.c Fri Jun 19 15:32:04 2009
@@ -152,9 +152,9 @@
 	}
 	ast_log(LOG_NOTICE,"Logging event to manager interface\n");
 
-	event_type = (enum ast_cel_event_type) ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
-	eventtime.tv_sec = (time_t) ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
-	eventtime.tv_usec = (time_t) ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
+	event_type = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	eventtime.tv_sec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
+	eventtime.tv_usec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
 	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}

Modified: team/group/newcdr/cel/cel_pgsql.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_pgsql.c?view=diff&rev=201999&r1=201998&r2=201999
==============================================================================
--- team/group/newcdr/cel/cel_pgsql.c (original)
+++ team/group/newcdr/cel/cel_pgsql.c Fri Jun 19 15:32:04 2009
@@ -125,10 +125,9 @@
 	const char *exten, *context, *channame, *appname, *appdata, *accountcode, *peeraccount, *uniqueid, *linkedid, *userfield, *peer;
 	unsigned int amaflag;
 
-	ast_log(LOG_NOTICE,"Logging event to pgsql interface\n");
-	event_type = (enum ast_cel_event_type)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
-	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
-	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
+	event_type = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	eventtime.tv_sec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
+	eventtime.tv_usec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
 	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}

Modified: team/group/newcdr/cel/cel_radius.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_radius.c?view=diff&rev=201999&r1=201998&r2=201999
==============================================================================
--- team/group/newcdr/cel/cel_radius.c (original)
+++ team/group/newcdr/cel/cel_radius.c Fri Jun 19 15:32:04 2009
@@ -192,10 +192,9 @@
 	const char *exten, *context, *channame, *appname, *appdata, *accountcode, *uniqueid, *linkedid;
 	unsigned int amaflag;
 
-	ast_log(LOG_NOTICE,"Logging event to radius interface\n");
-	event_type = (enum ast_cel_event_type)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
-	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
-	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
+	event_type = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	eventtime.tv_sec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
+	eventtime.tv_usec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
 	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}
@@ -220,14 +219,18 @@
 		if (option_debug) {
 			ast_log(LOG_DEBUG, "Unable to create RADIUS record. CEL not recorded!\n");
 		}
-		return;
+		goto return_cleanup;
 	}
 
 	result = rc_acct(rh, 0, send);
 	if (result != OK_RC) {
 		ast_log(LOG_ERROR, "Failed to record Radius CEL record!\n");
 	}
-	return;
+
+return_cleanup:
+	if (send) {
+		rc_avpair_free(send);
+	}
 }
 
 static int unload_module(void)

Modified: team/group/newcdr/cel/cel_sqlite.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_sqlite.c?view=diff&rev=201999&r1=201998&r2=201999
==============================================================================
--- team/group/newcdr/cel/cel_sqlite.c (original)
+++ team/group/newcdr/cel/cel_sqlite.c Fri Jun 19 15:32:04 2009
@@ -111,9 +111,9 @@
 	unsigned int amaflag;
 
 	ast_log(LOG_NOTICE,"Logging event to sqlite interface\n");
-	event_type = (enum ast_cel_event_type)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
-	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
-	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
+	event_type = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	eventtime.tv_sec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
+	eventtime.tv_usec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
 	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}

Modified: team/group/newcdr/cel/cel_tds.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_tds.c?view=diff&rev=201999&r1=201998&r2=201999
==============================================================================
--- team/group/newcdr/cel/cel_tds.c (original)
+++ team/group/newcdr/cel/cel_tds.c Fri Jun 19 15:32:04 2009
@@ -126,10 +126,9 @@
 	const char *eventname;
 	unsigned int amaflag;
 
-	ast_log(LOG_NOTICE,"Logging event to TDS interface\n");
-	event_type = (enum ast_cel_event_type)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
-	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
-	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
+	event_type = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	eventtime.tv_sec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
+	eventtime.tv_usec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
 	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}

Modified: team/group/newcdr/include/asterisk/cel.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/include/asterisk/cel.h?view=diff&rev=201999&r1=201998&r2=201999
==============================================================================
--- team/group/newcdr/include/asterisk/cel.h (original)
+++ team/group/newcdr/include/asterisk/cel.h Fri Jun 19 15:32:04 2009
@@ -147,13 +147,17 @@
  */
 const char *ast_cel_flags2str(enum ast_cel_ama_flag flag);
 
-/*! If at least one CEL backend is looking for CEL_LINKEDID_END
+/*! 
+ * \brief Check and potentially retire a Linked ID
+ *
+ * \param chan channel that is being destroyed or its linkedid is changing
+ *
+ * If at least one CEL backend is looking for CEL_LINKEDID_END
  * events, this function will check if the given channel is the last
  * active channel with that linkedid, and if it is, emit a
  * CEL_LINKEDID_END event.
  *
- * This should be called whenever a channel is freed or when a
- * channel's linkedid is changed
+ * \return nothing
  */
 void ast_cel_check_retire_linkedid(const struct ast_channel *chan);
 

Modified: team/group/newcdr/main/cel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/main/cel.c?view=diff&rev=201999&r1=201998&r2=201999
==============================================================================
--- team/group/newcdr/main/cel.c (original)
+++ team/group/newcdr/main/cel.c Fri Jun 19 15:32:04 2009
@@ -451,9 +451,9 @@
 	headp = &tchan->varshead;
 
 	/* first, get the variables from the event */
-	event_type = (enum ast_cel_event_type)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
-	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
-	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
+	event_type = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	eventtime.tv_sec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
+	eventtime.tv_usec = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
 	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}




More information about the asterisk-commits mailing list