summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-06-25 18:35:31 +0000
committerBenny Prijono <bennylp@teluu.com>2008-06-25 18:35:31 +0000
commitbeffb154962293bb6a355a8f734e7f2ab1379718 (patch)
tree5d239a00e29eeada5acecd66800bf917834a8a5c
parent91dd422374bd8363deabfd0b2a522008c38e826c (diff)
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
-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 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);
}
}