mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 19:43:03 +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:
@@ -3844,11 +3844,8 @@ static struct ast_channel *get_transferee(struct ao2_container *channels, struct
|
||||
static enum ast_transfer_result try_parking(struct ast_channel *transferer, const char *context, const char *exten)
|
||||
{
|
||||
RAII_VAR(struct ast_bridge_channel *, transferer_bridge_channel, NULL, ao2_cleanup);
|
||||
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()) {
|
||||
return AST_BRIDGE_TRANSFER_FAIL;
|
||||
}
|
||||
|
||||
@@ -3860,7 +3857,7 @@ static enum ast_transfer_result try_parking(struct ast_channel *transferer, cons
|
||||
return AST_BRIDGE_TRANSFER_FAIL;
|
||||
}
|
||||
|
||||
if (parking_provider->parking_blind_transfer_park(transferer_bridge_channel,
|
||||
if (ast_parking_blind_transfer_park(transferer_bridge_channel,
|
||||
context, exten)) {
|
||||
return AST_BRIDGE_TRANSFER_FAIL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user