Changeset 4957 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
- Timestamp:
- Nov 4, 2014 8:00:15 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r4955 r4957 1205 1205 acc->cfg.reg_retry_interval = cfg->reg_retry_interval; 1206 1206 acc->cfg.reg_first_retry_interval = cfg->reg_first_retry_interval; 1207 acc->cfg.reg_retry_random_interval = cfg->reg_retry_random_interval; 1207 1208 acc->cfg.drop_calls_on_reg_fail = cfg->drop_calls_on_reg_fail; 1208 1209 acc->cfg.register_on_acc_add = cfg->register_on_acc_add; … … 3540 3541 delay.msec = 0; 3541 3542 3542 /* Randomize interval by +/- 10 secs */ 3543 if (delay.sec >= 10) { 3544 delay.msec = -10000 + (pj_rand() % 20000); 3545 } else { 3546 delay.sec = 0; 3547 delay.msec = (pj_rand() % 10000); 3543 /* Randomize interval by +/- reg_retry_random_interval, if configured */ 3544 if (acc->cfg.reg_retry_random_interval) { 3545 long rand_ms = acc->cfg.reg_retry_random_interval * 1000; 3546 if (delay.sec >= (long)acc->cfg.reg_retry_random_interval) { 3547 delay.msec = -rand_ms + (pj_rand() % (rand_ms * 2)); 3548 } else { 3549 delay.sec = 0; 3550 delay.msec = (pj_rand() % (delay.sec * 1000 + rand_ms)); 3551 } 3548 3552 } 3549 3553 pj_time_val_normalize(&delay);
Note: See TracChangeset
for help on using the changeset viewer.