summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-06-26 13:24:10 +0000
committerBenny Prijono <bennylp@teluu.com>2008-06-26 13:24:10 +0000
commit908377811bbfebd69d2ff831b7ff38e207fbcd17 (patch)
tree4ac2b09a133d823f33bf74b3d8253cda2770a996
parent6a60cb0dca962dae6a8b9860d13ff3f2a448311d (diff)
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
-rw-r--r--pjsip/src/pjsip-ua/sip_inv.c20
1 files changed, 14 insertions, 6 deletions
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);
}