Changeset 3185 for pjproject


Ignore:
Timestamp:
May 26, 2010 3:04:43 PM (15 years ago)
Author:
nanang
Message:

Fix #1087:

  • Moved auto reregistration scheduling to be before the registration callback.
  • Updated validations in auto_rereg_timer_cb() & schedule_reregistration().
File:
1 edited

Legend:

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

    r3172 r3185  
    14811481    acc->reg_last_code = param->code; 
    14821482 
    1483     if (pjsua_var.ua_cfg.cb.on_reg_state) 
    1484         (*pjsua_var.ua_cfg.cb.on_reg_state)(acc->index); 
    1485  
    14861483    /* Check if we need to auto retry registration. Basically, registration 
    14871484     * failure codes triggering auto-retry are those of temporal failures 
     
    14981495        schedule_reregistration(acc); 
    14991496    } 
     1497 
     1498    if (pjsua_var.ua_cfg.cb.on_reg_state) 
     1499        (*pjsua_var.ua_cfg.cb.on_reg_state)(acc->index); 
    15001500 
    15011501    PJSUA_UNLOCK(); 
     
    23692369    PJSUA_LOCK(); 
    23702370 
    2371     if (!acc->valid || !acc->auto_rereg.active) 
     2371    /* Check if the reregistration timer is still valid, e.g: while waiting 
     2372     * timeout timer application might have deleted the account or disabled 
     2373     * the auto-reregistration. 
     2374     */ 
     2375    if (!acc->valid || !acc->auto_rereg.active ||  
     2376        acc->cfg.reg_retry_interval == 0) 
     2377    { 
    23722378        goto on_return; 
     2379    } 
    23732380 
    23742381    /* Start re-registration */ 
     
    23912398    pj_time_val delay; 
    23922399 
    2393     pj_assert(acc && acc->valid && acc->cfg.reg_retry_interval); 
     2400    pj_assert(acc); 
     2401 
     2402    /* Validate the account and re-registration feature status */ 
     2403    if (!acc->valid || acc->cfg.reg_retry_interval == 0) { 
     2404        return; 
     2405    } 
    23942406 
    23952407    /* If configured, disconnect calls of this account after the first 
Note: See TracChangeset for help on using the changeset viewer.