Disable device state caching for ephemeral channels

chan_audiosocket/chan_rtp/res_stasis_snoop: Disable device state caching for ephemeral channels

Resolves: #1638
This commit is contained in:
phoneben
2025-12-09 23:15:21 +02:00
parent 861b344295
commit fbe735d613
4 changed files with 10 additions and 0 deletions

View 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);

View 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));

View 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);

View 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);