<div dir="ltr">Hi Gertjan,<br><div><br></div><div>Probably unrelated, but you have a syntax error in the IF statement, has to be double ==</div><div><br></div><div>if( $avp(concurrent) == $var(max) ) <br></div><div><br></div><div>See if that helps. Otherwise, what's the line #1576?</div><div><br></div><div>Regards,</div><div>--Sergiu</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 3, 2020 at 4:06 AM Gertjan Wolzak <<a href="mailto:g.wolzak@kazlow.nl">g.wolzak@kazlow.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Kamailions,<br>
<br>
I am running into the following issue.<br>
<br>
The same setup I had working on 5.0, now I am using a 5.4 version of <br>
Kamailio, but I do not believe it has to do with the version, more with <br>
my ability to make errors...<br>
<br>
I am trying to limit incoming calls by using the dialog module. The max <br>
concurrent calls value I retrieve from a database.<br>
<br>
But when I try to start Kamailio it will not because the dialog profile <br>
is not defined...<br>
<br>
These are my configured Dialog parameters:<br>
<br>
# ---- Dialog params -------------<br>
modparam("dialog", "default_timeout", 7200)<br>
modparam("dialog", "db_mode", 0)<br>
modparam("dialog", "dlg_flag", DLG_FLAG)<br>
modparam("dialog", "hash_size", 4096)<br>
#modparam("dialog", "detect_spirals", 1)<br>
modparam("dialog", "profiles_with_value", "callee")<br>
<br>
<br>
My check on the concurrent inbound calls:<br>
<br>
route[CONCURRENT_IN]<br>
{<br>
         #Add call to callee profile<br>
         #Check if callee has not reached inbound call limit<br>
<br>
         #Get max concurrent calls<br>
         sql_query("cc", "select max_calls_in from calllimit where <br>
cust_id='$avp(custid)'", "ra");<br>
         $avp(maxcalls)=$dbr(ra=>[0,0]);<br>
         sql_result_free("ra");<br>
         $avp(concurrent) = 0;<br>
         get_profile_size("callee", "$avp(custid)", "$avp(concurrent)");<br>
         if( $avp(concurrent) = $var(max) )<br>
         {<br>
                 xlog("L_INFO"," Call limit reached for customer <br>
$avp(custid)\r\n ");<br>
                 sl_send_reply("503", "No Lines Available");<br>
                 exit;<br>
         }<br>
<br>
         set_dlg_profile("callee", "$avp(custid)");<br>
<br>
         return;<br>
}<br>
<br>
<br>
And the kamailio log error:<br>
<br>
Dec  3 09:12:08 proxy01 kamailio[74102]: INFO: <core> [main.c:2833]: <br>
main(): processes (at least): 21 - shm size: 67108864 - pkg size: 8388608<br>
Dec  3 09:12:08 proxy01 kamailio[74102]: CRITICAL: dialog <br>
[dialog.c:391]: fixup_profile(): profile <callee> not defined<br>
Dec  3 09:12:08 proxy01 kamailio[74102]: ERROR: <core> <br>
[core/route.c:1166]: fix_actions(): fixing failed (code=-6) at <br>
cfg:/usr/local/etc/kamailio/kamailio.cfg:1576<br>
<br>
<br>
Is someone able to see where I go wrong and point me in the right direction?<br>
<br>
Thank you.<br>
<br>
Rgds,<br>
<br>
Gertjan Wolzak<br>
<br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>