From 908377811bbfebd69d2ff831b7ff38e207fbcd17 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Thu, 26 Jun 2008 13:24:10 +0000 Subject: Do no disconnect invite session if authentication fails for requests within dialog. Also clears up inv->invite_tsx if re-INVITE fails with authentication error, otherwise it will not be able to send further re-INVITEs git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2058 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsip-ua/sip_inv.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'pjsip') diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index b02eb2fd..371abb76 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -2353,11 +2353,14 @@ static void inv_handle_update_response( pjsip_inv_session *inv, if (status != PJ_SUCCESS) { - /* Does not have proper credentials. - * End the session anyway. + /* Somehow failed. Probably it's not a good idea to terminate + * the session since this is just a request within dialog. And + * even if we terminate we should send BYE. */ + /* inv_set_cause(inv, PJSIP_SC_OK, NULL); inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e); + */ } else { /* Re-send request. */ @@ -2578,20 +2581,25 @@ static pj_bool_t handle_uac_tsx_response(pjsip_inv_session *inv, pjsip_tx_data *tdata; pj_status_t status; + if (tsx->method.id == PJSIP_INVITE_METHOD) + inv->invite_tsx = NULL; + status = pjsip_auth_clt_reinit_req( &inv->dlg->auth_sess, e->body.tsx_state.src.rdata, tsx->last_tx, &tdata); if (status != PJ_SUCCESS) { - /* Does not have proper credentials. End the session. */ + /* Somehow failed. Probably it's not a good idea to terminate + * the session since this is just a request within dialog. And + * even if we terminate we should send BYE. + */ + /* inv_set_cause(inv, PJSIP_SC_OK, NULL); inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e); + */ } else { /* Re-send request. */ - if (tsx->method.id == PJSIP_INVITE_METHOD) - inv->invite_tsx = NULL; - status = pjsip_inv_send_msg(inv, tdata); } -- cgit v1.2.3