mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
When doing an async goto, detect if the channel is already in the middle of a
masquerade. This can happen when chan_local is trying to optimize itself out. If this happens, fail the async goto instead of bursting into flames. (closes issue #13435) Reported by: geoff2010 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
10
main/pbx.c
10
main/pbx.c
@@ -4609,8 +4609,13 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex
|
|||||||
S_OR(context, chan->context), S_OR(exten, chan->exten), priority);
|
S_OR(context, chan->context), S_OR(exten, chan->exten), priority);
|
||||||
|
|
||||||
/* Masquerade into temp channel */
|
/* Masquerade into temp channel */
|
||||||
ast_channel_masquerade(tmpchan, chan);
|
if (ast_channel_masquerade(tmpchan, chan)) {
|
||||||
|
/* Failed to set up the masquerade. It's probably chan_local
|
||||||
|
* in the middle of optimizing itself out. Sad. :( */
|
||||||
|
ast_hangup(tmpchan);
|
||||||
|
tmpchan = NULL;
|
||||||
|
res = -1;
|
||||||
|
} else {
|
||||||
/* Grab the locks and get going */
|
/* Grab the locks and get going */
|
||||||
ast_channel_lock(tmpchan);
|
ast_channel_lock(tmpchan);
|
||||||
ast_do_masquerade(tmpchan);
|
ast_do_masquerade(tmpchan);
|
||||||
@@ -4623,6 +4628,7 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ast_channel_unlock(chan);
|
ast_channel_unlock(chan);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user