Ignore:
Timestamp:
May 30, 2007 4:26:40 AM (17 years ago)
Author:
bennylp
Message:

Fixed ticket #302: Behavior in cancelling INVITE session when no provisional response has been received (thanks Esbjörn Dominique)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r1250 r1319  
    14201420    struct tsx_lock_data lck; 
    14211421 
     1422    PJ_ASSERT_RETURN(tsx != NULL, PJ_EINVAL); 
     1423 
    14221424    PJ_LOG(5,(tsx->obj_name, "Request to terminate transaction")); 
    14231425 
    1424     PJ_ASSERT_RETURN(tsx != NULL, PJ_EINVAL); 
    14251426    PJ_ASSERT_RETURN(code >= 200, PJ_EINVAL); 
    14261427 
     
    14311432    tsx_set_status_code(tsx, code, NULL); 
    14321433    tsx_set_state( tsx, PJSIP_TSX_STATE_TERMINATED, PJSIP_EVENT_USER, NULL); 
     1434    unlock_tsx(tsx, &lck); 
     1435 
     1436    return PJ_SUCCESS; 
     1437} 
     1438 
     1439 
     1440/* 
     1441 * Cease retransmission on the UAC transaction. The UAC transaction is 
     1442 * still considered running, and it will complete when either final 
     1443 * response is received or the transaction times out. 
     1444 */ 
     1445PJ_DEF(pj_status_t) pjsip_tsx_stop_retransmit(pjsip_transaction *tsx) 
     1446{ 
     1447    struct tsx_lock_data lck; 
     1448 
     1449    PJ_ASSERT_RETURN(tsx != NULL, PJ_EINVAL); 
     1450    PJ_ASSERT_RETURN(tsx->role == PJSIP_ROLE_UAC && 
     1451                     tsx->method.id == PJSIP_INVITE_METHOD, 
     1452                     PJ_EINVALIDOP); 
     1453 
     1454    PJ_LOG(5,(tsx->obj_name, "Request to stop retransmission")); 
     1455 
     1456    lock_tsx(tsx, &lck); 
     1457    /* Cancel retransmission timer. */ 
     1458    if (tsx->retransmit_timer.id != 0) { 
     1459        pjsip_endpt_cancel_timer(tsx->endpt, &tsx->retransmit_timer); 
     1460        tsx->retransmit_timer.id = 0; 
     1461    } 
    14331462    unlock_tsx(tsx, &lck); 
    14341463 
Note: See TracChangeset for help on using the changeset viewer.