[asterisk-users] how to block spammer calls

Anselm Martin Hoffmeister anselm at hoffmeister-online.de
Sat Jan 5 06:44:38 CST 2008


Am Samstag, den 05.01.2008, 13:31 +0200 schrieb Tzafrir Cohen:
> On Sat, Jan 05, 2008 at 11:54:41AM +0100, Anselm Martin Hoffmeister wrote:
> 
> > Using cronjobs is possibly a bad idea because you create load spikes, if
> > e.g. 5000 asterisk -rx commands are issued within a few seconds. 
> 
> Why would you do that?
> 
> If you want to write 5000 commands, write them directly to the socket or
> use the manager interface.
> 
> I posted one a simple script for writing batch commands to the
> asterisk.ctl socket using socat. You have to strip the '\n' in the end
> of each command, and write every command in a separate write (I used a
> 'sleep 0.001' for that).

Hi Tzafrir,

good to know, and thanks for pointing this out to me. Until now I always
got around large command lists, ran just the occasional cronjob for the
odd task. 

Besides the possible effects of running a large command list (which may
be neglible, I admit), you gain another load spike by those users who
know they can retry calling after the next full hour. So the first few
minutes of each hour might be loaded heavier than the later parts.

I do not like the idea of "opening the gates" at a fixed time. Releasing
a lock for a certain CALLERID after a given time (in minutes), not a
given point of time (as clock time) seems much more elegant to me.

BR
Anselm




More information about the asterisk-users mailing list