mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 00:30:20 +00:00
Allow res_parking to be unloadable
This change protects accesses of res_parking such that it can unload safely once transient uses of its registered functions are complete. The parking API has been restructured such that its consumers do not have access to the vtable exposed by the parking provider, but instead route through stubs to prevent consumers from holding on to function pointers. This adds calls to all the parking unload functions and moves application loading and unloading into functions in parking_applications.c similar to the rest of the parts of res_parking. Review: https://reviewboard.asterisk.org/r/2763/ (closes issue ASTERISK-22142) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -754,17 +754,13 @@ struct bridge_park {
|
||||
*/
|
||||
static void bridge_channel_park(struct ast_bridge_channel *bridge_channel, struct bridge_park *payload)
|
||||
{
|
||||
RAII_VAR(struct ast_parking_bridge_feature_fn_table *, parking_provider,
|
||||
ast_parking_get_bridge_features(),
|
||||
ao2_cleanup);
|
||||
|
||||
if (!parking_provider) {
|
||||
if (!ast_parking_provider_registered()) {
|
||||
ast_log(AST_LOG_WARNING, "Unable to park %s: No parking provider loaded!\n",
|
||||
ast_channel_name(bridge_channel->chan));
|
||||
return;
|
||||
}
|
||||
|
||||
if (parking_provider->parking_park_bridge_channel(bridge_channel, payload->parkee_uuid,
|
||||
if (ast_parking_park_bridge_channel(bridge_channel, payload->parkee_uuid,
|
||||
&payload->parkee_uuid[payload->parker_uuid_offset],
|
||||
payload->app_data_offset ? &payload->parkee_uuid[payload->app_data_offset] : NULL)) {
|
||||
ast_log(AST_LOG_WARNING, "Error occurred while parking %s\n",
|
||||
|
||||
Reference in New Issue
Block a user