mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 11:58:40 +00:00
Merge in the bridge_construction branch to make the system use the Bridging API.
Breaks many things until they can be reworked. A partial list: chan_agent chan_dahdi, chan_misdn, chan_iax2 native bridging app_queue COLP updates DTMF attended transfers Protocol attended transfers git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -482,15 +482,18 @@ static struct ast_generator spygen = {
|
||||
static int start_spying(struct ast_autochan *autochan, const char *spychan_name, struct ast_audiohook *audiohook)
|
||||
{
|
||||
int res = 0;
|
||||
struct ast_channel *peer = NULL;
|
||||
|
||||
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_test_flag(ast_channel_flags(autochan->chan), AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(autochan->chan))) {
|
||||
ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);
|
||||
if (!res) {
|
||||
ast_channel_lock(autochan->chan);
|
||||
if (ast_channel_is_bridged(autochan->chan)) {
|
||||
ast_softhangup_nolock(autochan->chan, AST_SOFTHANGUP_UNBRIDGE);
|
||||
}
|
||||
ast_channel_unlock(autochan->chan);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user