Hi Gertjan,

Probably unrelated, but you have a syntax error in the IF statement, has to be double ==

if( $avp(concurrent) == $var(max) ) 

See if that helps. Otherwise, what's the line #1576?

Regards,
--Sergiu

On Thu, Dec 3, 2020 at 4:06 AM Gertjan Wolzak <g.wolzak@kazlow.nl> wrote:
Hello Kamailions,

I am running into the following issue.

The same setup I had working on 5.0, now I am using a 5.4 version of
Kamailio, but I do not believe it has to do with the version, more with
my ability to make errors...

I am trying to limit incoming calls by using the dialog module. The max
concurrent calls value I retrieve from a database.

But when I try to start Kamailio it will not because the dialog profile
is not defined...

These are my configured Dialog parameters:

# ---- Dialog params -------------
modparam("dialog", "default_timeout", 7200)
modparam("dialog", "db_mode", 0)
modparam("dialog", "dlg_flag", DLG_FLAG)
modparam("dialog", "hash_size", 4096)
#modparam("dialog", "detect_spirals", 1)
modparam("dialog", "profiles_with_value", "callee")


My check on the concurrent inbound calls:

route[CONCURRENT_IN]
{
         #Add call to callee profile
         #Check if callee has not reached inbound call limit

         #Get max concurrent calls
         sql_query("cc", "select max_calls_in from calllimit where
cust_id='$avp(custid)'", "ra");
         $avp(maxcalls)=$dbr(ra=>[0,0]);
         sql_result_free("ra");
         $avp(concurrent) = 0;
         get_profile_size("callee", "$avp(custid)", "$avp(concurrent)");
         if( $avp(concurrent) = $var(max) )
         {
                 xlog("L_INFO"," Call limit reached for customer
$avp(custid)\r\n ");
                 sl_send_reply("503", "No Lines Available");
                 exit;
         }

         set_dlg_profile("callee", "$avp(custid)");

         return;
}


And the kamailio log error:

Dec  3 09:12:08 proxy01 kamailio[74102]: INFO: <core> [main.c:2833]:
main(): processes (at least): 21 - shm size: 67108864 - pkg size: 8388608
Dec  3 09:12:08 proxy01 kamailio[74102]: CRITICAL: dialog
[dialog.c:391]: fixup_profile(): profile <callee> not defined
Dec  3 09:12:08 proxy01 kamailio[74102]: ERROR: <core>
[core/route.c:1166]: fix_actions(): fixing failed (code=-6) at
cfg:/usr/local/etc/kamailio/kamailio.cfg:1576


Is someone able to see where I go wrong and point me in the right direction?

Thank you.

Rgds,

Gertjan Wolzak


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users