[asterisk-commits] mjordan: branch 12 r407166 - /branches/12/main/cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Feb 2 19:14:30 CST 2014


Author: mjordan
Date: Sun Feb  2 19:14:27 2014
New Revision: 407166

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407166
Log:
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.

Modified:
    branches/12/main/cdr.c

Modified: branches/12/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/cdr.c?view=diff&rev=407166&r1=407165&r2=407166
==============================================================================
--- branches/12/main/cdr.c (original)
+++ branches/12/main/cdr.c Sun Feb  2 19:14:27 2014
@@ -1351,13 +1351,13 @@
 
 	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 @@
 	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 @@
 		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);
 	}




More information about the asterisk-commits mailing list