Remove the unsafe bridge parameter from ast_bridge_hook_callback's.

Most hook callbacks did not need the bridge parameter.  The pointer value
could become invalid if the channel is moved to another bridge while it is
executing.

* Fixed some issues in feature_attended_transfer() as a result.

* Reduce the bridge inhibit count in
attended_transfer_properties_shutdown() after it has restored the bridge
channel hooks.

* Removed basic bridge requirement on feature_blind_transfer().  It does
not require the basic bridge like feature_attended_transfer().


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2013-07-26 21:34:23 +00:00
parent 50aba6be36
commit c017d5e6a3
14 changed files with 103 additions and 93 deletions

View File

@@ -214,7 +214,7 @@ static void start_automonitor(struct ast_bridge_channel *bridge_channel, struct
pbx_builtin_setvar_helper(peer_chan, "TOUCH_MONITOR_OUTPUT", touch_filename);
}
static int feature_automonitor(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, void *hook_pvt)
static int feature_automonitor(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
{
const char *start_message;
const char *stop_message;
@@ -226,7 +226,9 @@ static int feature_automonitor(struct ast_bridge *bridge, struct ast_bridge_chan
RAII_VAR(struct ast_features_general_config *, features_cfg, NULL, ao2_cleanup);
features_cfg = ast_get_chan_features_general_config(bridge_channel->chan);
peer_chan = ast_bridge_peer(bridge, bridge_channel->chan);
ast_bridge_channel_lock_bridge(bridge_channel);
peer_chan = ast_bridge_peer_nolock(bridge_channel->bridge, bridge_channel->chan);
ast_bridge_unlock(bridge_channel->bridge);
if (!peer_chan) {
ast_verb(3, "Cannot start AutoMonitor for %s - can not determine peer in bridge.\n",
@@ -397,7 +399,7 @@ static void start_automixmonitor(struct ast_bridge_channel *bridge_channel, stru
pbx_builtin_setvar_helper(peer_chan, "TOUCH_MIXMONITOR_OUTPUT", touch_filename);
}
static int feature_automixmonitor(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, void *hook_pvt)
static int feature_automixmonitor(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
{
static const char *mixmonitor_spy_type = "MixMonitor";
const char *stop_message;
@@ -410,7 +412,9 @@ static int feature_automixmonitor(struct ast_bridge *bridge, struct ast_bridge_c
RAII_VAR(struct ast_features_general_config *, features_cfg, NULL, ao2_cleanup);
features_cfg = ast_get_chan_features_general_config(bridge_channel->chan);
peer_chan = ast_bridge_peer(bridge, bridge_channel->chan);
ast_bridge_channel_lock_bridge(bridge_channel);
peer_chan = ast_bridge_peer_nolock(bridge_channel->bridge, bridge_channel->chan);
ast_bridge_unlock(bridge_channel->bridge);
if (!peer_chan) {
ast_verb(3, "Cannot do AutoMixMonitor for %s - cannot determine peer in bridge.\n",
@@ -476,7 +480,7 @@ static int feature_automixmonitor(struct ast_bridge *bridge, struct ast_bridge_c
}
/*! \brief Internal built in feature for hangup */
static int feature_hangup(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, void *hook_pvt)
static int feature_hangup(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
{
/*
* This is very simple, we simply change the state on the