From 2a3362d1b960f0533552b8cfba0c6a4fff4ba147 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 27 Apr 2009 12:50:16 +0000 Subject: 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 --- pjsip/src/pjsip-ua/sip_inv.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'pjsip/src/pjsip-ua/sip_inv.c') 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); } } -- cgit v1.2.3