Index: channel.c =================================================================== RCS file: /usr/cvsroot/asterisk/channel.c,v retrieving revision 1.259 diff -u -r1.259 channel.c --- channel.c 11 Nov 2005 03:48:28 -0000 1.259 +++ channel.c 16 Nov 2005 19:07:41 -0000 @@ -667,7 +667,11 @@ int ast_queue_hangup(struct ast_channel *chan) { struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP }; - chan->_softhangup |= AST_SOFTHANGUP_DEV; + /* Yeah, let's not change a lock-critical value without locking */ + if (!ast_mutex_trylock(&chan->lock)) { + chan->_softhangup |= AST_SOFTHANGUP_DEV; + ast_mutex_unlock(&chan->lock); + } return ast_queue_frame(chan, &f); }