Ignore:
Timestamp:
May 26, 2006 12:17:46 PM (18 years ago)
Author:
bennylp
Message:

First stage in pjsua library re-arrangements towards creating an easy to use high level API

File:
1 edited

Legend:

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

    r268 r476  
    6060            acc->regc = NULL; 
    6161            PJ_LOG(3,(THIS_FILE, "%s: unregistration success", 
    62                       acc->local_uri.ptr)); 
     62                      pjsua.config.acc_config[acc->index].id.ptr)); 
    6363        } else { 
    6464            PJ_LOG(3, (THIS_FILE,  
    6565                       "%s: registration success, status=%d (%s), " 
    6666                       "will re-register in %d seconds",  
    67                        acc->local_uri.ptr, 
     67                       pjsua.config.acc_config[acc->index].id.ptr, 
    6868                       param->code, 
    6969                       pjsip_get_status_text(param->code)->ptr, 
     
    7878    acc->reg_last_code = param->code; 
    7979 
    80     pjsua_ui_on_reg_state(acc->index); 
     80    if (pjsua.cb.on_reg_state) 
     81        (*pjsua.cb.on_reg_state)(acc->index); 
    8182} 
    8283 
     
    8586 * Update registration. If renew is false, then unregistration will be performed. 
    8687 */ 
    87 void pjsua_regc_update(int acc_index, pj_bool_t renew) 
     88PJ_DECL(void) pjsua_regc_update(int acc_index, pj_bool_t renew) 
    8889{ 
    8990    pj_status_t status = 0; 
     
    130131pj_status_t pjsua_regc_init(int acc_index) 
    131132{ 
     133    pjsua_acc_config *acc_config; 
    132134    pj_status_t status; 
    133135 
    134     if (pjsua.acc[acc_index].reg_uri.slen == 0) { 
     136    acc_config = &pjsua.config.acc_config[acc_index]; 
     137 
     138    if (acc_config->reg_uri.slen == 0) { 
    135139        PJ_LOG(3,(THIS_FILE, "Registrar URI is not specified")); 
    136140        return PJ_SUCCESS; 
     
    152156 
    153157    status = pjsip_regc_init( pjsua.acc[acc_index].regc,  
    154                               &pjsua.acc[acc_index].reg_uri,  
    155                               &pjsua.acc[acc_index].local_uri,  
    156                               &pjsua.acc[acc_index].local_uri, 
    157                               1, &pjsua.acc[acc_index].contact_uri,  
    158                               pjsua.acc[acc_index].reg_timeout); 
     158                              &acc_config->reg_uri,  
     159                              &acc_config->id,  
     160                              &acc_config->id, 
     161                              1, &acc_config->contact,  
     162                              acc_config->reg_timeout); 
    159163    if (status != PJ_SUCCESS) { 
    160164        pjsua_perror(THIS_FILE,  
     
    164168    } 
    165169 
    166     pjsip_regc_set_credentials( pjsua.acc[acc_index].regc,  
    167                                 pjsua.cred_count,  
    168                                 pjsua.cred_info ); 
     170    if (acc_config->cred_count) { 
     171        pjsip_regc_set_credentials( pjsua.acc[acc_index].regc,  
     172                                    acc_config->cred_count,  
     173                                    acc_config->cred_info ); 
     174    } 
    169175 
    170176    pjsip_regc_set_route_set( pjsua.acc[acc_index].regc,  
Note: See TracChangeset for help on using the changeset viewer.