Ignore:
Timestamp:
Mar 15, 2011 3:20:37 AM (14 years ago)
Author:
ming
Message:

Fixed #1205: Configurable delay before registration refresh setting in pjsua_acc_config

File:
1 edited

Legend:

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

    r3377 r3441  
    100100 
    101101    dst->reg_timeout = src->reg_timeout; 
     102    dst->reg_delay_before_refresh = src->reg_delay_before_refresh; 
    102103    dst->cred_count = src->cred_count; 
    103104 
     
    393394    pjsua_acc_config_dup(acc->pool, &pjsua_var.acc[id].cfg, cfg); 
    394395     
    395     /* Normalize registration timeout */ 
    396     if (pjsua_var.acc[id].cfg.reg_uri.slen && 
    397         pjsua_var.acc[id].cfg.reg_timeout == 0) 
    398     { 
    399         pjsua_var.acc[id].cfg.reg_timeout = PJSUA_REG_INTERVAL; 
     396    /* Normalize registration timeout and refresh delay */ 
     397    if (pjsua_var.acc[id].cfg.reg_uri.slen) { 
     398        if (pjsua_var.acc[id].cfg.reg_timeout == 0) { 
     399            pjsua_var.acc[id].cfg.reg_timeout = PJSUA_REG_INTERVAL; 
     400        } 
     401        if (pjsua_var.acc[id].cfg.reg_delay_before_refresh == 0) { 
     402            pjsua_var.acc[id].cfg.reg_delay_before_refresh = 
     403                PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH; 
     404        } 
    400405    } 
    401406 
     
    941946    /* Registration */ 
    942947    acc->cfg.reg_timeout = cfg->reg_timeout; 
     948    acc->cfg.reg_delay_before_refresh = cfg->reg_delay_before_refresh; 
    943949    acc->cfg.unreg_timeout = cfg->unreg_timeout; 
    944950    acc->cfg.allow_contact_rewrite = cfg->allow_contact_rewrite; 
     
    946952    acc->cfg.drop_calls_on_reg_fail = cfg->drop_calls_on_reg_fail; 
    947953 
    948     /* Normalize registration timeout */ 
    949     if (acc->cfg.reg_uri.slen && acc->cfg.reg_timeout == 0) 
    950         acc->cfg.reg_timeout = PJSUA_REG_INTERVAL; 
     954    /* Normalize registration timeout and refresh delay */ 
     955    if (acc->cfg.reg_uri.slen ) { 
     956        if (acc->cfg.reg_timeout == 0) { 
     957            acc->cfg.reg_timeout = PJSUA_REG_INTERVAL; 
     958        } 
     959        if (acc->cfg.reg_delay_before_refresh == 0) { 
     960            acc->cfg.reg_delay_before_refresh = 
     961                PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH; 
     962        } 
     963    } 
    951964 
    952965    /* Registrar URI */ 
     
    18161829        pjsip_regc_set_credentials( acc->regc, acc->cred_cnt, acc->cred); 
    18171830    } 
     1831 
     1832    /* Set delay before registration refresh */ 
     1833    pjsip_regc_set_delay_before_refresh(acc->regc, 
     1834                                        acc->cfg.reg_delay_before_refresh); 
    18181835 
    18191836    /* Set authentication preference */ 
Note: See TracChangeset for help on using the changeset viewer.