From eab33324dee08217637b070a5d132969b027300b Mon Sep 17 00:00:00 2001 From: Olle Johansson Date: Sun, 3 Feb 2008 10:47:05 +0000 Subject: [PATCH] Merged revisions 102090 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ........ r102090 | oej | 2008-02-03 11:37:32 +0100 (Sön, 03 Feb 2008) | 8 lines Handle ACK and CANCEL in an invite transaction - even if we get INFO transactions during the actual call setup. (closes issue #10567) Reported by: jacksch Tested by: oej Patch by: oej inspired by suggestions from neutrino88 in the bug tracker ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102091 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1332a8ef56..ff18ee88ef 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -17644,11 +17644,15 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct so p->method = req->method; /* Find out which SIP method they are using */ ast_debug(4, "**** 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)) { - ast_debug(1, "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)) { + ast_debug(2, "Got CANCEL or ACK on INVITE with transactions in between.\n"); + } else { + ast_debug(1, "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 &&