Hi!
I have a SIP phone sending a REGISTER request every second. I want to block requests from this SIP phone for some time. I've read the docs but IMO the configuration and usage is quite complicated. Can the pike module be used to block this user? I'm not sure how to configure the pike module to block the REGISTER (1 request per second) but to allow proper dialing (e.g. a call setup may have 4 requests within one second).
Does the pike module count all requests received or only those requests for which I execute pike_check_req()?
regards klaus
Hi Klaus,
first, the pike module will count the IP source only for the requests called with pike_check_req(). There is no multiple counters support - only one.
so, from script you can filter what requests you want to count. That's all you need to do in order to use it.
regarding the configuration, you have three parameters: sampling time unit (S), request density per unit (N) and removed latency (L). In words: the alarm will be trigger if you get more than N request per S seconds. The alarm will be removed if no other request is received in L seconds.
So, in your case, try: modparam("pike", "sampling_time_unit", 4) modparam("pike", "reqs_density_per_unit", 2)
and
if (is_method("REGISTER") && !pike_check_req()) { log("..."); exit; }
regards, bogdan
Klaus Darilion wrote:
Hi!
I have a SIP phone sending a REGISTER request every second. I want to block requests from this SIP phone for some time. I've read the docs but IMO the configuration and usage is quite complicated. Can the pike module be used to block this user? I'm not sure how to configure the pike module to block the REGISTER (1 request per second) but to allow proper dialing (e.g. a call setup may have 4 requests within one second).
Does the pike module count all requests received or only those requests for which I execute pike_check_req()?
regards klaus
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Bogdan-Andrei Iancu wrote:
Hi Klaus,
seconds. The alarm will be removed if no other request is received in L seconds.
That does mean if a SIP client is sending every second, once it reaches the threshold it will be blocked forever. I wanted to block this user only for a certain amount of time (e.g. 1 minute)
regards klaus
So, in your case, try: modparam("pike", "sampling_time_unit", 4) modparam("pike", "reqs_density_per_unit", 2)
and
if (is_method("REGISTER") && !pike_check_req()) { log("..."); exit; }
regards, bogdan
Klaus Darilion wrote:
Hi!
I have a SIP phone sending a REGISTER request every second. I want to block requests from this SIP phone for some time. I've read the docs but IMO the configuration and usage is quite complicated. Can the pike module be used to block this user? I'm not sure how to configure the pike module to block the REGISTER (1 request per second) but to allow proper dialing (e.g. a call setup may have 4 requests within one second).
Does the pike module count all requests received or only those requests for which I execute pike_check_req()?
regards klaus
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users