Changeset 1693 for pjproject


Ignore:
Timestamp:
Jan 15, 2008 4:54:54 PM (17 years ago)
Author:
bennylp
Message:

Reply with 488+SDP instead of 415 when incoming SDP is not acceptable (thanks Alain Totouom)

File:
1 edited

Legend:

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

    r1674 r1693  
    22852285                             int code ) 
    22862286{ 
     2287    pjsua_call *call; 
    22872288    pjsip_tx_data *tdata; 
    22882289    pj_status_t status; 
    22892290 
     2291    call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 
     2292 
    22902293    status = pjsip_inv_end_session(inv, code, NULL, &tdata); 
    2291     if (status == PJ_SUCCESS) 
    2292         pjsip_inv_send_msg(inv, tdata); 
     2294    if (status != PJ_SUCCESS) 
     2295        return; 
     2296 
     2297    /* Add SDP in 488 status */ 
     2298    if (call && call->med_tp && code==PJSIP_SC_NOT_ACCEPTABLE_HERE) { 
     2299        pjmedia_sdp_session *local_sdp; 
     2300        pjmedia_sock_info si; 
     2301 
     2302        call->med_tp->op->get_info(call->med_tp, &si); 
     2303        status = pjmedia_endpt_create_sdp(pjsua_var.med_endpt, tdata->pool,  
     2304                                          1, &si, &local_sdp); 
     2305        if (status == PJ_SUCCESS) { 
     2306            pjsip_create_sdp_body(tdata->pool, local_sdp, 
     2307                                  &tdata->msg->body); 
     2308        } 
     2309    } 
     2310 
     2311    pjsip_inv_send_msg(inv, tdata); 
    22932312} 
    22942313 
     
    23612380        pjsua_perror(THIS_FILE, "Unable to create media session",  
    23622381                     status); 
    2363         call_disconnect(inv, PJSIP_SC_UNSUPPORTED_MEDIA_TYPE); 
     2382        call_disconnect(inv, PJSIP_SC_NOT_ACCEPTABLE_HERE); 
    23642383        pjsua_media_channel_deinit(call->index); 
    23652384        PJSUA_UNLOCK(); 
Note: See TracChangeset for help on using the changeset viewer.