[OpenSIPS-Users] Managing Concurrent Calls

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Sep 3 17:29:34 CEST 2015


Hi Terrance,


You can put your extra data into the "context_info" column in the 
address table. The can be automatically loaded via the check_xx_address 
functions :
http://www.opensips.org/html/docs/modules/1.11.x/permissions.html#id294839


Best regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 03.09.2015 03:49, Terrance Devor wrote:
> Hello Everyone,
>
> Thank you Bogdan for the script. I simply plugged the little bit of 
> code bellow in my script and everything just worked.
> Seems to be a theme with OpenSips "It just works...." lol.
>
> route[limit] {
>         set_dlg_profile("ip","$si");
>         get_profile_size("ip","$si","$var(calls)");
>         xlog("L_INFO","Customer IP $si has $var(calls) concurrent 
> calls, and limit is 12\n");
>
>         if($var(calls)>12) {
>                 xlog("Customer IP $si exceeded number of calls 
> $var(calls)/12\n");
>                 send_reply("486", "Busy here, channel limit exceeded.");
>                 exit;
>         }
> }
>
>
>
> My question now, is limit is hardcoded for testing purposes (ie, 
> $var(calls)>12). My approach would be to add a `channel` field to the
> `address` table, so we can limit the number of channel per IP. From 
> there, I would query that table on initial INVITE and pull the channel
> value as per IP address. This approach will of course not take 
> advantage of the amazing caching design of OpenSIPS.
>
> Before I go this route, is it possible to extract a cached `channel` 
> value from the database for a `$si`. I did not see this value anywhere.
>
> Thanks in Advance,
>
> Terrance.
>
> On Mon, Aug 17, 2015 at 1:02 PM, Terrance Devor <ter.devor at gmail.com 
> <mailto:ter.devor at gmail.com>> wrote:
>
>     Ahhhh sweet! Will go through it and update this email if I have
>     any issues.
>
>     Thanks Bogdan!
>
>     T​
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150903/1ccfd0dc/attachment.htm>


More information about the Users mailing list