Improved feature limits interval hook implementaion.

* Fixed feature limits to not use special members of struct
ast_bridge_features.

* Fixed memory leak in off nominal paths of bridge_builtin_set_limits().

* Fixed off nominal path in ast_bridge_features_limits_construct() freeing
unallocated memory if it was not called by bridge_builtin_set_limits().

* Made bridge_builtin_interval_features.so unloadable.

* Simplified parking's use of its duration interval hook.

* Made BridgeWait S option not depend upon another module being loaded.

(closes issue ASTERISK-22107)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/2701/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2013-07-26 21:10:24 +00:00
parent b6f9b39830
commit 50aba6be36
5 changed files with 70 additions and 88 deletions

View File

@@ -363,12 +363,6 @@ static int feature_park(struct ast_bridge *bridge, struct ast_bridge_channel *br
return 0;
}
static void parking_duration_cb_destroyer(void *hook_pvt)
{
struct parked_user *user = hook_pvt;
ao2_ref(user, -1);
}
/*! \internal
* \brief Interval hook. Pulls a parked call from the parking bridge after the timeout is passed and sets the resolution to timeout.
*
@@ -523,7 +517,7 @@ void parking_set_duration(struct ast_bridge_features *features, struct parked_us
ao2_ref(user, +1);
if (ast_bridge_interval_hook(features, time_limit,
parking_duration_callback, user, parking_duration_cb_destroyer, AST_BRIDGE_HOOK_REMOVE_ON_PULL)) {
parking_duration_callback, user, __ao2_cleanup, AST_BRIDGE_HOOK_REMOVE_ON_PULL)) {
ast_log(LOG_ERROR, "Failed to apply duration limits to the parking call.\n");
ao2_ref(user, -1);
}