Changeset 2647 for pjproject/trunk


Ignore:
Timestamp:
Apr 26, 2009 11:30:22 AM (16 years ago)
Author:
bennylp
Message:

Fixed ticket #506: Behavior when cancelling INVITE before provisional response is received

  • do not stop INVITE retransmission
  • updated pjsip_inv_end_session() documentation
Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h

    r2394 r2647  
    654654 * Create a SIP message to initiate invite session termination. Depending on  
    655655 * the state of the session, this function may return CANCEL request,  
    656  * a non-2xx final response, or a BYE request. If the session has not answered 
    657  * the incoming INVITE, this function creates the non-2xx final response with  
    658  * the specified status code in st_code and optional status text in st_text. 
     656 * a non-2xx final response, a BYE request, or even no request.  
     657 * 
     658 * For UAS, if the session has not answered the incoming INVITE, this function 
     659 * creates the non-2xx final response with the specified status code in  
     660 * \a st_code and optional status text in \a st_text.  
     661 * 
     662 * For UAC, if the original INVITE has not been answered with a final  
     663 * response, the behavior depends on whether provisional response has been 
     664 * received. If provisional response has been received, this function will 
     665 * create CANCEL request. If no provisional response has been received, the 
     666 * function will not create CANCEL request (the function will return  
     667 * PJ_SUCCESS but the \a p_tdata will contain NULL) because we cannot send 
     668 * CANCEL before receiving provisional response. If then a provisional 
     669 * response is received, the invite session will send CANCEL automatically. 
     670 *  
     671 * For both UAC and UAS, if the INVITE session has been answered with final 
     672 * response, a BYE request will be created. 
    659673 * 
    660674 * @param inv           The invite session. 
    661675 * @param st_code       Status code to be used for terminating the session. 
    662676 * @param st_text       Optional status text. 
    663  * @param p_tdata       Pointer to receive the message to be created. 
    664  * 
    665  * @return              PJ_SUCCESS if termination message can be created. 
     677 * @param p_tdata       Pointer to receive the message to be created. Note 
     678 *                      that it's possible to receive NULL here while the 
     679 *                      function returns PJ_SUCCESS, see the description. 
     680 * 
     681 * @return              PJ_SUCCESS if termination is initiated. 
    666682 */ 
    667683PJ_DECL(pj_status_t) pjsip_inv_end_session( pjsip_inv_session *inv, 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r2646 r2647  
    18701870            if (inv->invite_tsx->status_code < 100) { 
    18711871 
    1872                 pjsip_tsx_stop_retransmit(inv->invite_tsx); 
     1872                /* Do not stop INVITE retransmission, see ticket #506 */ 
     1873                //pjsip_tsx_stop_retransmit(inv->invite_tsx); 
    18731874                inv->cancelling = PJ_TRUE; 
    18741875                inv->pending_cancel = PJ_TRUE; 
    18751876                *p_tdata = NULL; 
    1876                 PJ_LOG(4, (inv->obj_name, "Stopping retransmission, " 
    1877                            "delaying CANCEL")); 
     1877                PJ_LOG(4, (inv->obj_name, "Delaying CANCEL since no " 
     1878                           "provisional response is received yet")); 
    18781879                return PJ_SUCCESS; 
    18791880            } 
Note: See TracChangeset for help on using the changeset viewer.