Ignore:
Timestamp:
Dec 2, 2006 7:25:29 AM (17 years ago)
Author:
bennylp
Message:

Fixed ticket #36: pjsip_regc_unregister() SHOULD NOT unregister all contacts but rather only contact that was previously sent in the registration. In addition, added function pjsip_regc_unregister_all() to unregister all contacts

File:
1 edited

Legend:

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

    r841 r843  
    444444 
    445445    msg = tdata->msg; 
     446    pjsip_msg_add_hdr(msg, pjsip_hdr_shallow_clone(tdata->pool,  
     447                                                   regc->contact_hdr)); 
     448    pjsip_msg_add_hdr( msg, (pjsip_hdr*)regc->unreg_expires_hdr); 
     449 
     450    *p_tdata = tdata; 
     451    return PJ_SUCCESS; 
     452} 
     453 
     454PJ_DEF(pj_status_t) pjsip_regc_unregister_all(pjsip_regc *regc, 
     455                                              pjsip_tx_data **p_tdata) 
     456{ 
     457    pjsip_tx_data *tdata; 
     458    pjsip_msg *msg; 
     459    pj_status_t status; 
     460 
     461    PJ_ASSERT_RETURN(regc && p_tdata, PJ_EINVAL); 
     462 
     463    if (regc->timer.id != 0) { 
     464        pjsip_endpt_cancel_timer(regc->endpt, &regc->timer); 
     465        regc->timer.id = 0; 
     466    } 
     467 
     468    status = create_request(regc, &tdata); 
     469    if (status != PJ_SUCCESS) 
     470        return status; 
     471 
     472    msg = tdata->msg; 
    446473    pjsip_msg_add_hdr( msg, (pjsip_hdr*)regc->unreg_contact_hdr); 
    447474    pjsip_msg_add_hdr( msg, (pjsip_hdr*)regc->unreg_expires_hdr); 
Note: See TracChangeset for help on using the changeset viewer.