--- pbx.c.cvs 2004-02-18 17:20:51.000000000 -0500 +++ pbx.c.merged 2004-02-18 17:24:25.000000000 -0500 @@ -3535,11 +3535,12 @@ tmpchan->priority = priority; else tmpchan->priority = chan->priority; - if (needlock) - ast_mutex_unlock(&chan->lock); /* Masquerade into temp channel */ ast_channel_masquerade(tmpchan, chan); + + if (needlock) + ast_mutex_unlock(&chan->lock); /* Make the masquerade happen by reading a frame from the tmp channel */ f = ast_read(tmpchan);