From: Matthew Jordan Date: Mon, 3 Feb 2014 01:14:27 +0000 (+0000) Subject: cdrs: Check for applications to lock onto during dial begin handling X-Git-Tag: 12.1.0-rc1~3^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccfeee35131fe011b1ffaccd9a063cc1ae282c9d;p=thirdparty%2Fasterisk.git cdrs: Check for applications to lock onto during dial begin handling This patch brings CDR processing further in line with r407085. During some dial operations, the application would not be locked to the Dial application and would instead continue to show the previously known application. In particular, this would occur when a Parked call would time out. This was due to a previous snapshot already locking the application to Park - processing this in a Dial Begin allows the Dial application to reassert its rightful place. (CDRs. Ugh.) But hooray for the Parked Call tests for catching this in the Asterisk Test Suite. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@407166 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/cdr.c b/main/cdr.c index 2b67ba9693..c15da10d53 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -1351,13 +1351,13 @@ 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); - cdr_object_swap_snapshot(&cdr->party_a, snapshot); /* Ignore any snapshots from a dead or dying channel */ 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); return 0; } + cdr_object_swap_snapshot(&cdr->party_a, snapshot); /* When Party A is originated to an application and the application exits, the stack * will attempt to clear the application and restore the dummy originate application @@ -1447,7 +1447,7 @@ static int single_state_process_dial_begin(struct cdr_object *cdr, struct ast_ch RAII_VAR(struct module_config *, mod_cfg, ao2_global_obj_ref(module_configs), ao2_cleanup); if (caller && !strcasecmp(cdr->party_a.snapshot->name, caller->name)) { - cdr_object_swap_snapshot(&cdr->party_a, caller); + base_process_party_a(cdr, caller); CDR_DEBUG(mod_cfg, "%p - Updated Party A %s snapshot\n", cdr, cdr->party_a.snapshot->name); cdr_object_swap_snapshot(&cdr->party_b, peer); @@ -1461,7 +1461,7 @@ static int single_state_process_dial_begin(struct cdr_object *cdr, struct ast_ch ast_set_flag(&cdr->flags, AST_CDR_LOCK_APP); } else if (!strcasecmp(cdr->party_a.snapshot->name, peer->name)) { /* We're the entity being dialed, i.e., outbound origination */ - cdr_object_swap_snapshot(&cdr->party_a, peer); + base_process_party_a(cdr, peer); CDR_DEBUG(mod_cfg, "%p - Updated Party A %s snapshot\n", cdr, cdr->party_a.snapshot->name); }