Changeset 1597 for pjproject/trunk


Ignore:
Timestamp:
Nov 23, 2007 12:04:40 PM (17 years ago)
Author:
bennylp
Message:

Fixed ticket #426: Respond incoming CANCEL with no matching INVITE with 481 (thanks Sergey Bakulin)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r1564 r1597  
    20452045 
    20462046        /* Invite transaction not found!  
    2047          * Respond CANCEL with 491 (RFC 3261 Section 9.2 page 42) 
    2048          */ 
    2049         status = pjsip_dlg_create_response( inv->dlg, rdata, 200, NULL,  
     2047         * Respond CANCEL with 481 (RFC 3261 Section 9.2 page 55) 
     2048         */ 
     2049        status = pjsip_dlg_create_response( inv->dlg, rdata, 481, NULL,  
    20502050                                            &tdata); 
    20512051 
     
    25672567         * Transaction Does Not Exist), 408, or when it's timed out. In these 
    25682568         * cases, disconnect session (i.e. dialog usage only). 
    2569          */ 
    2570         if (tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST || 
     2569         * Note that 481 response to CANCEL does not terminate dialog usage, 
     2570         * but only the transaction. 
     2571         */ 
     2572        if ((tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST && 
     2573                tsx->method.id != PJSIP_CANCEL_METHOD) || 
    25712574            tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT || 
    25722575            tsx->status_code == PJSIP_SC_TSX_TIMEOUT || 
     
    27852788         * Transaction Does Not Exist), 408, or when it's timed out. In these 
    27862789         * cases, disconnect session (i.e. dialog usage only). 
    2787          */ 
    2788         if (tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST || 
     2790         * Note that 481 response to CANCEL does not terminate dialog usage, 
     2791         * but only the transaction. 
     2792         */ 
     2793        if ((tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST && 
     2794                tsx->method.id != PJSIP_CANCEL_METHOD) || 
    27892795            tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT || 
    27902796            tsx->status_code == PJSIP_SC_TSX_TIMEOUT || 
     
    29242930         * Transaction Does Not Exist), 408, or when it's timed out. In these 
    29252931         * cases, disconnect session (i.e. dialog usage only). 
    2926          */ 
    2927         if (tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST || 
     2932         * Note that 481 response to CANCEL does not terminate dialog usage, 
     2933         * but only the transaction. 
     2934         */ 
     2935        if ((tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST && 
     2936                tsx->method.id != PJSIP_CANCEL_METHOD) || 
    29282937            tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT || 
    29292938            tsx->status_code == PJSIP_SC_TSX_TIMEOUT || 
     
    32323241         * Transaction Does Not Exist), 408, or when it's timed out. In these 
    32333242         * cases, disconnect session (i.e. dialog usage only). 
    3234          */ 
    3235         if (tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST || 
     3243         * Note that 481 response to CANCEL does not terminate dialog usage, 
     3244         * but only the transaction. 
     3245         */ 
     3246        if ((tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST && 
     3247                tsx->method.id != PJSIP_CANCEL_METHOD) || 
    32363248            tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT || 
    32373249            tsx->status_code == PJSIP_SC_TSX_TIMEOUT || 
Note: See TracChangeset for help on using the changeset viewer.