[Asterisk-code-review] main/cdr: Set the end time on a CDR if endbeforehexten is Yes (asterisk[13])

Matt Jordan asteriskteam at digium.com
Mon Jan 4 09:02:36 CST 2016


Matt Jordan has submitted this change and it was merged.

Change subject: main/cdr: Set the end time on a CDR if endbeforehexten is Yes
......................................................................


main/cdr: Set the end time on a CDR if endbeforehexten is Yes

Prior to this patch, the CDR engine attempted to set the end time on a CDR
that was executing hangup logic and with endbeforehexten set to Yes by
calling a function that inspects the properties on the Party A snapshot to
determine if we are ready to set the end time. That always failed. This is
because a Party A snapshot is not updated for CDRs that are executing hangup
logic with endbeforehexten=Yes.

Instead of calling a function that looks at the Party A snapshot, we just
simply set the end time on the CDR. This is safe to call multiple times, and is
safe to call at this point as we know that (a) we are executing hangup logic,
and (b) we are supposed to set the end time at this point.

ASTERISK-25458

Change-Id: I0c27b493861f9c13c43addbbb21257f79047a3b3
---
M main/cdr.c
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/main/cdr.c b/main/cdr.c
index 07c0466..5abfc74 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -1356,10 +1356,10 @@
 
 	ast_assert(strcasecmp(snapshot->name, cdr->party_a.snapshot->name) == 0);
 
-	/* Ignore any snapshots from a dead or dying channel */
+	/* Finalize the CDR if we're in hangup logic and we're set to do so */
 	if (ast_test_flag(&snapshot->softhangup_flags, AST_SOFTHANGUP_HANGUP_EXEC)
-			&& ast_test_flag(&mod_cfg->general->settings, CDR_END_BEFORE_H_EXTEN)) {
-		cdr_object_check_party_a_hangup(cdr);
+		&& ast_test_flag(&mod_cfg->general->settings, CDR_END_BEFORE_H_EXTEN)) {
+		cdr_object_finalize(cdr);
 		return 0;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/1897
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c27b493861f9c13c43addbbb21257f79047a3b3
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list