Ignore:
Timestamp:
May 6, 2019 10:55:35 AM (5 years ago)
Author:
ming
Message:

Fixed #2196: Assertion due to unset sip error code when media initialization fails during incoming call

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r5977 r5978  
    12321232 
    12331233        if (status != PJ_SUCCESS) { 
    1234             err_code = PJSIP_SC_NOT_ACCEPTABLE_HERE; 
     1234            err_code = PJSIP_SC_INTERNAL_SERVER_ERROR; 
    12351235            pjsua_perror(THIS_FILE, "Error creating SDP answer", status); 
    12361236        } 
     
    12411241 
    12421242        if (status != PJ_SUCCESS) { 
     1243            err_code = *sip_err_code; 
    12431244            pjsua_perror(THIS_FILE, "Error creating SDP answer", status); 
    12441245        } else { 
    12451246            status = pjsip_inv_set_local_sdp(call->inv, answer); 
    12461247            if (status != PJ_SUCCESS) { 
     1248                err_code = PJSIP_SC_NOT_ACCEPTABLE_HERE;                 
    12471249                pjsua_perror(THIS_FILE, "Error setting local SDP", status); 
    1248                 err_code = PJSIP_SC_NOT_ACCEPTABLE_HERE;                 
    12491250            } 
    12501251        } 
     
    12681269                err_code = (*response)->msg->line.status.code; 
    12691270            else 
    1270                 err_code = PJSIP_ERRNO_TO_SIP_STATUS(status); 
    1271         } 
    1272     } 
    1273     if (sip_err_code) 
    1274         *sip_err_code = err_code; 
     1271                err_code = PJSIP_SC_NOT_ACCEPTABLE_HERE;                 
     1272        } 
     1273    } 
     1274 
     1275    if (sip_err_code && status != PJ_SUCCESS) 
     1276        *sip_err_code = err_code? err_code:PJSIP_ERRNO_TO_SIP_STATUS(status); 
    12751277 
    12761278    return status; 
     
    12931295    PJSUA_LOCK(); 
    12941296 
    1295     if (sip_err_code) 
    1296         *sip_err_code = err_code; 
    1297  
    12981297    /* Increment the dialog's lock to prevent it to be destroyed prematurely, 
    12991298     * such as in case of transport error. 
     
    13221321on_return: 
    13231322    if (status != PJ_SUCCESS) { 
     1323        if (err_code == 0) 
     1324            err_code = PJSIP_ERRNO_TO_SIP_STATUS(status); 
     1325 
     1326        if (sip_err_code) 
     1327            *sip_err_code = err_code; 
     1328 
    13241329        /* If the callback is called from pjsua_call_on_incoming(), the 
    13251330         * invite's state is PJSIP_INV_STATE_NULL, so the invite session 
     
    13591364     
    13601365    pjsip_dlg_dec_lock(dlg); 
    1361  
    1362     if (sip_err_code) 
    1363         *sip_err_code = err_code; 
    13641366 
    13651367    if (tdata) 
     
    18051807            if (response) { 
    18061808                pjsip_dlg_send_response(dlg, call->inv->invite_tsx, response); 
    1807  
    18081809            } else { 
    18091810                pjsip_dlg_respond(dlg, rdata, sip_err_code, NULL, NULL, NULL); 
     
    24902491            pjsip_tx_data *tdata; 
    24912492            pj_status_t status_; 
     2493 
     2494            if (sip_err_code == 0) 
     2495                sip_err_code = PJSIP_ERRNO_TO_SIP_STATUS(status); 
    24922496 
    24932497            status_ = pjsip_inv_end_session(call->inv, sip_err_code, NULL, 
Note: See TracChangeset for help on using the changeset viewer.