Index: channels/chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.864 diff -u -r1.864 chan_sip.c --- channels/chan_sip.c 26 Sep 2005 03:05:37 -0000 1.864 +++ channels/chan_sip.c 28 Sep 2005 22:20:21 -0000 @@ -22,6 +22,7 @@ * */ +#define PATCH_5215 #include #include @@ -10445,7 +10446,12 @@ } else if (p->ocseq && (p->ocseq < seqno)) { ast_log(LOG_DEBUG, "Ignoring out of order response %d (expecting %d)\n", seqno, p->ocseq); return -1; +#ifndef PATCH_5215 } else if (p->ocseq && (p->ocseq != seqno)) { +#else + } else if ((p->ocseq && (p->ocseq != seqno)) + && !(ast_test_flag(p, SIP_OUTGOING) && p->pendinginvite && (p->pendinginvite == seqno))) { +#endif /* ignore means "don't do anything with it" but still have to respond appropriately */ ignore=1; @@ -10468,7 +10474,12 @@ if (option_debug > 2) ast_log(LOG_DEBUG, "**** Received %s (%d) - Command in SIP %s\n", sip_methods[p->method].text, sip_methods[p->method].id, cmd); +#ifndef PATCH_5215 if (p->icseq && (p->icseq > seqno)) { +#else + if ((p->icseq && (p->icseq > seqno)) + && !(!ast_test_flag(p, SIP_OUTGOING) && (req->method == SIP_ACK) && p->pendinginvite && (p->pendinginvite == seqno))) { +#endif ast_log(LOG_DEBUG, "Ignoring too old SIP packet packet %d (expecting >= %d)\n", seqno, p->icseq); return -1; } else if (p->icseq && (p->icseq == seqno) && req->method != SIP_ACK &&(p->method != SIP_CANCEL|| ast_test_flag(p, SIP_ALREADYGONE))) {