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
(cherry picked from commit f6db5171b2)
releases/20
Peter Jannesen 7 months ago committed by Asterisk Development Team
parent 62df994e48
commit 8e81c0906e

@ -7306,6 +7306,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