summaryrefslogtreecommitdiff
path: root/main/cdr.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-06-12 14:28:47 -0500
committerMatt Jordan <mjordan@digium.com>2015-06-13 08:42:50 -0500
commit78ea356e78a4dc7c88b2212d1c4bf700bc5c5701 (patch)
tree33b03376e90c7c9557d29a5b0034133881e20dae /main/cdr.c
parent0b8b95292154508a37312adcc196f7309278a8d8 (diff)
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
Diffstat (limited to 'main/cdr.c')
-rw-r--r--main/cdr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/cdr.c b/main/cdr.c
index 96d055ca0..f43d3cba8 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -912,6 +912,8 @@ static struct cdr_object *cdr_object_create_and_append(struct cdr_object *cdr)
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);