<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style>BODY{font:10pt Tahoma, Verdana, sans-serif}</style></head><body>
<DIV>Change that to "execute_on_originate". On answer will blow the call off if it's over limits when the user answers.</DIV>
<DIV>&nbsp;</DIV>
<DIV>--Dave</DIV><BR>
<BLOCKQUOTE style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<HR>
<B>From:</B> Michael Collins [mailto:msc@freeswitch.org]<BR><B>To:</B> FreeSWITCH Users Help [mailto:freeswitch-users@lists.freeswitch.org]<BR><B>Sent:</B> Sun, 03 Jun 2012 13:54:08 -0700<BR><B>Subject:</B> Re: [Freeswitch-users] limit app problem with loopback channels<BR><BR>You can solve this issue by avoiding loopback. Don't use loopback unless there is absolutely no other alternative. Try replacing the loopback calls in the group definition to "user/xxx" instead:<BR><BR>&nbsp;&nbsp; &lt;extension name="group_dial_sales"&gt;<BR>&nbsp; &nbsp; &nbsp;&lt;condition field="destination_number" expression="^2000$"&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="bridge"<BR>data="[execute_on_answer='limit hash callwaiting 1000 1']user/1000, [execute_on_answer='limit hash callwaiting<BR>1001 1']user/1001"/&gt;<BR>&nbsp; &nbsp;&nbsp; &lt;/condition&gt;<BR>&nbsp;&nbsp; &lt;/extension&gt;<BR>
<DIV>&nbsp;</DIV>This is just off the top of my head, so please do the usual testing and tinkering before you report back that it does not work. :)<BR><BR>-MC<BR><BR>
<DIV class=gmail_quote>On Sun, Jun 3, 2012 at 8:47 AM, Jose Fco. Irles DurĂ¡ <SPAN>&lt;<A href="mailto:josefu@gmail.com">josefu@gmail.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>Hello,<BR><BR>I'm trying to limit calls to one user with limit application, all<BR>works fine when a user dials to the number user (the caller is<BR>transfered to limit_exceeded extension)<BR><BR>But when a caller dials to the 2000 extensions (a "ring group" to<BR>loopback channels) and one of the users (for example 1001) answer the<BR>call, the limit app removes the limit count for this channel when the<BR>loopback channel disappears (when the direct bridge occurs between the<BR>caller channel and callee channel).<BR><BR>Where is the problem? How can I avoid that the limit app removes the<BR>limit for this loopback channel?<BR><BR>There is the fragmet of my dialplan (is the vainilla dialplan from git<BR>with the limit action added)<BR>&lt;context name="default"&gt;<BR>...<BR>&nbsp;&lt;extension name="Local_Extension"&gt;<BR>&nbsp; &nbsp; &nbsp;&lt;condition field="destination_number" expression="^(10[01][0-9])$"&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="export" data="dialed_extension=$1"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="set" data="ringback=${us-ring}"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="set" data="transfer_ringback=$${hold_music}"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="set" data="call_timeout=30"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="set" data="hangup_after_bridge=true"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="set" data="continue_on_fail=true"/&gt;<BR>&nbsp; &nbsp; &nbsp; &lt;action application="limit" data="hash callwaiting<BR>${dialed_extension} 1"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="bridge"<BR>data="user/${dialed_extension}@${domain_name}"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="answer"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="sleep" data="1000"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="bridge"<BR>data="loopback/app=voicemail:default ${domain_name}<BR>${dialed_extension}"/&gt;<BR>&nbsp; &nbsp; &nbsp;&lt;/condition&gt;<BR>&nbsp; &nbsp;&lt;/extension&gt;<BR><BR>&nbsp; &nbsp;&lt;extension name="group_dial_sales"&gt;<BR>&nbsp; &nbsp; &nbsp;&lt;condition field="destination_number" expression="^2000$"&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;action application="bridge"<BR>data="loopback/1000/default,loopback/1001/default"/&gt;<BR>&nbsp; &nbsp; &nbsp;&lt;/condition&gt;<BR>&nbsp; &nbsp;&lt;/extension&gt;<BR><BR>...<BR>&lt;/context&gt;<BR><BR>--<BR>Jose Fco. Irles DurĂ¡<BR><BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE>
<STYLE>
</STYLE>

<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></body></html>