[OpenSIPS-Users] Concurrent calls limitation

Engineer voip forvoip4 at gmail.com
Tue Oct 23 10:43:08 CEST 2012


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20121023/a957e25f/attachment.htm>


More information about the Users mailing list