--- channels/chan_sip.c.2010-12-16 2010-12-16 11:30:27.000000000 -0700 +++ channels/chan_sip.c 2010-12-16 15:07:29.000000000 -0700 @@ -27627,10 +27627,12 @@ if (!ast_bridged_channel(chan) && !sip_cfg.directrtpsetup) /* We are in early state */ return 0; + ast_channel_lock(chan); sip_pvt_lock(p); if (p->alreadygone) { /* If we're destroyed, don't bother */ sip_pvt_unlock(p); + ast_channel_unlock(chan); return 0; } @@ -27639,6 +27641,7 @@ */ if (nat_active && !ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA_NAT)) { sip_pvt_unlock(p); + ast_channel_unlock(chan); return 0; } @@ -27681,6 +27684,7 @@ /* Reset lastrtprx timer */ p->lastrtprx = p->lastrtptx = time(NULL); sip_pvt_unlock(p); + ast_channel_unlock(chan); return 0; }