[asterisk-dev] chan_sip - performance, and OPTIONS poking for 1000s of peers

Ryan Mitchell rjm at tcl.net
Mon Nov 27 08:57:59 MST 2006


>>> int to2 = DEFAULT_FREQ_OK + thread_safe_rand() % 8000 - 40000;
>>> peer->pokeexpire = ast_sched_add(sched, to2, sip_poke_peer_s, peer);
>>
>> Shouldn't that be 4000 (so you vary +/- 4000 from the DEFAULT_FREQ_OK),
>> rather than 40000?

Yes, that should be 4000, typo on my behalf, thanks.

> Perhaps if this became an option that these numbers would be settable
> from within sip.conf? I always get a vague feeling of unease when I
> see numbers like timers hardcoded into chan_sip...
>
> JT

Agreed, this was just my code to test proof-of-concept. In terms of a
variable, you could then write:

int to2 = DEFAULT_FREQ_OK + rand() % poke_rand_drift_ms -
poke_rand_drift_ms/2;

Also if you didn't set that number explicitly in sip.conf, you could
express it as a percentage, e.g. to2=DEFAULT_FREQ_OK +/- x%. Where 'x'
can be specified in sip.conf, and defaults to 0.


--Ryan



More information about the asterisk-dev mailing list