<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi there,<div><br></div><div>I'm using a dialog module in a small kamailio script that only does  routing based on prefix, and relay the invite from one ipaddr to another ip addr (diferent interfaces) using $fs variavel.</div><div><br></div><div><div>Now i was introducing the dialog module to limit the number of concurrent calls, and i noticed that it only can increasing the number of dialogs, and it isn't  decreasing when receives the "BYE", I also noticed that when kamailio receives "BYE"  the dialog event route for state "end" is not executed.</div></div><div><br></div><div>To count the number of concurrent calls I'm using the following logic in main route:</div><div><br></div><div><div>if (is_method("INVITE")) {</div><div>                        setflag(FLT_ACC); # do accounting</div><div>                        dlg_manage();</div><div>                        if(get_profile_size("concurrentcalls","local","$avp(s:size)"))</div><div>                        {</div><div>                                if($avp(s:size) != $null)</div><div>                                {</div><div>                                        xlog("L_INFO", "Number of calls for this server : $avp(s:size) - ID=$ci\n");    </div><div>                                        if($avp(s:size) >=  15000)</div><div>                                        {</div><div>                                                xlog("L_INFO", "Concurrent_max calls exceeded $avp(s:size) for caller '$fU' - R=$ru ID=$ci\n");</div><div>                                                sl_send_reply("503", "Channel limit exceeded\n");</div><div>                                                exit;</div><div>                                        }</div><div><br></div><div>                                }</div><div>                        }</div><div>                        set_dlg_profile("concurrentcalls","local");</div><div>                }</div></div><div><br></div><div><br></div><div>Please check out the attachment with logs.<br></div><div><br></div><div>Best Regards</div><span class="HOEnZb"><font color="#888888"><div>-- <br></div><div><div><div>José Seabra</div></div></div></font></span></div></blockquote></div>
</div></div>