]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Disable device state caching for ephemeral channels master
authorphoneben <3232963@gmail.com>
Tue, 9 Dec 2025 21:15:21 +0000 (23:15 +0200)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 16 Dec 2025 14:56:09 +0000 (14:56 +0000)
chan_audiosocket/chan_rtp/res_stasis_snoop: Disable device state caching for ephemeral channels

Resolves: #1638

channels/chan_audiosocket.c
channels/chan_rtp.c
channels/chan_websocket.c
res/res_stasis_snoop.c

index e69cc7733221b6b443b901e75e9b945aa6beb7ec..caf508f41825c74de78064c98c4db06e35d62bdb 100644 (file)
@@ -275,6 +275,8 @@ static struct ast_channel *audiosocket_request(const char *type,
                goto failure;
        }
        ast_channel_set_fd(chan, 0, fd);
+       /* Prevent device state caching as this channel involves ephemeral destinations or sources */
+       ast_set_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_DEVSTATE_CACHE);
 
        ast_channel_tech_set(chan, &audiosocket_channel_tech);
 
index 97fc2408c3ea37a6ccfd0f1cef9c41a3e651993a..01b57d7aadbeaa72776e8e8004941ea1c85e32c8 100644 (file)
@@ -217,6 +217,8 @@ static struct ast_channel *multicast_rtp_request(const char *type, struct ast_fo
                ast_rtp_instance_destroy(instance);
                goto failure;
        }
+       /* Prevent device state caching as this channel involves ephemeral destinations or sources */
+       ast_set_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_DEVSTATE_CACHE);
        ast_rtp_instance_set_channel_id(instance, ast_channel_uniqueid(chan));
        ast_rtp_instance_set_remote_address(instance, &destination_address);
 
@@ -374,6 +376,8 @@ static struct ast_channel *unicast_rtp_request(const char *type, struct ast_form
                ast_rtp_instance_destroy(instance);
                goto failure;
        }
+       /*Prevent device state caching as this channel involves ephemeral destinations or sources */
+       ast_set_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_DEVSTATE_CACHE);
        ast_rtp_instance_set_channel_id(instance, ast_channel_uniqueid(chan));
        ast_rtp_instance_set_remote_address(instance, &address);
        ast_channel_set_fd(chan, 0, ast_rtp_instance_fd(instance, 0));
index 4d86b86e533c9af36888f94b1d83ea0093805597..df7373c52a3a1356b37d41c1042d13668227daf3 100644 (file)
@@ -1710,6 +1710,8 @@ static struct ast_channel *webchan_request(const char *type,
                goto failure;
        }
 
+       /* Prevent device state caching as this channel involves ephemeral destinations or sources */
+       ast_set_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_DEVSTATE_CACHE);
        ast_debug(3, "%s: WebSocket channel %s allocated for connection %s\n",
                ast_channel_name(chan), requestor_name,
                instance->connection_id);
index 12964cca008f9201c96d5f26f429bf54dc3c5c24..3ecf6a954232126ed28db9ba7e5f6554bc1f13d2 100644 (file)
@@ -351,6 +351,8 @@ struct ast_channel *stasis_app_control_snoop(struct ast_channel *chan,
 
        /* To keep the channel valid on the Snoop structure until it is destroyed we bump the ref up here */
        ast_channel_ref(snoop->chan);
+       /* Prevent device state caching as this channel involves ephemeral destinations or sources */
+       ast_set_flag(ast_channel_flags(snoop->chan), AST_FLAG_DISABLE_DEVSTATE_CACHE);
 
        ast_channel_tech_set(snoop->chan, &snoop_tech);
        ao2_ref(snoop, +1);