aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_parking.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_parking.c')
-rwxr-xr-xres/res_parking.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/res/res_parking.c b/res/res_parking.c
index 0d0a714c9..5c8049822 100755
--- a/res/res_parking.c
+++ b/res/res_parking.c
@@ -234,6 +234,18 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, int allo
return -1;
peer->appl = "Bridged Call";
peer->data = chan->name;
+ /* copy the userfield from the B-leg to A-leg if applicable */
+ if (chan->cdr && peer->cdr && strlen(peer->cdr->userfield)) {
+ char tmp[256];
+ if (strlen(chan->cdr->userfield)) {
+ snprintf(tmp, sizeof(tmp), "%s;%s",chan->cdr->userfield, peer->cdr->userfield);
+ ast_cdr_appenduserfield(chan, tmp);
+ } else
+ ast_cdr_setuserfield(chan, peer->cdr->userfield);
+ /* free the peer's cdr without ast_cdr_free complaining */
+ free(peer->cdr);
+ peer->cdr = NULL;
+ }
for (;;) {
res = ast_channel_bridge(chan, peer, (allowdisconnect||allowredirect_out ? AST_BRIDGE_DTMF_CHANNEL_0 : 0) + (allowredirect_in ? AST_BRIDGE_DTMF_CHANNEL_1 : 0), &f, &who);
if (res < 0) {