From beffb154962293bb6a355a8f734e7f2ab1379718 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 25 Jun 2008 18:35:31 +0000 Subject: Fixed assertion error when resending re-INVITE after it is challenged with 401/407, and also fixed error when the invite session is not retrying the BYE request when it is challenged with 401/407 git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2053 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 2085adec..b02eb2fd 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -2546,11 +2546,12 @@ static pj_bool_t handle_uac_tsx_response(pjsip_inv_session *inv, /* Note that 481 response to CANCEL does not terminate dialog usage, * but only the transaction. */ - if ((tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST && + if (inv->state != PJSIP_INV_STATE_DISCONNECTED && + ((tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST && tsx->method.id != PJSIP_CANCEL_METHOD) || - tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT || - tsx->status_code == PJSIP_SC_TSX_TIMEOUT || - tsx->status_code == PJSIP_SC_TSX_TRANSPORT_ERROR) + tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT || + tsx->status_code == PJSIP_SC_TSX_TIMEOUT || + tsx->status_code == PJSIP_SC_TSX_TRANSPORT_ERROR)) { pjsip_tx_data *bye; pj_status_t status; @@ -3303,14 +3304,15 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e) else if (tsx->method.id == PJSIP_INVITE_METHOD && tsx->role == PJSIP_ROLE_UAC) { - /* Must not have other pending INVITE transaction */ - pj_assert(inv->invite_tsx==NULL || tsx==inv->invite_tsx); /* * Handle outgoing re-INVITE */ if (tsx->state == PJSIP_TSX_STATE_CALLING) { + /* Must not have other pending INVITE transaction */ + pj_assert(inv->invite_tsx==NULL || tsx==inv->invite_tsx); + /* Save pending invite transaction */ inv->invite_tsx = tsx; @@ -3418,6 +3420,12 @@ static void inv_on_state_disconnected( pjsip_inv_session *inv, pjsip_event *e) if (status != PJ_SUCCESS) return; } + + } else if (tsx->role == PJSIP_ROLE_UAC) { + /* + * Handle 401/407/408/481 response + */ + handle_uac_tsx_response(inv, e); } } -- cgit v1.2.3