[OpenSIPS-Users] Concurrent calls limitation

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Oct 25 12:53:49 CEST 2012


Hi,

Before the channel limit test, print via xlog the value you loaded (the 
limit) and the current size (from profile). See what you get there for 
your calls.

Regards,

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


On 10/23/2012 11:43 AM, Engineer voip wrote:
> Hi,
> I'm trying to limit a calls of an user by using the script above
>
> route[39]
> {
>         if(!isflagset(31))
>         {
>                 if( avp_db_load("$fu/username","a") &&  
> avp_check("$avp(channels)", "ge/0"))
>                 {
>                         # get current calls for user
>                         get_profile_size("caller","$fu","$var(calls)");
>
>                         # check within limit
>                         if($avp(channels) > $var(calls))
>                         {
>                                 xlog("L_INFO", "Call control: user 
> '$fU' currently has '$var(calls)' of '$avp(channels)' active calls 
> before this one\n");
>                                 $var(setprofile) = 1;
>                          }
>                         else
>                         {
>                                 xlog("L_INFO", "Call control: user 
> channel limit exceeded [$var(calls)/$avp(channels)]\n");
>                                 send_reply("487", "Request Terminated: 
> Channel limit exceeded\n");
>                                 exit;
>                         }
>                 }
>                 else
>                 {
>                         $var(setprofile) = 0;
>                 }
>                 if($var(setprofile) > 0)
>                 {
>                         xlog("L_INFO", "Call control, setprofile: 
> $var(setprofile)\n");
>                         create_dialog();
>                         set_dlg_profile("caller","$fu");
>
>                 }
>                 setflag(31);
>         }
> }
> But if i limit the max calls at 1 i can make more than one calls.
>
> can you help me please ??
>
> -- 
>
> Best Regards.
>
>
>
> _______________________________________________
> 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/20121025/e9403f46/attachment-0001.htm>


More information about the Users mailing list