[asterisk-commits] juggie: branch juggie/NoLossCDR r78522 - /team/juggie/NoLossCDR/main/cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 7 17:17:59 CDT 2007


Author: juggie
Date: Tue Aug  7 17:17:58 2007
New Revision: 78522

URL: http://svn.digium.com/view/asterisk?view=rev&rev=78522
Log:
more steps for cdr backends with multiple registrations

Modified:
    team/juggie/NoLossCDR/main/cdr.c

Modified: team/juggie/NoLossCDR/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/cdr.c?view=diff&rev=78522&r1=78521&r2=78522
==============================================================================
--- team/juggie/NoLossCDR/main/cdr.c (original)
+++ team/juggie/NoLossCDR/main/cdr.c Tue Aug  7 17:17:58 2007
@@ -66,6 +66,7 @@
 	char name[20];
 	char name_detail[20];
 	char desc[80];
+	void *data;
 	ast_cdrbe be;
 	void *be_data;
 	int cancel_thread;
@@ -91,11 +92,11 @@
 /*! Register a CDR driver. Each registered CDR driver generates a CDR 
 	\return 0 on success, -1 on failure 
 */
-int ast_cdr_register(const char *name, const char *name_detail, const char *desc, ast_cdrbe be)
+int ast_cdr_register(const char *name, const char *name_detail, const char *desc, ast_cdrbe be, void *data)
 {
 	struct ast_cdr_beitem *i = NULL;
 
-	if (!name)
+	if (!name || !desc)
 		return -1;
 
 	if (!be) {
@@ -122,8 +123,9 @@
 	if (name_detail)
 		ast_copy_string(i->name_detail, name_detail, sizeof(i->name_detail));
 	else
-		ast_copy_string(i->name_detail, "", sizeof(i->name_detail));
+		i->name_detail = NULL;
 	ast_copy_string(i->desc, desc, sizeof(i->desc));
+	i->data = data;
 	ast_cond_init(&i->cdr_pending_cond, NULL);
 	if (ast_pthread_create_background(&i->cdr_thread, NULL, do_cdr, i) < 0)
 		ast_log(LOG_ERROR, "Unable to start CDR thread.\n");




More information about the asterisk-commits mailing list