Ignore:
Timestamp:
Jun 27, 2007 1:01:59 PM (15 years ago)
Author:
bennylp
Message:

Ticket #347: Assertion failure when handling incoming presence subscription with Expires=0

File:
1 edited

Legend:

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

    r1385 r1396  
    457457    pjsip_pres_status pres_status; 
    458458    pjsip_dialog *dlg; 
     459    pjsip_expires_hdr *expires_hdr; 
     460    pjsip_evsub_state ev_state; 
    459461    pj_status_t status; 
    460462 
     
    559561    pjsip_pres_set_status(sub, &pres_status); 
    560562 
     563    /* Check expires value. If it's zero, send our presense state but 
     564     * set subscription state to TERMINATED. 
     565     */ 
     566    expires_hdr=(pjsip_expires_hdr*) 
     567                pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_EXPIRES, NULL); 
     568 
     569    if (expires_hdr && expires_hdr->ivalue == 0) 
     570        ev_state = PJSIP_EVSUB_STATE_TERMINATED; 
     571    else 
     572        ev_state = PJSIP_EVSUB_STATE_ACTIVE; 
     573 
    561574    /* Create and send the first NOTIFY to active subscription: */ 
    562     status = pjsip_pres_notify( sub, PJSIP_EVSUB_STATE_ACTIVE, NULL, 
    563                                 NULL, &tdata); 
     575    status = pjsip_pres_notify( sub, ev_state, NULL, NULL, &tdata); 
    564576    if (status == PJ_SUCCESS) { 
    565577        pjsua_process_msg_data(tdata, NULL); 
Note: See TracChangeset for help on using the changeset viewer.