]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
channel: Preserve CHANNEL(userfield) on masquerade.
authorPeter Jannesen <peter@jannesen.com>
Fri, 20 Sep 2024 20:13:08 +0000 (22:13 +0200)
committerPeter Jannesen <peter@jannesen.com>
Wed, 25 Sep 2024 17:03:28 +0000 (17:03 +0000)
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
main/channel.c

index 2b9f192612a8e529f6c7b41ac455b4574dd08e82..95d02e4ae39e7e0b311c98ce5d6062155f761ab4 100644 (file)
@@ -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));