Changeset 2799


Ignore:
Timestamp:
Jun 25, 2009 10:58:13 AM (10 years ago)
Author:
bennylp
Message:

Ticket #797: Behavior when cancelling INVITE before provisional response is received

  • backported from ticket #506
Location:
pjproject/branches/1.0/pjsip
Files:
2 edited

Legend:

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

    r2394 r2799  
    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/branches/1.0/pjsip/src/pjsip-ua/sip_inv.c

    r2798 r2799  
    18681868            if (inv->invite_tsx->status_code < 100) { 
    18691869 
    1870                 pjsip_tsx_stop_retransmit(inv->invite_tsx); 
     1870                /* Do not stop INVITE retransmission, see ticket #506 */ 
     1871                //pjsip_tsx_stop_retransmit(inv->invite_tsx); 
    18711872                inv->cancelling = PJ_TRUE; 
    18721873                inv->pending_cancel = PJ_TRUE; 
    18731874                *p_tdata = NULL; 
    1874                 PJ_LOG(4, (inv->obj_name, "Stopping retransmission, " 
    1875                            "delaying CANCEL")); 
     1875                PJ_LOG(4, (inv->obj_name, "Delaying CANCEL since no " 
     1876                           "provisional response is received yet")); 
    18761877                return PJ_SUCCESS; 
    18771878            } 
Note: See TracChangeset for help on using the changeset viewer.