[asterisk-commits] russell: branch russell/cdr-q r248751 - /team/russell/cdr-q/main/cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 24 23:48:08 CST 2010


Author: russell
Date: Wed Feb 24 23:48:04 2010
New Revision: 248751

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=248751
Log:
Remove duplicate callbacks in the backend struct, other random cleanup

Modified:
    team/russell/cdr-q/main/cdr.c

Modified: team/russell/cdr-q/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/russell/cdr-q/main/cdr.c?view=diff&rev=248751&r1=248750&r2=248751
==============================================================================
--- team/russell/cdr-q/main/cdr.c (original)
+++ team/russell/cdr-q/main/cdr.c Wed Feb 24 23:48:04 2010
@@ -96,13 +96,6 @@
 	 */
 	void *cb_data;
 	/*!
-	 * \brief Callback into the backend for posting CDR
-	 */
-	union {
-		ast_cdr_post_cb legacy_post_cb;
-		ast_cdr_sink_cb sink_cb;
-	};
-	/*!
 	 * \brief A taskprocessor for asynchronously posting CDRs to this backend
 	 */
 	struct ast_taskprocessor *tps;
@@ -420,8 +413,6 @@
 	ao2_unlink(cdr_backends, backend);
 
 	ao2_t_ref(backend, -1, "backend unregister");
-
-	ast_verb(2, "Unregistered '%s' CDR backend\n", name);
 }
 
 int ast_cdr_isset_unanswered(void)
@@ -520,10 +511,12 @@
 	const char *fmt = "%Y-%m-%d %T";
 	const char *varbuf;
 
-	if (!cdr)  /* don't die if the cdr is null */
+	if (!cdr) { /* don't die if the cdr is null */
 		return;
+	}
 
 	*ret = NULL;
+
 	/* special vars (the ones from the struct ast_cdr when requested by name)
 	   I'd almost say we should convert all the stringed vals to vars */
 
@@ -616,8 +609,10 @@
 	}
 
 	for (; cdr; cdr = recur ? cdr->next : NULL) {
-		if (ast_test_flag(cdr, AST_CDR_FLAG_DONT_TOUCH) && ast_test_flag(cdr, AST_CDR_FLAG_LOCKED))
+		if (ast_test_flag(cdr, AST_CDR_FLAG_DONT_TOUCH) && ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
 			continue;
+		}
+
 		headp = &cdr->varshead;
 		AST_LIST_TRAVERSE_SAFE_BEGIN(headp, newvariable, entries) {
 			if (!strcasecmp(ast_var_name(newvariable), name)) {
@@ -786,6 +781,7 @@
 				break;
 			}
 		}
+
 		if (tovarname && strcasecmp(fromvarval,tovarval) != 0) {  /* this message here to see how irritating the userbase finds it */
 			ast_log(LOG_NOTICE, "Merging CDR's: variable %s value %s dropped in favor of value %s\n", tovarname, fromvarval, tovarval);
 			continue;
@@ -1503,7 +1499,7 @@
 
 static void cdr_wrap_destructor(void *obj)
 {
-
+	/* mmmm, object NOM NOM NOM */
 }
 
 static struct cdr_wrap *wrap_cdr(struct ast_cdr_backend *backend, struct ast_cdr *cdr)




More information about the asterisk-commits mailing list