if (option_debug > 3)
ast_log(LOG_DEBUG, "**** Received %s (%d) - Command in SIP %s\n", sip_methods[p->method].text, sip_methods[p->method].id, cmd);
- if (p->icseq && (p->icseq > seqno)) {
- if (option_debug)
- ast_log(LOG_DEBUG, "Ignoring too old SIP packet packet %d (expecting >= %d)\n", seqno, p->icseq);
- if (req->method != SIP_ACK)
- transmit_response(p, "503 Server error", req); /* We must respond according to RFC 3261 sec 12.2 */
- return -1;
+ if (p->icseq && (p->icseq > seqno) ) {
+ if (p->pendinginvite && seqno == p->pendinginvite && (req->method == SIP_ACK || req->method == SIP_CANCEL)) {
+ if (option_debug > 2)
+ ast_log(LOG_DEBUG, "Got CANCEL or ACK on INVITE with transactions in between.\n");
+ } else {
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Ignoring too old SIP packet packet %d (expecting >= %d)\n", seqno, p->icseq);
+ if (req->method != SIP_ACK)
+ transmit_response(p, "503 Server error", req); /* We must respond according to RFC 3261 sec 12.2 */
+ return -1;
+ }
} else if (p->icseq &&
p->icseq == seqno &&
req->method != SIP_ACK &&