Changeset 512


Ignore:
Timestamp:
Jun 15, 2006 12:25:46 PM (16 years ago)
Author:
bennylp
Message:

Fixed couple of bugs in pjsua API: (1) server presence subscription not setting credentials, and (2) incorrect account status is reported when registration failed

Location:
pjproject/trunk/pjsip/src/pjsua-lib
Files:
2 edited

Legend:

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

    r503 r512  
    569569        info->status_text = pj_str(info->buf_); 
    570570    } else if (acc->reg_last_code) { 
    571         if (acc->regc) { 
     571        if (info->has_registration) { 
    572572            info->status = acc->reg_last_code; 
    573573            info->status_text = *pjsip_get_status_text(acc->reg_last_code); 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c

    r503 r512  
    440440{ 
    441441    int acc_id; 
    442     pjsua_acc_config *acc_config; 
     442    pjsua_acc *acc; 
    443443    pjsip_method *req_method = &rdata->msg_info.msg->line.req.method; 
    444444    pjsua_srv_pres *uapres; 
     
    459459    /* Find which account for the incoming request. */ 
    460460    acc_id = pjsua_acc_find_for_incoming(rdata); 
    461     acc_config = &pjsua_var.acc[acc_id].cfg; 
    462  
     461    acc = &pjsua_var.acc[acc_id]; 
     462 
     463    PJ_LOG(4,(THIS_FILE, "Creating server subscription, using account %d", 
     464              acc_id)); 
     465     
    463466    /* Create UAS dialog: */ 
    464467    status = pjsip_dlg_create_uas(pjsip_ua_instance(), rdata,  
    465                                   &acc_config->contact, 
     468                                  &acc->cfg.contact, 
    466469                                  &dlg); 
    467470    if (status != PJ_SUCCESS) { 
     
    472475        return PJ_TRUE; 
    473476    } 
     477 
     478    /* Set credentials. */ 
     479    pjsip_auth_clt_set_credentials(&dlg->auth_sess, acc->cred_cnt, acc->cred); 
    474480 
    475481    /* Init callback: */ 
Note: See TracChangeset for help on using the changeset viewer.