<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, "Austin Einter" <<a href="mailto:austin.einter@gmail.com">austin.einter@gmail.com</a>> 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 'So make sure that a transaction exists or create it<br>explicitly using the tm module". </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"><<a href="mailto:apogrebennyk@sipwise.com" target="_blank">apogrebennyk@sipwise.com</a>></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't know if it counts the calls that are being established, I didn'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>> Thanks Andrew<br>> I added profile_with_value module parameter and with that I am able to<br>> overcome this error.<br>><br>> My code looks as below.<br>
><br>> dlg_manage();<br>> if (is_method("INVITE")) {<br>> if (!has_totag()) {<br>> #$var(SIZE) = 0;<br>> get_profile_size("caller", "$fu", "$var(SIZE)");<br>
> xlog("Number of calls present now is<br>> $var(SIZE)\n");<br>> if( $var(SIZE) > MAX_NUMBER_OF_CALLS ) {<br>> sl_send_reply("503", "Simultaneous calls<br>
> limit reached");<br>> xlog("Rejected calls with 503<br>> Simultaneous calls limit reached\n");<br>> exit;<br>> }<br>
> else {<br>> xlog("Allowed call. Looks max calls<br>> limit not reached. Calls= $var(SIZE)\n");<br>> }<br>> set_dlg_profile("caller","$fu");<br>
> }<br>> }<br>> Whole purpose is to limit number of active calls at any point of time.<br>> $var(SIZE) gives the number of calls are being established, but not the<br>> number of calls are already established.<br>
><br>> So if I am making multiple calls at a point of time, it is blocking<br>> call attempts beyond limit. But after all call setup complete, again<br>> $var(SIZE) becomes zero and allows new calls.<br>><br>
><br>> Has anybody done this (limiting number of calls at any point of time).<br>> If so can you please share the configuration file changes.<br>><br>><br>> To get $var(SIZE) working properly, do I need to enable MySql, please<br>
> advice.<br>><br>> Regards<br>> Austin<br>><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>