mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-23 21:19:09 +00:00
Fix a crash when attempting to spy on an unbridged channel.
(closes issue #12986) Reported by: andrew53 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -359,18 +359,21 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_channel_lock(chan);
|
|
||||||
ast_set_flag(chan, AST_FLAG_END_DTMF_ONLY);
|
|
||||||
ast_channel_unlock(chan);
|
|
||||||
|
|
||||||
ast_audiohook_init(&csth.whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "ChanSpy");
|
ast_audiohook_init(&csth.whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "ChanSpy");
|
||||||
ast_audiohook_init(&csth.bridge_whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "Chanspy");
|
ast_audiohook_init(&csth.bridge_whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "Chanspy");
|
||||||
start_spying(spyee, spyer_name, &csth.whisper_audiohook); /* Unlocks spyee */
|
start_spying(spyee, spyer_name, &csth.whisper_audiohook); /* Unlocks spyee */
|
||||||
start_spying(ast_bridged_channel(spyee), spyer_name, &csth.bridge_whisper_audiohook);
|
if ((spyee_bridge = ast_bridged_channel(spyee))) {
|
||||||
|
ast_channel_lock(spyee_bridge);
|
||||||
|
start_spying(ast_bridged_channel(spyee), spyer_name, &csth.bridge_whisper_audiohook);
|
||||||
|
ast_channel_unlock(spyee_bridge);
|
||||||
|
}
|
||||||
ast_channel_unlock(spyee);
|
ast_channel_unlock(spyee);
|
||||||
spyee = NULL;
|
spyee = NULL;
|
||||||
|
|
||||||
|
ast_channel_lock(chan);
|
||||||
|
ast_set_flag(chan, AST_FLAG_END_DTMF_ONLY);
|
||||||
|
ast_channel_unlock(chan);
|
||||||
|
|
||||||
csth.volfactor = *volfactor;
|
csth.volfactor = *volfactor;
|
||||||
|
|
||||||
if (csth.volfactor) {
|
if (csth.volfactor) {
|
||||||
|
|||||||
Reference in New Issue
Block a user