summaryrefslogtreecommitdiff
path: root/channels/sig_analog.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-08-17 15:01:54 +0000
committerKinsey Moore <kmoore@digium.com>2013-08-17 15:01:54 +0000
commit56aea1c030a6ee322446b5c687da164246b0c0d5 (patch)
tree5c7729fcff1c8660d559f68a78f07d0fde579516 /channels/sig_analog.c
parentd7f1f3127084e4b7b204141c0b40c28c327f74b0 (diff)
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
Diffstat (limited to 'channels/sig_analog.c')
-rw-r--r--channels/sig_analog.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index 77df5cdc6..c7885403f 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -1715,11 +1715,7 @@ static void *__analog_ss_thread(void *data)
int idx;
struct ast_callid *callid;
RAII_VAR(struct ast_features_pickup_config *, pickup_cfg, NULL, ao2_cleanup);
- RAII_VAR(struct ast_parking_bridge_feature_fn_table *, parking_provider,
- ast_parking_get_bridge_features(),
- ao2_cleanup);
const char *pickupexten;
- int is_exten_parking;
analog_increase_ss_count();
@@ -2077,6 +2073,8 @@ static void *__analog_ss_thread(void *data)
timeout = 999999;
}
while (len < AST_MAX_EXTENSION-1) {
+ int is_exten_parking = 0;
+
/* Read digit unless it's supposed to be immediate, in which case the
only answer is 's' */
if (p->immediate) {
@@ -2100,7 +2098,9 @@ static void *__analog_ss_thread(void *data)
} else {
analog_play_tone(p, idx, ANALOG_TONE_DIALTONE);
}
- is_exten_parking = (parking_provider ? parking_provider->parking_is_exten_park(ast_channel_context(chan), exten) : 0);
+ if (ast_parking_provider_registered()) {
+ is_exten_parking = ast_parking_is_exten_park(ast_channel_context(chan), exten);
+ }
if (ast_exists_extension(chan, ast_channel_context(chan), exten, 1, p->cid_num) && !is_exten_parking) {
if (!res || !ast_matchmore_extension(chan, ast_channel_context(chan), exten, 1, p->cid_num)) {
if (getforward) {
@@ -2253,7 +2253,7 @@ static void *__analog_ss_thread(void *data)
ast_channel_lock(chan);
bridge_channel = ast_channel_get_bridge_channel(chan);
ast_channel_unlock(chan);
- if (bridge_channel && !parking_provider->parking_blind_transfer_park(bridge_channel, ast_channel_context(chan), exten)) {
+ if (bridge_channel && !ast_parking_blind_transfer_park(bridge_channel, ast_channel_context(chan), exten)) {
ast_verb(3, "Parking call to '%s'\n", ast_channel_name(chan));
}
ao2_ref(bridge_channel, -1);