[Asterisk-cvs] asterisk cdr.c,1.20,1.21

markster at lists.digium.com markster at lists.digium.com
Fri Sep 10 09:38:55 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv13824

Modified Files:
	cdr.c 
Log Message:
Handle macros in the CDR properly (bug #2414)


Index: cdr.c
===================================================================
RCS file: /usr/cvsroot/asterisk/cdr.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cdr.c	9 Jul 2004 10:08:09 -0000	1.20
+++ cdr.c	10 Sep 2004 13:40:56 -0000	1.21
@@ -3,9 +3,9 @@
  *
  * Call Detail Record API 
  * 
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999-2004, Digium, Inc.
  *
- * Mark Spencer <markster at linux-support.net>
+ * Mark Spencer <markster at digium.com>
  *
  * This program is free software, distributed under the terms of
  * the GNU General Public License.
@@ -442,8 +442,14 @@
 			/* Copy account code et-al */	
 			strncpy(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode) - 1);
 			/* Destination information */
-			strncpy(cdr->dst, c->exten, sizeof(cdr->dst) - 1);
-			strncpy(cdr->dcontext, c->context, sizeof(cdr->dcontext) - 1);
+			if (ast_strlen_zero(c->macroexten))
+				strncpy(cdr->dst, c->exten, sizeof(cdr->dst) - 1);
+			else
+				strncpy(cdr->dst, c->macroexten, sizeof(cdr->dst) - 1);
+			if (ast_strlen_zero(c->macrocontext))
+				strncpy(cdr->dcontext, c->context, sizeof(cdr->dcontext) - 1);
+			else
+				strncpy(cdr->dcontext, c->macrocontext, sizeof(cdr->dcontext) - 1);
 		}
 		cdr = cdr->next;
 	}




More information about the svn-commits mailing list