diff options
author | Benny Prijono <bennylp@teluu.com> | 2011-10-21 09:39:40 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2011-10-21 09:39:40 +0000 |
commit | b527491619af72e4c2da6a0cc25012b5995324ca (patch) | |
tree | 2c572ce0250cc56848e1a2c5dfbce8c4030b0a0a /pjsip | |
parent | f200f7a6b58030a239b1d005de85204a297c0d16 (diff) |
Fixed #1391: Missing CSeq check for incoming ACK in an INVITE session (thanks Ilya Kalinin for the report)
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3834 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsip-ua/sip_inv.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index b377beb4..6b4d649f 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -455,17 +455,25 @@ static pj_bool_t mod_inv_on_rx_request(pjsip_rx_data *rdata) */ if (method->id == PJSIP_ACK_METHOD && inv) { + /* Ignore if we don't have INVITE in progress */ + if (!inv->invite_tsx) { + return PJ_TRUE; + } + /* Ignore ACK if pending INVITE transaction has not finished. */ - if (inv->invite_tsx && - inv->invite_tsx->state < PJSIP_TSX_STATE_COMPLETED) - { + if (inv->invite_tsx->state < PJSIP_TSX_STATE_COMPLETED) { + return PJ_TRUE; + } + + /* Ignore ACK with different CSeq + * https://trac.pjsip.org/repos/ticket/1391 + */ + if (rdata->msg_info.cseq->cseq != inv->invite_tsx->cseq) { return PJ_TRUE; } /* Terminate INVITE transaction, if it's still present. */ - if (inv->invite_tsx && - inv->invite_tsx->state <= PJSIP_TSX_STATE_COMPLETED) - { + if (inv->invite_tsx->state <= PJSIP_TSX_STATE_COMPLETED) { /* Before we terminate INVITE transaction, process the SDP * in the ACK request, if any. * Only do this when invite state is not already disconnected |