summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2014-01-24 11:28:34 +0000
committerBenny Prijono <bennylp@teluu.com>2014-01-24 11:28:34 +0000
commita8d64ee5f21ae6623f371cd8cd615758fec72200 (patch)
tree3055798babf861670f527f9a3ad900599c46dbda
parent514863030ea7a28b84d7880c848d2c3c8bcbf1fa (diff)
Fixed #1725: ACK is not sent upon receiving 200/OK retransmission if re-INVITE is sent
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4716 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsip-ua/sip_inv.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c
index 89fc5510..8fff3ded 100644
--- a/pjsip/src/pjsip-ua/sip_inv.c
+++ b/pjsip/src/pjsip-ua/sip_inv.c
@@ -398,6 +398,11 @@ static pj_status_t inv_send_ack(pjsip_inv_session *inv, pjsip_event *e)
return PJ_EBUG;
}
+ /* Note that with https://trac.pjsip.org/repos/ticket/1725, this
+ * function can be called to send ACK for previous INVITE 200/OK
+ * retransmission
+ */
+
PJ_LOG(5,(inv->obj_name, "Received %s, sending ACK",
pjsip_rx_data_get_info(rdata)));
@@ -618,15 +623,23 @@ static pj_bool_t mod_inv_on_rx_response(pjsip_rx_data *rdata)
* If it is, we need to send ACK.
*/
if (msg->type == PJSIP_RESPONSE_MSG && msg->line.status.code/100==2 &&
- rdata->msg_info.cseq->method.id == PJSIP_INVITE_METHOD &&
- inv->invite_tsx == NULL)
+ rdata->msg_info.cseq->method.id == PJSIP_INVITE_METHOD)
{
- pjsip_event e;
-
- PJSIP_EVENT_INIT_RX_MSG(e, rdata);
- inv_send_ack(inv, &e);
- return PJ_TRUE;
+ /* The code inside "if" is called the second time 200/OK
+ * retransmission is received. Also handle the situation
+ * when we have another re-INVITE on going and 200/OK
+ * retransmission is received. See:
+ * https://trac.pjsip.org/repos/ticket/1725
+ */
+ if (inv->invite_tsx == NULL ||
+ (inv->last_ack && inv->last_ack_cseq==rdata->msg_info.cseq->cseq))
+ {
+ pjsip_event e;
+ PJSIP_EVENT_INIT_RX_MSG(e, rdata);
+ inv_send_ack(inv, &e);
+ return PJ_TRUE;
+ }
}
/* No other processing needs to be done here. */