mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
instead of hanging up channel after masquerade (risking deadlock), mark it as a zombie, then masquerade
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -632,9 +632,11 @@ static int check_availability(struct agent_pvt *newlyavailable, int needlock)
|
|||||||
if (p->abouttograb) {
|
if (p->abouttograb) {
|
||||||
ast_setstate(parent, AST_STATE_UP);
|
ast_setstate(parent, AST_STATE_UP);
|
||||||
ast_setstate(chan, AST_STATE_UP);
|
ast_setstate(chan, AST_STATE_UP);
|
||||||
|
/* Go ahead and mark the channel as a zombie so that masquerade will
|
||||||
|
destroy it for us, and we need not call ast_hangup */
|
||||||
|
chan->zombie = 1;
|
||||||
ast_channel_masquerade(parent, chan);
|
ast_channel_masquerade(parent, chan);
|
||||||
p->abouttograb = 0;
|
p->abouttograb = 0;
|
||||||
ast_hangup(chan);
|
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_DEBUG, "Sneaky, parent disappeared in the mean time...\n");
|
ast_log(LOG_DEBUG, "Sneaky, parent disappeared in the mean time...\n");
|
||||||
agent_cleanup(newlyavailable);
|
agent_cleanup(newlyavailable);
|
||||||
|
Reference in New Issue
Block a user