<p>Hi Austin,</p>
<p>Have a look at the TM module docs. You will find the appropriate commands there.</p>
<p>HTH</p>
<div class="gmail_quote">On Nov 3, 2011 3:01 AM, &quot;Austin Einter&quot; &lt;<a href="mailto:austin.einter@gmail.com">austin.einter@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Dear Andrew, Henning<br>Thanks for sharing very useful information.<br></div>
<div>I am bit new to kamailio, probably askingvery easy questions, please bear with me.</div>
<div> </div>
<div>I am not sure if I am forwording the INVITE statelessly or not.</div>
<div>How do I check if INVITE is forwarded statelessly.<br></div>
<div>Andrew you have mentioned &#39;So make sure that a transaction exists or create it<br>explicitly using the tm module&quot;. </div>
<div> </div>
<div>Not sure, how do I check if transaction exists or not. And how can I create it.</div>
<div> </div>
<div>Please give me some pointers or a sample config file.</div>
<div> </div>
<div>Regards,</div>
<div>Austin</div>
<div><br> </div>
<div class="gmail_quote">On Mon, Oct 31, 2011 at 4:37 PM, Andrew Pogrebennyk <span dir="ltr">&lt;<a href="mailto:apogrebennyk@sipwise.com" target="_blank">apogrebennyk@sipwise.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">Austin,<br>That is strange, because I am using similar setup successfully. Actually<br>I don&#39;t know if it counts the calls that are being established, I didn&#39;t<br>

care for it.<br><br>While looking through the docs:<br><a href="http://kamailio.org/docs/modules/3.1.x/modules_k/dialog.html#id2524304" target="_blank">http://kamailio.org/docs/modules/3.1.x/modules_k/dialog.html#id2524304</a><br>

 the following note caught my eye:<br><br>IMPORTANT: Users of this function should make sure that the dialog<br>created is further processed statefully. Specifically, if a stateless<br>response is sent out after dlg_manage() is called, the dialog cannot be<br>

handled properly. So make sure that a transaction exists or create it<br>explicitly using the tm module. This is a shortcoming of the current<br>implementation that may be resolved in a future version hopefully.<br><br>Could it be that you are forwarding the INVITE statelessly?<br>

Regards,<br><font color="#888888">Andrew<br></font>
<div>
<div></div>
<div><br>On 10/30/2011 01:08 PM, Austin Einter wrote:<br>&gt; Thanks Andrew<br>&gt; I added profile_with_value module parameter and with that I am able to<br>&gt; overcome this error.<br>&gt;<br>&gt; My code looks as below.<br>

&gt;<br>&gt;         dlg_manage();<br>&gt;         if (is_method(&quot;INVITE&quot;)) {<br>&gt;                  if (!has_totag()) {<br>&gt;                         #$var(SIZE) = 0;<br>&gt;                         get_profile_size(&quot;caller&quot;, &quot;$fu&quot;, &quot;$var(SIZE)&quot;);<br>

&gt;                         xlog(&quot;Number of calls present now is<br>&gt; $var(SIZE)\n&quot;);<br>&gt;                         if( $var(SIZE) &gt; MAX_NUMBER_OF_CALLS ) {<br>&gt;                                 sl_send_reply(&quot;503&quot;, &quot;Simultaneous calls<br>

&gt; limit reached&quot;);<br>&gt;                                 xlog(&quot;Rejected calls with 503<br>&gt; Simultaneous calls limit reached\n&quot;);<br>&gt;                                 exit;<br>&gt;                         }<br>

&gt;                         else {<br>&gt;                                  xlog(&quot;Allowed call. Looks max calls<br>&gt; limit not reached. Calls= $var(SIZE)\n&quot;);<br>&gt;                         }<br>&gt;                         set_dlg_profile(&quot;caller&quot;,&quot;$fu&quot;);<br>

&gt;                 }<br>&gt;         }<br>&gt; Whole purpose is to limit number of active calls at any point of time.<br>&gt; $var(SIZE) gives the number of calls are being established, but not the<br>&gt; number of calls are already established.<br>

&gt;<br>&gt; So if I am making multiple calls at  a point of time, it is blocking<br>&gt; call attempts beyond limit. But after all call setup complete, again<br>&gt; $var(SIZE) becomes zero and allows new calls.<br>&gt;<br>

&gt;<br>&gt; Has anybody done this (limiting number of calls at any point of time).<br>&gt; If so can you please share the configuration file changes.<br>&gt;<br>&gt;<br>&gt; To get $var(SIZE) working properly, do I need to enable MySql, please<br>

&gt; advice.<br>&gt;<br>&gt; Regards<br>&gt; Austin<br>&gt;<br><br><br></div></div>
<div>
<div></div>
<div>_______________________________________________<br>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br><a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>

<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br></div></div></blockquote></div><br>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div>