Add any missing locking calls

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-08-13 17:32:44 +00:00
parent e35371be2b
commit d91f72fd5f
4 changed files with 45 additions and 14 deletions

View File

@@ -704,8 +704,10 @@ int ast_answer(struct ast_channel *chan)
switch(chan->_state) {
case AST_STATE_RINGING:
case AST_STATE_RING:
ast_mutex_lock(&chan->lock);
if (chan->pvt->answer)
res = chan->pvt->answer(chan);
ast_mutex_unlock(&chan->lock);
ast_setstate(chan, AST_STATE_UP);
if (chan->cdr)
ast_cdr_answer(chan->cdr);