<div>Hi Alex</div>
<div>I tried using profile. I added below code to kamailio.cfg in route section.</div>
<div> </div>
<div>   if (is_method(&quot;INVITE&quot;)) {<br>                 if (!has_totag()) {<br>                        get_profile_size(&quot;caller&quot;, &quot;$fu&quot;, &quot;$var(SIZE)&quot;);<br>                        if( $var(SIZE) &gt;= MAX_NUMBER_OF_CALLS ) {<br>
                                sl_send_reply(&quot;503&quot;, &quot;Simultaneous calls limit reached&quot;);<br>                                xlog(&quot;Rejected calls with 503 Simultaneous calls limit reached\n&quot;);<br>
                                exit;<br>                        }<br>                        else {<br>                                 xlog(&quot;Max calls limit not reached yet\n&quot;);<br>                        }<br>
                }<br>        }<br>        set_dlg_profile(&quot;caller&quot;,&quot;$fu&quot;);<br></div>
<div> </div>
<div>When I run kamailio, I get below error.</div>
<div> </div>
<div> 0(4925) CRITICAL: dialog [dialog.c:297]: profile &lt;caller&gt; not definited<br> 0(4925) ERROR: &lt;core&gt; [route.c:1161]: fixing failed (code=-6) at cfg:/usr/local/etc/kamailio/kamailio.cfg:423<br> 0(4925) ERROR: &lt;core&gt; [route.c:1161]: fixing failed (code=-6) at cfg:/usr/local/etc/kamailio/kamailio.cfg:433<br>
 0(4925) ERROR: &lt;core&gt; [route.c:1161]: fixing failed (code=-6) at cfg:/usr/local/etc/kamailio/kamailio.cfg:434<br>ERROR: error -6 while trying to fix configuration<br></div>
<div> </div>
<div>Any idea why this error comes and how to fix it.</div>
<div> </div>
<div>-Regds</div>
<div>Austin</div>
<div><br><br> </div>
<div class="gmail_quote">On Sat, Oct 29, 2011 at 8:27 AM, Austin Einter <span dir="ltr">&lt;<a href="mailto:austin.einter@gmail.com">austin.einter@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>This is continuation with limiting number of calls per Kamailio proxy server.</div>
<div>I modified kamailio.cfg as below.</div>
<div> </div>
<div>1. loadmodule &quot;dialog.so&quot;</div>
<div>2. modparam(&quot;dialog&quot;, &quot;enable_stats&quot;, 1)<br>3. modparam(&quot;dialog&quot;, &quot;dlg_flag&quot;, 4)<br></div>
<div>Next, as dialog module I can use either active_dialogs() or $DLG_count to find number of calls present at any given point of time.</div>
<div>However if I use active_dialogs() I get parse error when I run kamailio proxy.</div>
<div>Next I used $DLG_count , but always I am getting value of $DLG_count as 0.</div>
<div> </div>
<div>In <strong>route</strong> section, I added code as below.</div>
<div> </div>
<div>        if (is_method(&quot;INVITE&quot;))<br>        {<br>                if($DLG_count &gt; 1)<br>                {<br>                        sl_send_reply(&quot;503&quot;,&quot;RESOURCE UNAVAILABLE&quot;);<br>                        exit;<br>
                }<br>                else<br>                {<br>                        xlog(&quot;Dialog count = $DLG_count\n&quot;);<br>                }<br>        }<br></div>
<div>Everytime a new call starts , it prints $DLG_count as 0.</div>
<div> </div>
<div>Kindly let me know whats going wrong here.</div>
<div> </div>
<div>Regards</div>
<div>Austin</div><font color="#888888">
<div> </div>
<div> </div></font></blockquote></div><br>