Index: chan_sip.c =================================================================== --- chan_sip.c (revision 25382) +++ chan_sip.c (arbetskopia) @@ -1215,7 +1215,7 @@ unsigned int profile = 0; int i, found; - if (!pvt || ast_strlen_zero(supported) ) + if (ast_strlen_zero(supported)) return 0; if (option_debug > 2 && sipdebug) @@ -1241,7 +1241,8 @@ ast_log(LOG_DEBUG, "Found no match for SIP option: %s (Please file bug report!)\n", next); } - pvt->sipoptions = profile; + if (pvt) + pvt->sipoptions = profile; return profile; } @@ -5237,7 +5238,7 @@ other end knows and replace the current call with this new call */ if (p->options && p->options->replaces && !ast_strlen_zero(p->options->replaces)) { add_header(&req, "Replaces", p->options->replaces); - add_header(&req, "Required", "replaces"); + add_header(&req, "Require", "replaces"); } if (p->options && !ast_strlen_zero(p->options->distinctive_ring)) { @@ -10982,7 +10983,7 @@ } /* Find out what they require */ - required = get_header(req, "Required"); + required = get_header(req, "Require"); if (!ast_strlen_zero(required)) { required_profile = parse_sip_options(NULL, required); if (required_profile) { /* They require something */ @@ -11801,6 +11802,11 @@ RFC 3261 - section 12.2 - and we don't want to mess with recovery */ if (!p->initreq.headers && ast_test_flag(req, SIP_PKT_WITH_TOTAG)) { /* If this is a first request and it got a to-tag, it is not for us */ + if (req->method == SIP_ACK) { + ast_log(LOG_DEBUG, "Ignoring ACK\n"); + return res; + } + if (!ast_test_flag(req, SIP_PKT_IGNORE) && req->method == SIP_INVITE) { transmit_response_reliable(p, "481 Call/Transaction Does Not Exist", req); /* Will cease to exist after ACK */