From 9a5d78c2c74c5181b12a467b98c6b37b944fd465 Mon Sep 17 00:00:00 2001 From: Olle Johansson Date: Sun, 3 Feb 2008 10:37:32 +0000 Subject: [PATCH] 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/branches/1.4@102090 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index ff09964e57..76f00e0908 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -15178,12 +15178,17 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc 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 && -- 2.47.3