diff --git a/main/channel.c b/main/channel.c index 74541ab72daa0665abc9dd0d280d04d83f3e45fb..c97268c5056d17ed48e61c243e7d0608d6a06564 100644 --- a/main/channel.c +++ b/main/channel.c @@ -7272,6 +7272,8 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha char caller_warning = 0; char callee_warning = 0; + *fo = NULL; + if (c0->_bridge) { ast_log(LOG_WARNING, "%s is already in a bridge with %s\n", c0->name, c0->_bridge->name); @@ -7297,9 +7299,6 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha return -1; } - - *fo = NULL; - if (ast_tvzero(config->start_time)) { config->start_time = ast_tvnow(); if (config->start_sound) { diff --git a/main/features.c b/main/features.c index 17dd2b7f7cd5cf5bca4859b3bc485bdc6af9f5ff..2fb34384ba80e5baeed8945ed6be4130d4ebec3f 100644 --- a/main/features.c +++ b/main/features.c @@ -3660,7 +3660,17 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast struct ast_channel *other; /* used later */ res = ast_channel_bridge(chan, peer, config, &f, &who); - + + if (ast_test_flag(chan, AST_FLAG_ZOMBIE) + || ast_test_flag(peer, AST_FLAG_ZOMBIE)) { + /* Zombies are present time to leave! */ + res = -1; + if (f) { + ast_frfree(f); + } + goto before_you_go; + } + /* When frame is not set, we are probably involved in a situation where we've timed out. When frame is set, we'll come this code twice; once for DTMF_BEGIN