<div dir="ltr"><div><div><div>Hi list,<br></div>we have found a solution to kevin&#39;s issue.<br><br></div><u>first, on top of dialplan:</u><br></div>variables definitions<br><div><br><i>&lt;extension name=&quot;variables&quot; continue=&quot;true&quot;&gt;<br>

                        &lt;condition field=&quot;${destination_number}&quot; expression=&quot;.*&quot; break=&quot;never&quot;&gt;<br>                                &lt;action inline=&quot;true&quot; application=&quot;set&quot; data=&quot;limittotalcalls=200&quot; /&gt; ## limit of total call<br>

                                &lt;action inline=&quot;true&quot; application=&quot;set&quot; data=&quot;limitcps=${expr(ceil(${limittotalcalls}*10/100))}&quot; /&gt; ## sum of cps 10% = 20 CPS<br>                                &lt;action inline=&quot;true&quot; application=&quot;set&quot; data=&quot;limitprogresscall=${expr(ceil(${limittotalcalls}*30/100))}&quot; /&gt; ## sum of call in progress 30% = 60 call in progress<br>

                        &lt;/condition&gt;<br>                &lt;/extension&gt;</i><br><br></div><div><u>after in dialpan</u><br></div><div>fix hash with variable ${custdomain}, is ENUM domain of my customer.<br><br><i> &lt;condition field=&quot;${limitcalls}&quot; expression=&quot;^yes$&quot; break=&quot;never&quot;&gt;<br>

                                &lt;action application=&quot;limit&quot; data=&quot;hash cps ${custdomain} ${limitcps}/1 limit_exceeded_cps XML excess_limit&quot;/&gt;<br>                                &lt;action application=&quot;limit&quot; data=&quot;hash total ${custdomain} ${limittotalcalls} limit_exceeded_total XML excess_limit&quot; /&gt;<br>

                                &lt;action application=&quot;export&quot; data=&quot;nolocal:execute_on_answer=limit hash answercall ${custdomain} -1&quot;/&gt;<br>                        &lt;/condition&gt;</i><br><br></div>

<div><u>before bridge (end of dialplan):</u><br><br><i> &lt;condition field=&quot;${cond(${expr(${limit_usage(hash total ${custdomain})} - ${limit_usage(hash answercall ${custdomain})})} &gt; ${limitprogresscall} ? true:false)}&quot; expression=&quot;^true$&quot; break=&quot;on-true&quot;&gt;<br>

                                &lt;action application=&quot;log&quot; data=&quot;WARNING LOG : Call progress &gt; ${limitprogresscall} to ${custdomain}&quot;/&gt;<br>                                &lt;action application=&quot;respond&quot; data=&quot;503&quot;/&gt;<br>

                                &lt;action application=&quot;hangup&quot; data=&quot;CALL_REJECTED&quot;/&gt;<br>                        &lt;/condition&gt;</i><br><br></div><div>if 80 total calls - 30 answer calls = 50 calls in progress is &lt; to 60 limit, call is passed<br>

</div><div>BUT, if 90 total calls - 29 answer calls = 61 calls in progress is &gt; to 60 limit, call is rejected<br><br></div><div class="gmail_extra">This code is perfect to limit machine call for example. <br><br></div>

<div class="gmail_extra">Thanks for your response.<br><br></div><div class="gmail_extra">bye<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-06-10 14:50 GMT+02:00 Markus Lindenberg <span dir="ltr">&lt;<a href="mailto:markus.lindenberg@gmail.com" target="_blank">markus.lindenberg@gmail.com</a>&gt;</span>:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Kevin, <div><br></div><div>I&#39;m using/abusing limit for limiting incoming calls *to* an extension, although I&#39;ve just discovered that I would have the same problem, in my current implementation the limit for the callee is raised when the call is bridged:</div>



<div><br></div><div>First I do a inline lookup from the user directory and populate ${user_id} with the callee&#39;s id.</div><div><br></div><div><div>                &lt;condition&gt;</div><div>                        &lt;action inline=&quot;true&quot; application=&quot;log&quot; data=&quot;INFO Dialed number ${destination_number} is ${user_id}@${domain_name} in XML User Directory.&quot;/&gt;</div>



<div><br></div><div>                        &lt;!-- Get current limit, if &gt;0 then callee is in a call --&gt;</div><div>                        &lt;action inline=&quot;true&quot; application=&quot;set&quot; data=&quot;user_busy=${cond(${limit_usage(db ${domain_name} ${user_id})} &gt; 0 ? true : false)}&quot;/&gt;</div>



<div><br></div><div>                        &lt;!-- Don&#39;t use limit if caller=callee! (handover to own DECT etc.)--&gt;</div><div>                        &lt;action inline=&quot;true&quot; application=&quot;set&quot; data=&quot;user_busy=${cond(&amp;quot;${user_name}&amp;quot; == &amp;quot;${user_id}&amp;quot; ? false : ${user_busy})}&quot;/&gt;</div>



<div>                &lt;/condition&gt;<br></div></div><div><br></div><div><div>                &lt;condition field=&quot;${user_busy}&quot; expression=&quot;false&quot; break=&quot;never&quot;&gt;</div><div>                        &lt;!-- On bridge increase Call-Limit for the callee (B-Leg).</div>



<div>                             Limit for outgoing Calls will be increased in  dialplan/default.xml</div><div>                             See <a href="http://wiki.freeswitch.org/wiki/Limit" target="_blank">http://wiki.freeswitch.org/wiki/Limit</a> --&gt;</div>



<div>                        &lt;action application=&quot;set&quot; data=&quot;bridge_pre_execute_bleg_app=limit&quot;/&gt;<br></div><div>                        &lt;action application=&quot;set&quot; data=&quot;bridge_pre_execute_bleg_data=db ${domain_name} ${user_id} 100 !USER_BUSY&quot;/&gt;</div>



<div><br></div><div>                        &lt;action application=&quot;limit&quot; data=&quot;db ${domain_name} ${user_id} 100 !USER_BUSY&quot;/&gt;</div><div><br></div><div>                        &lt;action application=&quot;set&quot; data=&quot;fail_on_single_reject=USER_BUSY&quot;/&gt;</div>



<div>                        &lt;action application=&quot;bridge&quot; data=&quot;user/${user_id}@${domain_name}&quot;/&gt;</div><div><br></div><div>                        &lt;anti-action application=&quot;log&quot; data=&quot;INFO ${user_id}@${domain_name} is busy, not bridging call!&quot;/&gt;</div>



<div>                &lt;/condition&gt;</div></div><div><br></div><div>Now if I replace this:</div><div><br></div><div><div>                        &lt;action application=&quot;set&quot; data=&quot;bridge_pre_execute_bleg_app=limit&quot;/&gt;</div>



<div>                        &lt;action application=&quot;set&quot; data=&quot;bridge_pre_execute_bleg_data=db ${domain_name} ${user_id} 100 !USER_BUSY&quot;/&gt;</div></div><div><br></div><div>with that:</div><div><br></div>



<div><div>                        &lt;action application=&quot;limit&quot; data=&quot;db ${domain_name} ${user_id} 100 !USER_BUSY&quot;/&gt;</div></div><div><br></div><div>the callee is marked as busy directly before i try to bridge to the user. as soon as the call ends, the limit is reset. I just did a quick test though and didn&#39;t try all the corner cases. </div>



<div><br></div><div>best regards, markus</div><div><br></div></div><div class=""><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 10, 2014 at 12:11 PM, Avi Marcus <span dir="ltr">&lt;<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p>Just thinking out loud: you can use limit and an execute on answer to decrease the count, and also make sure it decreases it it fails.</p>




<p>I assume your ringing limit will be lower than channel limit? Otherwise the channel limit should suffice.</p>
<p>-Avi</p>
<div class="gmail_quote"><div><div>On Jun 10, 2014 10:52 AM, &quot;Kevin Mathy&quot; &lt;<a href="mailto:k.mathy@hexanet.fr" target="_blank">k.mathy@hexanet.fr</a>&gt; wrote:<br type="attribution"></div></div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
<div dir="ltr">Hi List, <div><br></div><div>I&#39;m trying to find something on freeswitch to make a &quot;per-user&quot; limitation of concurrent &quot;RINGING&quot; calls (or more generally, calls in PROCEEDING state).</div>






<div><br></div><div>I&#39;ve found the &quot;max-proceeding&quot; value I can set in switch.conf.xml, but it&#39;s a system&#39;s wide parameter, and I&#39;d like more granularity... </div><div><br></div><div>So, after some time spent on the mailing list and with my friend Google, it seems that someone asked for quite the same thing 2 years ago, but didn&#39;t get any answer : <a href="http://marc.info/?l=freeswitch-users&amp;m=134375187528797" target="_blank">http://marc.info/?l=freeswitch-users&amp;m=134375187528797</a></div>






<div><br></div><div>So, today, is there anything to achieve this ? Maybe something based on the &quot;limit&quot; module ?</div><div><br></div><div>Thanks a lot, </div><div>Kevin</div><div><br></div><div><br clear="all">





<div>
<b><div><span style="font-weight:normal">Bien cordialement, </span></div><div><span style="font-weight:normal">Best Regards, </span></div><div><span style="font-weight:normal"><br></span></div></b><b>Kevin MATHY</b> |<b> </b>Ingénieur VoIP<br>






<div><div><b><br></b></div></div></div>
</div></div>

<br>
<img src="http://www.hexanet.fr/sites/files/hexanet/files/20130205_signature_hexanet.gif"><br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Cordialement<br><br>HUBERT Mickaël<br>Ingénieur VOIP - Hexanet<br></div>
</div><div><div><div><div></div></div></div></div></div>

<br>
<img src="http://www.hexanet.fr/sites/files/hexanet/files/20130205_signature_hexanet.gif">