diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-12-22 17:04:38 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-12-22 17:04:38 +0000 |
commit | 1b0174dd80e57cfa869f8a9cc45208a1e374aeb1 (patch) | |
tree | aa2690955d865b6fe504fc186fd9d16e615acf4d /channels | |
parent | 9adb9754f4a42393d30c094e3e2da10cce7f7c70 (diff) |
Merged revisions 236063 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r236063 | dvossel | 2009-12-22 11:00:08 -0600 (Tue, 22 Dec 2009) | 18 lines
Merged revisions 236062 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r236062 | dvossel | 2009-12-22 10:58:19 -0600 (Tue, 22 Dec 2009) | 11 lines
fixes issue with p->method incorrectly set to ACK
It is possible for a second ACK to come in for a retransmitted message.
If an ack does not match an unacked message in our queue, restore the previous
p->method as this ACK is completely ignored.
(closes issue #16295)
Reported by: omolenkamp
Patches:
issue16295_v2.diff uploaded by dvossel (license 671)
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@236064 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 86b230623..2f4c2e429 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -21499,6 +21499,8 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct so int debug = sip_debug_test_pvt(p); char *e; int error = 0; + int oldmethod = p->method; + int acked = 0; /* Get Method and Cseq */ cseq = get_header(req, "Cseq"); @@ -21671,7 +21673,7 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct so if (seqno == p->pendinginvite) { p->invitestate = INV_TERMINATED; p->pendinginvite = 0; - __sip_ack(p, seqno, 1 /* response */, 0); + acked = __sip_ack(p, seqno, 1 /* response */, 0); if (find_sdp(req)) { if (process_sdp(p, req, SDP_T38_NONE)) return -1; @@ -21680,9 +21682,13 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct so } else if (p->glareinvite == seqno) { /* handle ack for the 491 pending sent for glareinvite */ p->glareinvite = 0; - __sip_ack(p, seqno, 1, 0); + acked = __sip_ack(p, seqno, 1, 0); + } + if (!acked) { + /* Got an ACK that did not match anything. Ignore + * silently and restore previous method */ + p->method = oldmethod; } - /* Got an ACK that we did not match. Ignore silently */ if (!p->lastinvite && ast_strlen_zero(p->randdata)) { pvt_set_needdestroy(p, "unmatched ACK"); } |