channel: Preserve CHANNEL(userfield) on masquerade.

In certain circumstances a channel may undergo an operation
referred to as a masquerade. If this occurs the CHANNEL(userfield)
value was not preserved causing it to get lost. This change makes
it so that this field is now preserved.

Fixes: #882
pull/914/head
Peter Jannesen 7 months ago committed by asterisk-org-access-app[bot]
parent 127218249f
commit adfc1846ef

@ -7216,6 +7216,9 @@ static void channel_do_masquerade(struct ast_channel *original, struct ast_chann
/* copy over accuntcode and set peeraccount across the bridge */
ast_channel_accountcode_set(original, S_OR(ast_channel_accountcode(clonechan), ""));
/* copy over userfield */
ast_channel_userfield_set(original, ast_channel_userfield(clonechan));
ast_debug(1, "Putting channel %s in %s/%s formats\n", ast_channel_name(original),
ast_format_get_name(wformat), ast_format_get_name(rformat));

Loading…
Cancel
Save