summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-04-27 12:50:16 +0000
committerBenny Prijono <bennylp@teluu.com>2009-04-27 12:50:16 +0000
commit2a3362d1b960f0533552b8cfba0c6a4fff4ba147 (patch)
treee1096efb824638ad6c1b260fc54993916083566b /pjsip
parent1df6ac0c66b44fa792ef8e0f2a9aa3e45c4971f2 (diff)
Ticket #798: UAC disconnect call when receiving BYE in early state (thanks Gang Liu for the suggestion)
- UAC now handles the BYE, and treat it as out-of-order disconnect request, meaning that it will disconnect the call - it will also activate timer to terminate the INVITE transaction, in case final response never arrives - added SIPp UAS scenario to test this - also added forked 200/OK response SIPp scenario, - and fixed the prack_fork.xml SIPp scenario git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2650 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip-ua/sip_inv.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c
index 1807969c..4813c3cb 100644
--- a/pjsip/src/pjsip-ua/sip_inv.c
+++ b/pjsip/src/pjsip-ua/sip_inv.c
@@ -3361,6 +3361,22 @@ static void inv_on_state_early( pjsip_inv_session *inv, pjsip_event *e)
/* Generic handling for UAC tsx completion */
handle_uac_tsx_response(inv, e);
+
+ } else if (tsx->role == PJSIP_ROLE_UAS &&
+ tsx->method.id == PJSIP_BYE_METHOD &&
+ tsx->status_code < 200 &&
+ e->body.tsx_state.type == PJSIP_EVENT_RX_MSG)
+ {
+ /* Received BYE before the 2xx/OK response to INVITE.
+ * Assume that the 2xx/OK response is lost and the BYE
+ * arrives earlier.
+ */
+ inv_respond_incoming_bye(inv, tsx, e->body.tsx_state.src.rdata, e);
+
+ /* Set timer just in case we will never get the final response
+ * for INVITE.
+ */
+ pjsip_tsx_set_timeout(inv->invite_tsx, 64*pjsip_cfg()->tsx.t1);
}
}