Ignore:
Timestamp:
Sep 11, 2008 8:00:47 AM (12 years ago)
Author:
bennylp
Message:

Ticket #620: PRACK is sent to the wrong UAS when 100rel is used and the dialog forks (thanks Ruud Klaver for the report)

File:
1 edited

Legend:

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

    r2039 r2271  
    418418    pj_status_t status; 
    419419 
    420     dd = (dlg_data*) inv->dlg->mod_data[mod_100rel.mod.id]; 
    421     PJ_ASSERT_RETURN(dd != NULL, PJSIP_ENOTINITIALIZED); 
    422  
    423420    tsx = pjsip_rdata_get_tsx(rdata); 
    424421    pj_assert(tsx != NULL); 
    425422 
    426423    msg = rdata->msg_info.msg; 
     424 
     425    dd = (dlg_data*) inv->dlg->mod_data[mod_100rel.mod.id]; 
     426    if (dd == NULL) { 
     427        /* UAC sends us PRACK while we didn't send reliable provisional  
     428         * response. Respond with 400 (?)  
     429         */ 
     430        const pj_str_t reason = pj_str("Unexpected PRACK"); 
     431 
     432        status = pjsip_dlg_create_response(inv->dlg, rdata, 400,  
     433                                           &reason, &tdata); 
     434        if (status == PJ_SUCCESS) { 
     435            status = pjsip_dlg_send_response(inv->dlg, tsx, tdata); 
     436        } 
     437        return PJSIP_ENOTINITIALIZED; 
     438    } 
    427439 
    428440    /* Always reply with 200/OK for PRACK */ 
Note: See TracChangeset for help on using the changeset viewer.