[asterisk-commits] main/cdr: Copy context/exten on chained CDRs for parallel di... (asterisk[13])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Jun 14 11:03:21 CDT 2015
Matt Jordan has submitted this change and it was merged.
Change subject: main/cdr: Copy context/exten on chained CDRs for parallel dials in subroutines
......................................................................
main/cdr: Copy context/exten on chained CDRs for parallel dials in subroutines
When a parallel dial occurs, a new CDR will be created for each dial
attempt that is made. In most circumstances, the act of creating each
CDR in the chain will include a step that updates the Party A snapshot,
which causes the context/extension of the Party A to be copied onto the
CDR object.
However, when the Party A is in a subroutine, we explicitly do *not*
copy the context/extension onto the CDR. This prevents the Macro or
GoSub routine name from blowing away the context/extension that the
channel was originally executing in. For the original CDR, this is not a
problem: the original CDR already recorded the last known 'good' state
of the channel just prior to it going into the subroutine. However, for
newly generated CDRs in a chain, there is no context/extension set on
them. Since we are in a subroutine, we will never set the Party A's
context/extension on the CDR, and we end up with a CDR with no
destination recorded on it.
This patch updates the creation of a chained CDR such that it copies
over the original CDR's context/extension. This is the last known "good"
state of the CDR, and is a reasonable starting point for the newly
generated CDR. In the case where we are not in a subroutine, subsequent
code will update the location of the CDR from the Party A information;
in the case where we are in a subroutine, the context/extension on the
original CDR is the correct information.
ASTERISK-24443 #close
Change-Id: I6a3ef0d6e458d3b9b30572feaec70f2964f3bc2a
---
M main/cdr.c
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Matt Jordan: Looks good to me, approved; Verified
Joshua Colp: Looks good to me, but someone else must approve
diff --git a/main/cdr.c b/main/cdr.c
index 96d055c..f43d3cb 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -912,6 +912,8 @@
ast_string_field_set(new_cdr, linkedid, cdr_last->linkedid);
ast_string_field_set(new_cdr, appl, cdr_last->appl);
ast_string_field_set(new_cdr, data, cdr_last->data);
+ ast_string_field_set(new_cdr, context, cdr_last->context);
+ ast_string_field_set(new_cdr, exten, cdr_last->exten);
/* Copy over other Party A information */
cdr_object_snapshot_copy(&new_cdr->party_a, &cdr_last->party_a);
--
To view, visit https://gerrit.asterisk.org/652
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6a3ef0d6e458d3b9b30572feaec70f2964f3bc2a
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
More information about the asterisk-commits
mailing list