Fixed ticket #284: Failed scenarios with CANCEL requests (thanks Esbjörn Dominique)

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1287 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2007-05-22 12:21:40 +00:00
parent bbeb3999fe
commit 0606e704cd
2 changed files with 5 additions and 1 deletions

View File

@ -223,6 +223,7 @@ struct pjsip_inv_session
char obj_name[PJ_MAX_OBJ_NAME]; /**< Log identification */
pj_pool_t *pool; /**< Dialog's pool. */
pjsip_inv_state state; /**< Invite sess state. */
pj_bool_t cancelling; /**< CANCEL sent? */
pjsip_status_code cause; /**< Disconnect cause. */
pj_str_t cause_text; /**< Cause text. */
pj_bool_t notify; /**< Internal. */

View File

@ -1560,6 +1560,7 @@ PJ_DEF(pj_status_t) pjsip_inv_end_session( pjsip_inv_session *inv,
/* Done */
inv->cancelling = PJ_TRUE;
*p_tdata = tdata;
return PJ_SUCCESS;
@ -1950,7 +1951,9 @@ static void inv_on_state_calling( pjsip_inv_session *inv, pjsip_event *e)
inv_check_sdp_in_incoming_msg(inv, tsx,
e->body.tsx_state.src.rdata);
} else if (tsx->status_code==401 || tsx->status_code==407) {
} else if ((tsx->status_code==401 || tsx->status_code==407) &&
!inv->cancelling)
{
/* Handle authentication failure:
* Resend the request with Authorization header.