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
f3e74d34ce2fdd7eb60fc21d759c7abc19639f21)
/* 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));