Changeset 3959


Ignore:
Timestamp:
Feb 27, 2012 9:12:13 AM (8 years ago)
Author:
bennylp
Message:

Fixed #1455: Incoming re-INVITE is unhandled if it comes in CONNECTING state (thanks Olle Frimanson for the report)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjsip/src/pjsip-ua/sip_inv.c

    r3834 r3959  
    38523852    } else if (tsx->role == PJSIP_ROLE_UAS && 
    38533853               tsx->state == PJSIP_TSX_STATE_TRYING && 
     3854               pjsip_method_cmp(&tsx->method, &pjsip_invite_method)==0) 
     3855    { 
     3856        pjsip_rx_data *rdata = e->body.tsx_state.src.rdata; 
     3857        pjsip_tx_data *tdata; 
     3858        pj_status_t status; 
     3859 
     3860        /* See https://trac.pjsip.org/repos/ticket/1455 
     3861         * Handle incoming re-INVITE before current INVITE is confirmed. 
     3862         * According to RFC 5407: 
     3863         *  - answer with 200 if we don't have pending offer-answer 
     3864         *  - answer with 491 if we *have* pending offer-answer 
     3865         * 
     3866         *  But unfortunately accepting the re-INVITE would mean we have 
     3867         *  two outstanding INVITEs, and we don't support that because 
     3868         *  we will get confused when we handle the ACK. 
     3869         */ 
     3870        status = pjsip_dlg_create_response(inv->dlg, rdata, 
     3871                                           PJSIP_SC_REQUEST_PENDING, 
     3872                                           NULL, &tdata); 
     3873        if (status != PJ_SUCCESS) 
     3874            return; 
     3875        pjsip_timer_update_resp(inv, tdata); 
     3876        status = pjsip_dlg_send_response(dlg, tsx, tdata); 
     3877 
     3878    } else if (tsx->role == PJSIP_ROLE_UAS && 
     3879               tsx->state == PJSIP_TSX_STATE_TRYING && 
    38543880               pjsip_method_cmp(&tsx->method, &pjsip_update_method)==0) 
    38553881    { 
     
    38843910        /* Generic handling for UAC tsx completion */ 
    38853911        handle_uac_tsx_response(inv, e); 
     3912 
    38863913    } 
    38873914 
Note: See TracChangeset for help on using the changeset viewer.