diff options
author | Mark Michelson <mmichelson@digium.com> | 2013-08-02 14:05:07 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2013-08-02 14:05:07 +0000 |
commit | f8622e7c5cbdda91a5efad230a9e3af593378c7c (patch) | |
tree | ac2c4b5f2256fb55c84fb8915d82298d23c0e188 /apps | |
parent | 57a8148ccd704f02f33c65d902b199f4205e5480 (diff) |
Get rid of ast_bridged_channel() and the bridged_channel field on ast_channels.
This commit is smaller than the initial review placed on review board. This is because
a change to allow for channel drivers to access parking functionality externally was
committed and invalidated quite a few of the changes initially made.
(closes issue ASTERISK-22039)
reported by Matt Jordan
Review: https://reviewboard.asterisk.org/r/2717
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_chanspy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 4e241b96f..0f40e3193 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -637,12 +637,14 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto } if (ast_test_flag(flags, OPTION_BARGE | OPTION_DTMF_SWITCH_MODES)) { + RAII_VAR(struct ast_channel *, bridged, ast_channel_bridge_peer(spyee_autochan->chan), ast_channel_cleanup); + /* And this hook lets us inject audio into the channel that the spied on channel is currently bridged with. */ ast_audiohook_init(&csth.bridge_whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "Chanspy", 0); - if ((spyee_bridge_autochan = ast_autochan_setup(ast_bridged_channel(spyee_autochan->chan)))) { + if ((spyee_bridge_autochan = ast_autochan_setup(bridged))) { ast_channel_lock(spyee_bridge_autochan->chan); if (start_spying(spyee_bridge_autochan, spyer_name, &csth.bridge_whisper_audiohook)) { ast_log(LOG_WARNING, "Unable to attach barge audiohook on spyee %s. Barge mode disabled!\n", name); @@ -935,7 +937,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, break; } - if (ast_test_flag(flags, OPTION_BRIDGED) && !ast_bridged_channel(autochan->chan)) { + if (ast_test_flag(flags, OPTION_BRIDGED) && !ast_channel_is_bridged(autochan->chan)) { continue; } |