From 5d2066e0c3368cce23090e842c407a35bc351a83 Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Mon, 31 Oct 2011 10:31:23 +0000 Subject: Re #1395: Backport of PJSIP 1.x branch into PJSIP 2.0 trunk * Backport of r3833:r3877 git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3878 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsip-ua/sip_inv.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'pjsip/src/pjsip-ua') diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index 46153c9f..8c2c92d0 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 -- cgit v1.2.3