<HTML>
<HEAD>
<TITLE>Re: [SR-Users] limiting concurrent calls with dialog module</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi Uri,<BR>
<BR>
I just got done tailoring this exact concept with the dialog module (you may have just read my posts).<BR>
<BR>
Here is how I am doing it, roughly, for me. I have two places where I am executing the 3rd section below (for outbound and inbound). <BR>
Your mileage will vary.<BR>
<BR>
modparam(&quot;auth_db&quot;, &quot;load_credentials&quot;, &quot;username&quot;)<BR>
.<BR>
.<BR>
.<BR>
.<BR>
avp_db_query(&quot;select quota from quota where username='$avp(s:username)'&quot;, &quot;$avp(s:quota)&quot;);<BR>
.<BR>
.<BR>
.<BR>
.<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$var(SIZE) = 0;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get_profile_size(&quot;callquota&quot;, &quot;$avp(s:username)&quot;, &quot;$var(SIZE)&quot;);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if( $var(SIZE) &gt;= $avp(s:quota) ){<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sl_send_reply(&quot;503&quot;, &quot;Simultaneous calls limit reached&quot;);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xlog(&quot;DEBUG: Limit of $var(SIZE) active calls has been reached for $avp(s:username)\n&quot;);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set_dlg_profile(&quot;callquota&quot;,&quot;$avp(s:username)&quot;);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get_profile_size(&quot;callquota&quot;, &quot;$avp(s:username)&quot;, &quot;$var(SIZE)&quot;);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xlog(&quot;DEBUG: there are now $var(SIZE) active calls for $avp(s:username)\n&quot;);<BR>
<BR>
<BR>
<BR>
<BR>
On 10/2/11 12:00 PM, &quot;Uri Shacked&quot; &lt;<a href="ushacked@gmail.com">ushacked@gmail.com</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi,<BR>
 <BR>
I am trying to create concurrent calls limitations.<BR>
two questions:<BR>
 <BR>
1. should i use dialog module? or is there a better module?<BR>
2. i was trying to work with the dialog module, but didnt understand how and where to configure the commands and which to use.... any examples or ideas?<BR>
 <BR>
BR,<BR>
Uri<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_______________________________________________<BR>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<BR>
<a href="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">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE>
</BODY>
</HTML>