Be sure to hold lock during answer

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-06-23 17:41:51 +00:00
parent 6729301b4d
commit 68248b91f0
2 changed files with 7 additions and 4 deletions

View File

@@ -1597,7 +1597,7 @@ static int sip_answer(struct ast_channel *ast)
char *codec;
struct sip_pvt *p = ast->pvt->pvt;
ast_mutex_lock(&p->lock);
if (ast->_state != AST_STATE_UP) {
@@ -1616,6 +1616,7 @@ static int sip_answer(struct ast_channel *ast)
ast_log(LOG_DEBUG, "sip_answer(%s)\n", ast->name);
res = transmit_response_with_sdp(p, "200 OK", &p->initreq, 1);
}
ast_mutex_unlock(&p->lock);
return res;
}