diff -r -u asterisk-1.4.18/channels/chan_sip.c asterisk-1.4.18-mod/channels/chan_sip.c --- asterisk-1.4.18/channels/chan_sip.c 2008-01-31 14:52:49.000000000 -0500 +++ asterisk-1.4.18-mod/channels/chan_sip.c 2008-03-06 13:30:06.000000000 -0500 @@ -15375,6 +15375,9 @@ append_history(p, "Rx", "%s / %s / %s", req.data, get_header(&req, "CSeq"), req.rlPart2); if (!lockretry) { + p = find_call(&req, &sin, req.method); /* returns p locked */ + if (p == NULL) return 1; /* We couldn't lock since it was removed. */ + if (p->owner) ast_log(LOG_ERROR, "We could NOT get the channel lock for %s! \n", S_OR(p->owner->name, "- no channel name ??? - ")); ast_log(LOG_ERROR, "SIP transaction failed: %s \n", p->callid); @@ -15382,6 +15385,7 @@ transmit_response(p, "503 Server error", &req); /* We must respond according to RFC 3261 sec 12.2 */ /* XXX We could add retry-after to make sure they come back */ append_history(p, "LockFail", "Owner lock failed, transaction failed."); + ast_mutex_unlock(&p->lock); return 1; } nounlock = 0;