<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><a href="http://wiki.freeswitch.org/wiki/Mod_limit">http://wiki.freeswitch.org/wiki/Mod_limit</a><div><br></div><div><br><div><div>On Oct 2, 2009, at 8:32 AM, Tihomir Culjaga wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">what if you are running some huge traffic e.g. 2000 calls with media?<br><br>a typical application for that is an IVR system handling several different services. I'd like to "dedicate" some capacity for inbound on per service basis.<br>
<br><br>e.g. <br><br>DID 10001 limit to 500 calls<br>DID 10002 limit to 400 calls<br>DID 10003 limit to 100 calls<br>DID 10005 limit to 1000 calls<br><br><br>This will be a total of 2000 calls.<br><br><br>don't you think js is simply too weak for that? It should cont calls/channels, brake counts per service/DID and update the counters on every call hit.<br>
<br><br><br><br>in the DP you would have something like this for every DID:<br><br><br>&lt;include&gt;<br>&nbsp; &lt;extension name="MY_DID_NUM"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;condition field="destination_number" expression="^MY_DID_NUMBER$"&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;action application="set" data="SERVICE_LIMIT=500"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count number of active channels going towards MY_DID_NUMBER and store it into COUNT_MY_DID_NUMBER<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="transfer" data="do_MY_SERVICE XML public"/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>&nbsp; &lt;/extension&gt;<br>&lt;/include&gt;<br><br><br><br>&lt;include&gt;<br>

&nbsp; &lt;extension name="SERVICE1"&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;condition field="destination_number" expression="^do_MY_SERVICE$"/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;condition field="${COUNT_MY_DID_NUMBER}" expression="^SERVICE_LIMIT$"&gt;<br><br>&nbsp; &nbsp; &nbsp;&nbsp; &lt;!-- do your service here --&gt; &nbsp; <br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="playback" data="I_Accept_Your_Call.wav"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="hangup" data="NORMAL_CLEARING"/&gt;<br><br>&nbsp; &nbsp; &nbsp;&nbsp; &lt;!-- do your limitation here --&gt; &nbsp; <br>
&nbsp; &nbsp; &nbsp; &lt;anti-action application="respond" data="403 Forbidden"/&gt; &lt;= put your response here!<br>
<br>&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>
&nbsp; &lt;/extension&gt;<br>
&lt;/include&gt;<br><br><br><br><br><br>but the question is ... how powerful a JavaScript can be? Will it be enough to handle that load?<br><br><br><br>Tihomir.<br><br><br><br><br><br><div class="gmail_quote">On Fri, Oct 2, 2009 at 1:11 PM, Alberto Escudero <span dir="ltr">&lt;<a href="mailto:aep.lists@it46.se">aep.lists@it46.se</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; position: static; z-index: auto; "><br>
You can use the api and check that the channel is occupied with "show<br>
channels"?<br>
You can write a small javascript that checks if the channel is occupied by<br>
means of session.execute api.<br>
<br>
/aep<br>
<font color="#888888">--<br>
Stopping junk mailers is good for the environment<br>
</font><div><div></div><div class="h5"><br>
&gt; My SIP provider allows only one call (incoming or outgoing) via one<br>
&gt; SIP account. For FreeSWITCH I have configured it as public DID<br>
&gt; extension and outgoing gateway. Now I would like to transfer to<br>
&gt; another gw (or generate "limit exceded") when one tries to place an<br>
&gt; outgoing call while incoming call is in progress. How tho do that?<br>
&gt; Limiting the number of outgoing calls is easy (mod_limit), but how to<br>
&gt; take into account incoming one?<br>
&gt;<br>
&gt; - Dmitry Bely<br>
&gt;</div></div></blockquote></div></blockquote></div></div></body></html>