Merge "main/cdr: Allow setting properties on a finalized CDR if it is the last one"
authorMatt Jordan <mjordan@digium.com>
Mon, 4 Jan 2016 15:02:53 +0000 (09:02 -0600)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Mon, 4 Jan 2016 15:02:54 +0000 (09:02 -0600)
1  2 
main/cdr.c

diff --combined main/cdr.c
@@@ -1359,10 -1359,10 +1359,10 @@@ static int base_process_party_a(struct 
  
        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;
        }
  
@@@ -2976,7 -2976,7 +2976,7 @@@ int ast_cdr_setvar(const char *channel_
                for (it_cdr = cdr; it_cdr; it_cdr = it_cdr->next) {
                        struct varshead *headp = NULL;
  
-                       if (it_cdr->fn_table == &finalized_state_fn_table) {
+                       if (it_cdr->fn_table == &finalized_state_fn_table && it_cdr->next != NULL) {
                                continue;
                        }
                        if (!strcasecmp(channel_name, it_cdr->party_a.snapshot->name)) {