[OpenSIPS-Users] Managing Concurrent Calls

Schneur Rosenberg rosenberg11219 at gmail.com
Fri Sep 4 11:36:28 CEST 2015


I limit mine on account and I used memcache to store the limits because its
not something that changes on a constant basis, so it only does a db query
maximum once a hour per device.
On Sep 4, 2015 4:52 AM, "Bogdan-Andrei Iancu" <bogdan at opensips.org> wrote:

> Hi Terrance,
>
> That check is not expensive as it is done in memory cache (the "address"
> table is cached at startup).
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
> On 03.09.2015 21:42, Terrance Devor wrote:
>
>> Lovely!
>>
>> For those that need to limit concurrent call on OpenSIPS, here is the
>> solution:
>>
>> route[limit] {
>>         set_dlg_profile("ip","$si");
>>         get_profile_size("ip","$si","$var(calls)");
>> check_address("0","$si","$sp","$proto","$avp(ctx)");
>>         xlog("$avp(ctx)\n");
>>         xlog("L_INFO","Customer IP $si has $var(calls) concurrent calls,
>> and limit is 12\n");
>>
>>         if($var(calls)>$avp(ctx)) {
>>                 xlog("Customer IP $si exceeded number of calls
>> $var(calls)/12\n");
>>                 send_reply("486", "Busy here, channel limit exceeded.");
>>                 exit;
>>         }
>> }
>>
>> Bogdan, how expensive is
>> `check_address("0","$si","$sp","$proto","$avp(ctx)")`?
>>
>> Terrance
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150904/f7e70757/attachment.htm>


More information about the Users mailing list