[OpenSIPS-Users] Managing Concurrent Calls

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Sep 4 10:52:09 CEST 2015


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
>




More information about the Users mailing list