Ignore:
Timestamp:
Mar 30, 2012 7:10:13 AM (12 years ago)
Author:
bennylp
Message:

Re #1474: Merged all changes from 1.12 - HEAD (from the 1.x branch)

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk

  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r3878 r3999  
    213213     */ 
    214214    if (state == PJSIP_INV_STATE_CONFIRMED) { 
    215         if (pjmedia_sdp_neg_get_state(inv->neg)!=PJMEDIA_SDP_NEG_STATE_DONE) { 
     215        struct tsx_inv_data *tsx_inv_data = NULL; 
     216 
     217        if (inv->invite_tsx) { 
     218            tsx_inv_data = (struct tsx_inv_data*) 
     219                           inv->invite_tsx->mod_data[mod_inv.mod.id]; 
     220        } 
     221 
     222        if (pjmedia_sdp_neg_get_state(inv->neg)!=PJMEDIA_SDP_NEG_STATE_DONE && 
     223            (tsx_inv_data && !tsx_inv_data->sdp_done) ) 
     224        { 
    216225            pjsip_tx_data *bye; 
    217226 
     
    39553964    } else if (tsx->role == PJSIP_ROLE_UAS && 
    39563965               tsx->state == PJSIP_TSX_STATE_TRYING && 
     3966               pjsip_method_cmp(&tsx->method, &pjsip_invite_method)==0) 
     3967    { 
     3968        pjsip_rx_data *rdata = e->body.tsx_state.src.rdata; 
     3969        pjsip_tx_data *tdata; 
     3970        pj_status_t status; 
     3971 
     3972        /* See https://trac.pjsip.org/repos/ticket/1455 
     3973         * Handle incoming re-INVITE before current INVITE is confirmed. 
     3974         * According to RFC 5407: 
     3975         *  - answer with 200 if we don't have pending offer-answer 
     3976         *  - answer with 491 if we *have* pending offer-answer 
     3977         * 
     3978         *  But unfortunately accepting the re-INVITE would mean we have 
     3979         *  two outstanding INVITEs, and we don't support that because 
     3980         *  we will get confused when we handle the ACK. 
     3981         */ 
     3982        status = pjsip_dlg_create_response(inv->dlg, rdata, 
     3983                                           PJSIP_SC_REQUEST_PENDING, 
     3984                                           NULL, &tdata); 
     3985        if (status != PJ_SUCCESS) 
     3986            return; 
     3987        pjsip_timer_update_resp(inv, tdata); 
     3988        status = pjsip_dlg_send_response(dlg, tsx, tdata); 
     3989 
     3990    } else if (tsx->role == PJSIP_ROLE_UAS && 
     3991               tsx->state == PJSIP_TSX_STATE_TRYING && 
    39573992               pjsip_method_cmp(&tsx->method, &pjsip_update_method)==0) 
    39583993    { 
     
    39874022        /* Generic handling for UAC tsx completion */ 
    39884023        handle_uac_tsx_response(inv, e); 
     4024 
    39894025    } 
    39904026 
Note: See TracChangeset for help on using the changeset viewer.