diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-02-19 22:23:14 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-02-19 22:23:14 +0000 |
commit | 42a838330b0cec6683708fcb2147e2566650401e (patch) | |
tree | 3def6f6b919502d5696241619a5f72dfeb680236 /pjsip | |
parent | 9dee4f9cbb0ac97840dca9d70bd3815b0a985a12 (diff) |
Fixed ticket #114: INVITE transaction is not destroyed immediately when ACK has the same branch as the INVITE
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@982 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsip-ua/sip_inv.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index 46ca408d..f6a6a249 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -356,9 +356,13 @@ static void mod_inv_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e) if (mod_inv.cb.on_tsx_state_changed && inv->notify) (*mod_inv.cb.on_tsx_state_changed)(inv, tsx, e); - /* Clear invite transaction when tsx is terminated. */ - if (tsx->state==PJSIP_TSX_STATE_TERMINATED && tsx == inv->invite_tsx) - inv->invite_tsx = NULL; + /* Clear invite transaction when tsx is confirmed. + * Previously we set invite_tsx to NULL only when transaction has + * terminated, but this didn't work when ACK has the same Via branch + * value as the INVITE (see http://www.pjsip.org/trac/ticket/113) + */ + if (tsx->state>=PJSIP_TSX_STATE_CONFIRMED && tsx == inv->invite_tsx) + inv->invite_tsx = NULL; } @@ -2375,10 +2379,13 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e) /* Check if we have INVITE pending. */ if (inv->invite_tsx && inv->invite_tsx!=tsx) { + pj_str_t reason; + + reason = pj_str("Another INVITE transaction in progress"); /* Can not receive re-INVITE while another one is pending. */ - status = pjsip_dlg_create_response( inv->dlg, rdata, 500, NULL, - &tdata); + status = pjsip_dlg_create_response( inv->dlg, rdata, 500, + &reason, &tdata); if (status != PJ_SUCCESS) return; |