Ignore:
Timestamp:
Jan 17, 2013 12:57:46 PM (12 years ago)
Author:
bennylp
Message:

Fixed #1611: Add missing Supported header in UPDATE for Session Timers. Also fixed minor placement error of pjsip_dlg_dec_lock() in pjsip_inv_update(). The dec_lock was called too early before calling pjsip_timer_update_req().

File:
1 edited

Legend:

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

    r4301 r4323  
    25732573    pjsip_tx_data *tdata = NULL; 
    25742574    pjmedia_sdp_session *sdp_copy; 
     2575    const pjsip_hdr *hdr; 
    25752576    pj_status_t status = PJ_SUCCESS; 
    25762577 
     
    26412642    } 
    26422643 
    2643     /* Unlock dialog. */ 
    2644     pjsip_dlg_dec_lock(inv->dlg); 
     2644    /* Session Timers spec (RFC 4028) says that Supported header MUST be put 
     2645     * in refresh requests. So here we'll just put the Supported header in 
     2646     * all cases regardless of whether session timers is used or not, just 
     2647     * in case this is a common behavior. 
     2648     */ 
     2649    hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_SUPPORTED, NULL); 
     2650    if (hdr) { 
     2651        pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 
     2652                          pjsip_hdr_shallow_clone(tdata->pool, hdr)); 
     2653    } 
    26452654 
    26462655    status = pjsip_timer_update_req(inv, tdata); 
    26472656    if (status != PJ_SUCCESS) 
    26482657        goto on_error; 
     2658 
     2659    /* Unlock dialog. */ 
     2660    pjsip_dlg_dec_lock(inv->dlg); 
    26492661 
    26502662    *p_tdata = tdata; 
Note: See TracChangeset for help on using the changeset viewer.