summaryrefslogtreecommitdiff
path: root/main/cdr.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2016-01-02 10:23:39 -0600
committerMatt Jordan <mjordan@digium.com>2016-01-02 10:35:15 -0600
commit1f23e65b89c939779c109689d6e99d79b01cd2bf (patch)
tree0cd4d2b440c2137914acb0da6f2ede7d543b50c2 /main/cdr.c
parent5a75caa9e6a271eb64773f7473b0d927a0f8de70 (diff)
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
Diffstat (limited to 'main/cdr.c')
-rw-r--r--main/cdr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/cdr.c b/main/cdr.c
index 07c0466fe..5abfc74b3 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -1356,10 +1356,10 @@ static int base_process_party_a(struct cdr_object *cdr, struct ast_channel_snaps
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;
}