[OpenSIPS-Users] $rl_count in 2.2.2

Pat Burke pat at voxtelesys.com
Thu Jan 12 17:48:23 EST 2017


Hello,

I am trying to get the current rate limit value using $rl_count, but it is giving the following error.
       ERROR:ratelimit:pv_get_rl_count: invalid name
       WARNING:core:do_assign: no value in right expression at /etc/opensips/opensips_proxy.cfg:598
       4024438929 SCRIPT:CCLIMIT:INFO: rl_limit for cps_90761 = 0


Here is the code


    $json(call_details/tg_cps) = 0; # Default to 0


...


    if ($avp(maxcps) != NULL && $avp(maxcps) > 0) {
        if (!rl_check("cps_$avp(trunk_group)", "$avp(maxcps)")) {
            xlog("L_NOTICE", "$rU SCRIPT:CPSLIMIT:DBG: Max $avp(maxcps) cps reached for trunk group $avp(trunk_group) \n");
            $avp(error_reason) = $avp(error_reason) + $avp(trunk_group) + " CPS limit reached.";
            send_reply("403", "Max CPS limit reached");
            exit;
        }
    }
    
    $json(call_details/tg_cps) = $rl_count("cps_$avp(trunk_group)");
    xlog("L_INFO", "$rU SCRIPT:CCLIMIT:INFO: rl_limit for cps_$avp(trunk_group) = $json(call_details/tg_cps) \n");




>From the command  opensipsctl fifo rl_list | grep cps_90761, I get
       PIPE::  id=cps_90761 algorithm=TAILDROP limit=2 counter=0


What am I missing?

Regards,
Pat Burke



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170112/e71352ef/attachment.html>


More information about the Users mailing list