Finally I got it working. The issue was that I was trying to use pikelimit with Kamailio version 4.1, 4.1 version doesn't allow for dynamic pipe creation.

In the end, I backported pipelimit code from Kamailio version 4.2 and used pl_check function to create dynamic pipes.




From: sr-users <sr-users-bounces@lists.sip-router.org> on behalf of NITESH BANSAL <nitesh.bansal@outlook.com>
Sent: Wednesday, August 24, 2016 10:22:14 AM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] Rate limiting
 

What I really want is something similar to the Pike module, which dynamically controls the traffic based on the source address.

In my case, instead of the source address, I need to control traffic based on the LOGIN, there is no way to statically configure

the LOGIN, I want the module to treat the LOGINs just like dynamic source addresses.


From: sr-users <sr-users-bounces@lists.sip-router.org> on behalf of NITESH BANSAL <nitesh.bansal@outlook.com>
Sent: Wednesday, August 24, 2016 10:16:20 AM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] Rate limiting
 

Hello,


I tried calling the function pl_check , this is how I'm trying to use.


$var(check_result) = pl_check("$avp(s:LOGIN)");


This is always returning -2, shouldn't it create a new PIPE next time it receives a message from the same login?

I'm using Kamailio 4.1, could that be the difference?


Thanks,

Nitesh


From: sr-users <sr-users-bounces@lists.sip-router.org> on behalf of Alex Balashov <abalashov@evaristesys.com>
Sent: Friday, July 15, 2016 1:54:49 PM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] Rate limiting
 
I have never used pipelimit with a database.

The essence is the ability to pass a dynamic pipe to pl_check() which is created if it doesn't exist.

On July 15, 2016 4:59:01 AM EDT, NITESH BANSAL <nitesh.bansal@outlook.com> wrote:
>Hi Alex,
>
>
>I looked at the pipelimit module and apparently it relies on database,
>for performance reasons, I want to avoid DB looks and want to maintain
>
>something in-memory, just like 'Pike' does for source-ip limiting.
>
>Is there any way to do that in Kamailio?
>
>
>Nitesh
>
>________________________________
>From: sr-users <sr-users-bounces@lists.sip-router.org> on behalf of
>Alex Balashov <abalashov@evaristesys.com>
>Sent: Wednesday, July 13, 2016 3:47:32 PM
>To: sr-users@lists.sip-router.org
>Subject: Re: [SR-Users] Rate limiting
>
>The pipelimit module is the solution to all your problems.
>
>On 07/13/2016 04:09 AM, NITESH BANSAL wrote:
>
>> Actually, I forgot to mention that, I'm looking for a Kamailio module
>> which can do that.
>>
>> I want to avoid doing it on the application level (in perl/python).
>>
>>
>> Thanks,
>>
>> Nitesh
>>
>>
>------------------------------------------------------------------------
>> *From:* sr-users <sr-users-bounces@lists.sip-router.org> on behalf of
>> NITESH BANSAL <nitesh.bansal@outlook.com>
>> *Sent:* Tuesday, July 12, 2016 10:19:35 AM
>> *To:* sr-users@lists.sip-router.org
>> *Subject:* [SR-Users] Rate limiting
>>
>> Hello,
>>
>>
>> I plan to add some rate limiting in the Kamailio. I'm already using
>> *Pike* to rate limit based on the source IP.
>>
>> But in this case, i want to do the rate limiting per
>customer(regardless
>> of the source IP), I can identify the customer based on a custom
>>
>> header in the INVITE, idea is to limit the customer to 'x' number of
>> requests per second.
>>
>>
>> Nitesh
>>
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>list
>> sr-users@lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
>
>--
>Alex Balashov | Principal | Evariste Systems LLC
>1447 Peachtree Street NE, Suite 700
>Atlanta, GA 30309
>United States
>
>Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
>Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
>
>_______________________________________________
>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>sr-users@lists.sip-router.org
>http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>sr-users@lists.sip-router.org
>http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


-- Alex

--
Principal, Evariste Systems LLC (www.evaristesys.com)

Sent from my Google Nexus.


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users