Ignore:
Timestamp:
Nov 8, 2007 9:24:30 AM (17 years ago)
Author:
bennylp
Message:
  • Added option to send empty Authorization header in outgoing requests
  • When UAS has sent answer in reliable 1xx, do not put SDP in 2xx
  • Handle the case when UPDATE is challenged with 401/407
  • Obsolete --service-route option in pjsua
File:
1 edited

Legend:

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

    r1554 r1561  
    15641564    /* Include SDP when it's available for 2xx and 18x (but not 180) response. 
    15651565     * Subsequent response will include this SDP. 
     1566     * 
     1567     * Note note: 
     1568     *  - When offer/answer has been completed in reliable 183, we MUST NOT 
     1569     *    send SDP in 2xx response. So if we don't have SDP to send, clear 
     1570     *    the SDP in the message body ONLY if 100rel is active in this  
     1571     *    session. 
    15661572     */ 
    15671573    if (sdp) { 
    15681574        tdata->msg->body = create_sdp_body(tdata->pool, sdp); 
     1575    } else { 
     1576        if (inv->options & PJSIP_INV_REQUIRE_100REL) { 
     1577            tdata->msg->body = NULL; 
     1578        } 
    15691579    } 
    15701580 
     
    22272237    pj_status_t status = -1; 
    22282238 
     2239    /* Handle 401/407 challenge. */ 
     2240    if (tsx->state == PJSIP_TSX_STATE_COMPLETED && 
     2241        (tsx->status_code == 401 || tsx->status_code == 407)) { 
     2242 
     2243        pjsip_tx_data *tdata; 
     2244         
     2245        status = pjsip_auth_clt_reinit_req( &inv->dlg->auth_sess,  
     2246                                            e->body.tsx_state.src.rdata, 
     2247                                            tsx->last_tx, 
     2248                                            &tdata); 
     2249         
     2250        if (status != PJ_SUCCESS) { 
     2251             
     2252            /* Does not have proper credentials.  
     2253             * End the session anyway. 
     2254             */ 
     2255            inv_set_cause(inv, PJSIP_SC_OK, NULL); 
     2256            inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e); 
     2257             
     2258        } else { 
     2259            /* Re-send BYE. */ 
     2260            status = pjsip_inv_send_msg(inv, tdata); 
     2261        } 
     2262 
    22292263    /* Process 2xx response */ 
    2230     if (tsx->state == PJSIP_TSX_STATE_COMPLETED && 
     2264    } else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && 
    22312265        tsx->status_code/100 == 2 && 
    22322266        e->body.tsx_state.src.rdata->msg_info.msg->body) 
Note: See TracChangeset for help on using the changeset viewer.