[asterisk-commits] mjordan: branch certified-1.8.11 r371650 - in /certified/branches/1.8.11: ./ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 24 08:49:46 CDT 2012


Author: mjordan
Date: Fri Aug 24 08:49:40 2012
New Revision: 371650

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=371650
Log:
Merge r369351 for AST-883

Modified:
    certified/branches/1.8.11/   (props changed)
    certified/branches/1.8.11/main/cdr.c

Propchange: certified/branches/1.8.11/
------------------------------------------------------------------------------
--- branch-1.8-merged (original)
+++ branch-1.8-merged Fri Aug 24 08:49:40 2012
@@ -1,1 +1,1 @@
-/branches/1.8:1-357100,357665,358162,359656-359808,359810-359891,359893-359979,360086,360884,363102-363141,368894,370769
+/branches/1.8:1-357100,357665,358162,359656-359808,359810-359891,359893-359979,360086,360884,363102-363141,368894,369351,370769

Modified: certified/branches/1.8.11/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/1.8.11/main/cdr.c?view=diff&rev=371650&r1=371649&r2=371650
==============================================================================
--- certified/branches/1.8.11/main/cdr.c (original)
+++ certified/branches/1.8.11/main/cdr.c Fri Aug 24 08:49:40 2012
@@ -289,9 +289,9 @@
 		cdr_get_tv(cdr->answer, raw ? NULL : fmt, workspace, workspacelen);
 	else if (!strcasecmp(name, "end"))
 		cdr_get_tv(cdr->end, raw ? NULL : fmt, workspace, workspacelen);
-	else if (!strcasecmp(name, "duration"))
-		snprintf(workspace, workspacelen, "%ld", cdr->duration ? cdr->duration : (long)ast_tvdiff_ms(ast_tvnow(), cdr->start) / 1000);
-	else if (!strcasecmp(name, "billsec"))
+	else if (!strcasecmp(name, "duration")) {
+		snprintf(workspace, workspacelen, "%ld", cdr->duration || !ast_tvzero(cdr->end) ? cdr->duration : (long)ast_tvdiff_ms(ast_tvnow(), cdr->start) / 1000);
+	} else if (!strcasecmp(name, "billsec"))
 		snprintf(workspace, workspacelen, "%ld", cdr->billsec || cdr->answer.tv_sec == 0 ? cdr->billsec : (long)ast_tvdiff_ms(ast_tvnow(), cdr->answer) / 1000);
 	else if (!strcasecmp(name, "disposition")) {
 		if (raw) {




More information about the asterisk-commits mailing list