<div dir="ltr"><div><div><div>Hi list,<br></div>we have found a solution to kevin's issue.<br><br></div><u>first, on top of dialplan:</u><br></div>variables definitions<br><div><br><i><extension name="variables" continue="true"><br>
<condition field="${destination_number}" expression=".*" break="never"><br> <action inline="true" application="set" data="limittotalcalls=200" /> ## limit of total call<br>
<action inline="true" application="set" data="limitcps=${expr(ceil(${limittotalcalls}*10/100))}" /> ## sum of cps 10% = 20 CPS<br> <action inline="true" application="set" data="limitprogresscall=${expr(ceil(${limittotalcalls}*30/100))}" /> ## sum of call in progress 30% = 60 call in progress<br>
</condition><br> </extension></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> <condition field="${limitcalls}" expression="^yes$" break="never"><br>
<action application="limit" data="hash cps ${custdomain} ${limitcps}/1 limit_exceeded_cps XML excess_limit"/><br> <action application="limit" data="hash total ${custdomain} ${limittotalcalls} limit_exceeded_total XML excess_limit" /><br>
<action application="export" data="nolocal:execute_on_answer=limit hash answercall ${custdomain} -1"/><br> </condition></i><br><br></div>
<div><u>before bridge (end of dialplan):</u><br><br><i> <condition field="${cond(${expr(${limit_usage(hash total ${custdomain})} - ${limit_usage(hash answercall ${custdomain})})} > ${limitprogresscall} ? true:false)}" expression="^true$" break="on-true"><br>
<action application="log" data="WARNING LOG : Call progress > ${limitprogresscall} to ${custdomain}"/><br> <action application="respond" data="503"/><br>
<action application="hangup" data="CALL_REJECTED"/><br> </condition></i><br><br></div><div>if 80 total calls - 30 answer calls = 50 calls in progress is < to 60 limit, call is passed<br>
</div><div>BUT, if 90 total calls - 29 answer calls = 61 calls in progress is > 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"><<a href="mailto:markus.lindenberg@gmail.com" target="_blank">markus.lindenberg@gmail.com</a>></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'm using/abusing limit for limiting incoming calls *to* an extension, although I'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's id.</div><div><br></div><div><div> <condition></div><div> <action inline="true" application="log" data="INFO Dialed number ${destination_number} is ${user_id}@${domain_name} in XML User Directory."/></div>
<div><br></div><div> <!-- Get current limit, if >0 then callee is in a call --></div><div> <action inline="true" application="set" data="user_busy=${cond(${limit_usage(db ${domain_name} ${user_id})} > 0 ? true : false)}"/></div>
<div><br></div><div> <!-- Don't use limit if caller=callee! (handover to own DECT etc.)--></div><div> <action inline="true" application="set" data="user_busy=${cond(&quot;${user_name}&quot; == &quot;${user_id}&quot; ? false : ${user_busy})}"/></div>
<div> </condition><br></div></div><div><br></div><div><div> <condition field="${user_busy}" expression="false" break="never"></div><div> <!-- 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> --></div>
<div> <action application="set" data="bridge_pre_execute_bleg_app=limit"/><br></div><div> <action application="set" data="bridge_pre_execute_bleg_data=db ${domain_name} ${user_id} 100 !USER_BUSY"/></div>
<div><br></div><div> <action application="limit" data="db ${domain_name} ${user_id} 100 !USER_BUSY"/></div><div><br></div><div> <action application="set" data="fail_on_single_reject=USER_BUSY"/></div>
<div> <action application="bridge" data="user/${user_id}@${domain_name}"/></div><div><br></div><div> <anti-action application="log" data="INFO ${user_id}@${domain_name} is busy, not bridging call!"/></div>
<div> </condition></div></div><div><br></div><div>Now if I replace this:</div><div><br></div><div><div> <action application="set" data="bridge_pre_execute_bleg_app=limit"/></div>
<div> <action application="set" data="bridge_pre_execute_bleg_data=db ${domain_name} ${user_id} 100 !USER_BUSY"/></div></div><div><br></div><div>with that:</div><div><br></div>
<div><div> <action application="limit" data="db ${domain_name} ${user_id} 100 !USER_BUSY"/></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'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"><<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</a>></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, "Kevin Mathy" <<a href="mailto:k.mathy@hexanet.fr" target="_blank">k.mathy@hexanet.fr</a>> 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'm trying to find something on freeswitch to make a "per-user" limitation of concurrent "RINGING" calls (or more generally, calls in PROCEEDING state).</div>
<div><br></div><div>I've found the "max-proceeding" value I can set in switch.conf.xml, but it's a system's wide parameter, and I'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't get any answer : <a href="http://marc.info/?l=freeswitch-users&m=134375187528797" target="_blank">http://marc.info/?l=freeswitch-users&m=134375187528797</a></div>
<div><br></div><div>So, today, is there anything to achieve this ? Maybe something based on the "limit" 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">