diff options
author | Richard Mudgett <rmudgett@digium.com> | 2014-10-03 19:42:54 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2014-10-03 19:42:54 +0000 |
commit | 70301b04387cb54d01732f984b671ad7de8090aa (patch) | |
tree | c5c2c2777b876e4f1a292233888952f7323dcffc /apps/app_chanspy.c | |
parent | cc11a78869eb2f0b5f75330c426b62cbfecb88fd (diff) |
audiohooks: Reevaluate the bridge technology when an audiohook is added or removed.
Adding a mixmonitor to a channel causes the bridge to change technologies
from native to simple_bridge so the call can be recorded. However, when
the mixmonitor is stopped the bridge does not switch back to the native
technology.
* Added unbridge requests to reevaluate the bridge when a channel
audiohook is removed.
* Moved the unbridge request into ast_audiohook_attach() ensure that the
bridge reevaluates whenever an audiohook is attached. This simplified the
mixmonitor and chan_spy start code as well.
* Added defensive code to stop_mixmonitor_full() in case additional
arguments are ever added to the StopMixMonitor application.
* Made ast_framehook_detach() not do an unbridge request if the framehook
does not exist.
* Made ast_framehook_list_fixup() do an unbridge request if there are any
framehooks. Also simplified the loop.
ASTERISK-24195 #close
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/4046/
........
Merged revisions 424506 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 424507 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r-- | apps/app_chanspy.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 9f530c50d..3777c48e9 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -498,21 +498,10 @@ static struct ast_generator spygen = { static int start_spying(struct ast_autochan *autochan, const char *spychan_name, struct ast_audiohook *audiohook) { - int res = 0; - ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan_name, ast_channel_name(autochan->chan)); ast_set_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC | AST_AUDIOHOOK_SMALL_QUEUE); - res = ast_audiohook_attach(autochan->chan, audiohook); - - if (!res) { - ast_channel_lock(autochan->chan); - if (ast_channel_is_bridged(autochan->chan)) { - ast_channel_set_unbridged_nolock(autochan->chan, 1); - } - ast_channel_unlock(autochan->chan); - } - return res; + return ast_audiohook_attach(autochan->chan, audiohook); } static void change_spy_mode(const char digit, struct ast_flags *flags) |