Changeset 998 for pjproject/trunk


Ignore:
Timestamp:
Feb 24, 2007 1:29:22 PM (18 years ago)
Author:
bennylp
Message:

Fixed ticket #90: PUBLISH is rejected with 404 when REGISTER is challenged with 401/407

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h

    r974 r998  
    303303 
    304304/** 
     305 * Send PUBLISH 
     306 */ 
     307pj_status_t pjsua_pres_init_publish_acc(int acc_id); 
     308 
     309/** 
    305310 * Terminate server subscription for the account  
    306311 */ 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r974 r998  
    469469                       (int)param->reason.slen, param->reason.ptr, 
    470470                       param->expiration)); 
     471 
     472            /* Send initial PUBLISH if it is enabled */ 
     473            if (acc->cfg.publish_enabled && acc->publish_sess==NULL) 
     474                pjsua_pres_init_publish_acc(acc->index); 
    471475        } 
    472476 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c

    r974 r998  
    672672 
    673673/* Create client publish session */ 
    674 static pj_status_t create_publish(int acc_id) 
     674pj_status_t pjsua_pres_init_publish_acc(int acc_id) 
    675675{ 
    676676    const pj_str_t STR_PRESENCE = { "presence", 8 }; 
     
    723723    pj_list_init(&acc->pres_srv_list); 
    724724 
    725  
    726     return create_publish(acc_id); 
     725    return PJ_SUCCESS; 
    727726} 
    728727 
     
    804803    } 
    805804 
    806     /* Send PUBLISH if required */ 
    807     if (acc_cfg->publish_enabled) { 
    808         if (acc->publish_sess == NULL) 
    809             create_publish(acc_id); 
    810  
    811         if (acc->publish_sess && acc->publish_state != acc->online_status) { 
     805    /* Send PUBLISH if required. We only do this when we have a PUBLISH 
     806     * session. If we don't have a PUBLISH session, then it could be 
     807     * that we're waiting until registration has completed before we 
     808     * send the first PUBLISH.  
     809     */ 
     810    if (acc_cfg->publish_enabled && acc->publish_sess) { 
     811        if (acc->publish_state != acc->online_status) { 
    812812            send_publish(acc_id, PJ_TRUE); 
    813813        } 
Note: See TracChangeset for help on using the changeset viewer.