[asterisk-commits] jrose: branch 1.8 r362082 - /branches/1.8/apps/app_forkcdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 13 10:54:05 CDT 2012


Author: jrose
Date: Fri Apr 13 10:54:01 2012
New Revision: 362082

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=362082
Log:
Make ForkCDR e option not set end time of the newly forked CDR log

Prior to this patch, ForkCDR's e option would immediately set the end time of the forked
CDR to that of the CDR that is being terminated. This resulted in the new CDR's end time
being roughly the same as it's beginning time (which is in turn roughly the same as the
original's end time).

(closes issue ASTERISK-19164)
Reported by: Steve Davies
Patches:
	cdr_fork_end.v10.patch uploaded by Steve Davies (license 5012)


Modified:
    branches/1.8/apps/app_forkcdr.c

Modified: branches/1.8/apps/app_forkcdr.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_forkcdr.c?view=diff&rev=362082&r1=362081&r2=362082
==============================================================================
--- branches/1.8/apps/app_forkcdr.c (original)
+++ branches/1.8/apps/app_forkcdr.c Fri Apr 13 10:54:01 2012
@@ -191,6 +191,14 @@
 	if (!(newcdr = ast_cdr_dup_unique(cdr)))
 		return;
 	
+	/*
+	 * End the original CDR if requested BEFORE appending the new CDR
+	 * otherwise we incorrectly end the new CDR also.
+	 */
+	if (ast_test_flag(&optflags, OPT_ENDCDR)) {
+		ast_cdr_end(cdr);
+	}
+
 	ast_cdr_append(cdr, newcdr);
 
 	if (!ast_test_flag(&optflags, OPT_NORESET))
@@ -218,9 +226,6 @@
 	if (ast_test_flag(&optflags, OPT_RESETDEST))
 		newcdr->dstchannel[0] = 0;
 	
-	if (ast_test_flag(&optflags, OPT_ENDCDR))
-		ast_cdr_end(cdr);
-
 	if (ast_test_flag(&optflags, OPT_ANSLOCK))
 		ast_set_flag(cdr, AST_CDR_FLAG_ANSLOCKED);
 	




More information about the asterisk-commits mailing list