Lock iax2 pvt structure when passing off to the AMI function, and make sure it exists. (issue #9674 reported by arabe)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2007-05-06 20:09:18 +00:00
parent 3f8548bf3b
commit 28f4727e75

View File

@@ -3343,7 +3343,10 @@ static int iax2_answer(struct ast_channel *c)
unsigned short callno = PTR_TO_CALLNO(c->tech_pvt);
if (option_debug)
ast_log(LOG_DEBUG, "Answering IAX2 call\n");
iax2_ami_channelupdate(c->tech_pvt);
ast_mutex_lock(&iaxsl[callno]);
if (iaxs[callno])
iax2_ami_channelupdate(iaxs[callno]);
ast_mutex_unlock(&iaxsl[callno]);
return send_command_locked(callno, AST_FRAME_CONTROL, AST_CONTROL_ANSWER, 0, NULL, 0, -1);
}