diff --git a/main/pbx.c b/main/pbx.c index b797000bdb..9c9ed10bcd 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -2943,11 +2943,17 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con, ast_log(LOG_WARNING, "No application '%s' for extension (%s, %s, %d)\n", e->app, context, exten, priority); return -1; } + ast_channel_lock(c); + if (ast_channel_softhangup_internal_flag(c) & AST_SOFTHANGUP_ASYNCGOTO) { + ast_channel_unlock(c); + return 0; + } if (ast_channel_context(c) != context) ast_channel_context_set(c, context); if (ast_channel_exten(c) != exten) ast_channel_exten_set(c, exten); ast_channel_priority_set(c, priority); + ast_channel_unlock(c); if (substitute) { pbx_substitute_variables_helper(c, substitute, passdata, sizeof(passdata)-1); }