<html><body bgcolor="#FFFFFF"><div>Graham,</div><div><br></div><div>Good deal. &nbsp;The one improvement I would suggest would be to use sqlops for custom DB queries as it is more flexible, and is the canonical way to do them now as of &gt;= 1.5.0. &nbsp;avp_db_query() could go away at some point.</div><div><br><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">--</span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);">This message was painstakingly thumbed out on my mobile, so apologies for brevity, errors, and general sloppiness.</span></div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><br></span></div><div>Alex Balashov - Principal</div><div>Evariste Systems LLC</div><div>260 Peachtree Street NW</div><div>Suite 2200</div><div>Atlanta, GA 30303</div><div>Tel: +1-678-954-0670</div><div>Fax: +1-404-961-1892</div><div>Web: <a href="http://www.evaristesys.com/"><a href="http://www.evaristesys.com/">http://www.evaristesys.com/</a></a></div></div><div><br>On Oct 2, 2011, at 10:03 PM, Graham Wooden &lt;<a href="mailto:graham@g-rock.net">graham@g-rock.net</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>
<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("auth_db", "load_credentials", "username")<br>
.<br>
.<br>
.<br>
.<br>
avp_db_query("select quota from quota where username='$avp(s:username)'", "$avp(s:quota)");<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("callquota", "$avp(s:username)", "$var(SIZE)");<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("503", "Simultaneous calls limit reached");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xlog("DEBUG: Limit of $var(SIZE) active calls has been reached for $avp(s:username)\n");<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("callquota","$avp(s:username)");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get_profile_size("callquota", "$avp(s:username)", "$var(SIZE)");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xlog("DEBUG: there are now $var(SIZE) active calls for $avp(s:username)\n");<br>
<br>
<br>
<br>
<br>
On 10/2/11 12:00 PM, "Uri Shacked" &lt;<a href="ushacked@gmail.com"><a href="mailto:ushacked@gmail.com">ushacked@gmail.com</a></a>&gt; wrote:<br>
<br>
</span></font><blockquote><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">Hi,<br>
&nbsp;<br>
I am trying to create concurrent calls limitations.<br>
two questions:<br>
&nbsp;<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>
&nbsp;<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"><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a></a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"><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></a><br>
</span></font></font></blockquote>



</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list</span><br><span><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a></span><br><span><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></span><br></div></blockquote></body></html>