Ignore:
Timestamp:
Sep 21, 2011 7:38:22 AM (13 years ago)
Author:
bennylp
Message:

Added option to control first re-registration retry interval. This closes #1375

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_acc.c

    r3742 r3762  
    27532753 
    27542754    /* Reregistration attempt. The first attempt will be done immediately. */ 
    2755     delay.sec = acc->auto_rereg.attempt_cnt? acc->cfg.reg_retry_interval : 0; 
     2755    delay.sec = acc->auto_rereg.attempt_cnt? acc->cfg.reg_retry_interval : 
     2756                                             acc->cfg.reg_first_retry_interval; 
    27562757    delay.msec = 0; 
     2758 
     2759    /* Randomize interval by +/- 10 secs */ 
     2760    if (delay.sec >= 10) { 
     2761        delay.msec = -10000 + (pj_rand() % 20000); 
     2762    } else { 
     2763        delay.sec = 0; 
     2764        delay.msec = (pj_rand() % 10000); 
     2765    } 
     2766    pj_time_val_normalize(&delay); 
     2767 
    27572768    pjsua_schedule_timer(&acc->auto_rereg.timer, &delay); 
    27582769} 
Note: See TracChangeset for help on using the changeset viewer.