<html>
<head>
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
span.EmailStyle17
        {font-family:"Calibri",sans-serif;
        color:#1F497D}
span.EmailStyle18
        {font-family:"Calibri",sans-serif;
        color:#1F497D}
.MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.WordSection1
        {}
-->
</style>


</head>
<body>
<div style="color: black;">
<div style="color: black;">
<p style="margin: 0 0 1em 0; color: black;">Hi,</p>
<p style="margin: 0 0 1em 0; color: black;">Recently we had a similar issue
with limit and as you know it doesn't work across dialplan so we started
using hash where we increment a counter for the caller and callee and once
they hang up we decrement it and in transfer situation we call the attended
transfer extension in features dialplan where we take the input of the
extension to be transferred to then we call execute extension to parse the
features dialplan again and then we increment the counter for the callee
where call is to be transferred.</p>
<p style="margin: 0 0 1em 0; color: black;">This way the counter for all
parties is incremented properly and we use api hangup hook to decrement the
hash value in the bridge statement so when that party hangs up the counter
is automatically decremented.</p>
</div>
<div style="color: black;">
<p
style="color: black; font-size: 10pt; font-family: Arial, sans-serif; margin: 10pt 0;">On
July 4, 2017 11:11:43 PM Shaun Stokes
<shaun.stokes@itec-support.co.uk> wrote:</p>
<blockquote type="cite" class="gmail_quote"
style="margin: 0 0 0 0.75ex; border-left: 1px solid #808080; padding-left: 0.75ex;">
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">During
testing I’ve come across another way for the limit to apply on B leg
with-out transferring the call out of the LUA script.</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">We
simply execute this line before the bridge:</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">session:execute("export","nolocal:execute_on_pre_answer=limit
hash "..domain_name.."_bleg "..extension.."
"..limit_max.." "..limit_destination);</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">This
results in the limit being applied on B leg before the call is
answered.</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">We
continue to apply a separate limit on A leg as before, the above is be used
as an additional measure to limit B leg in the event that extensions use
features
 such as attended transfer to exceed their available channels.</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<div>
<div
style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US"
style="font-size:11.0pt; font-family:"Calibri",sans-serif">From:</span></b><span
lang="EN-US"
style="font-size:11.0pt; font-family:"Calibri",sans-serif"> Shaun
Stokes
<br>
<b>Sent:</b> 30 June 2017 16:23<br>
<b>To:</b> 'FreeSWITCH Users Help'
<freeswitch-users@lists.freeswitch.org><br>
<b>Subject:</b> RE: [Freeswitch-users] Limit</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">I
should also point out, the extensions are transferring to external PSTN
numbers not local to FreeSWITCH.</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">I’ll
give this a try and will provide feedback, we’ll need a new dialplan to
bridge the gateway.</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">Thanks,</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">Shaun</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="MsoNormal"><b><span lang="EN-US"
style="font-size:11.0pt; font-family:"Calibri",sans-serif">From:</span></b><span
lang="EN-US"
style="font-size:11.0pt; font-family:"Calibri",sans-serif">
FreeSWITCH-users [<a
href="mailto:freeswitch-users-bounces@lists.freeswitch.org">mailto:freeswitch-users-bounces@lists.freeswitch.org</a>]
<b>On Behalf Of </b>Luis Daniel Lucio Quiroz<br>
<b>Sent:</b> 30 June 2017 12:45<br>
<b>To:</b> FreeSWITCH Users Help <<a
href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>><br>
<b>Subject:</b> Re: [Freeswitch-users] Limit</span></p>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">In your script, do a transfer instead a bridge. Let
the dialplan deal with the bridge</p>
</div>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">Le 30 juin 2017 7:05 AM, "Shaun Stokes"
<<a
href="mailto:shaun.stokes@itec-support.co.uk">shaun.stokes@itec-support.co.uk</a>>
a écrit :</p>
<blockquote
style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0cm 0cm 0cm 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0cm; margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="">Hi All,</p>
<p class="MsoNormal" style=""> </p>
<p class="MsoNormal" style="">In our environment we restrict the number of
current channels (using limit) per extension, however using attended
transfer allows extensions to exceed the limit since leg a ends once the
transfer completes which resets the limit
 to 0.</p>
<p class="MsoNormal" style=""> </p>
<p class="MsoNormal" style="">I believe the solution is to apply the limit
on leg b, however leg b is initiated via a bridge (with-in our outbound LUA
script).</p>
<p class="MsoNormal" style=""> </p>
<p class="MsoNormal" style="">How can we apply the limit to leg b, or is
there a better solution?</p>
<p class="MsoNormal" style=""> </p>
<p class="MsoNormal" style="">Thanks,</p>
<p class="MsoNormal" style="">Shaun</p>
</div>
<table class="MsoNormalTable" border="0" cellspacing="3" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><img border="0" id="_x0000_i1025"
src="http://www.itec-support.co.uk/wp-content/uploads/2016/07/email_logo.jpg"></p>
</td>
<td valign="top" style="padding:.75pt .75pt .75pt .75pt">
<div>
<p class="MsoNormal">Shaun Stokes - Infrastructure Analyst</p>
</div>
<div>
<table class="MsoNormalTable" border="0" cellspacing="3" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">T : </p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">01453 700713</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">E : </p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><a
href="mailto:shaun.stokes@itec-support.co.uk">shaun.stokes@itec-support.co.uk</a></p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">W : </p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><a
href="http://www.itec-support.co.uk">www.itec-support.co.uk</a></p>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
<div>
<p class="MsoNormal">Registered Address :- ITEC Support, Suite 2 Prospect
House, Bath Road, Stroud, Gloucestershire GL5 3QF
<br>
Company No. 06908001 </p>
</div>
<div>
<p class="MsoNormal"><br>
CONFIDENTIALITY NOTICE <br>
This communication and the information it contains are intended for the
person or organisation to which it is addressed. Its contents are
confidential and may be protected in law. Unauthorised use, copying or
disclosure of any of it may be unlawful. If you
 are not the intended recipient, please contact us immediately. <br>
The contents of any attachments in this e-mail may contain software
viruses, which could damage your own computer system. While ITEC Support
has taken every reasonable precaution to minimise this risk, we cannot
accept liability for any damage which you sustain
 as a result of software viruses. You should carry out your own virus
checking procedure before opening any attachment.
</p>
</div>
<p class="MsoNormal"><br>
______________________________________________________________________<br>
This message has been checked for all known viruses by MessageLabs Virus
Scanning Service.<br>
______________________________________________________________________</p>
</div>
<p class="MsoNormal"><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>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org"
target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org"
target="_blank">http://confluence.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></p>
</blockquote>
</div>
</div>
<p class="MsoNormal"><br>
______________________________________________________________________<br>
This message has been checked for all known viruses by MessageLabs Virus
Scanning Service.<br>
______________________________________________________________________</p>
</div>
<table>
<tbody>
<tr>
<td><img
src="http://www.itec-support.co.uk/wp-content/uploads/2016/07/email_logo.jpg"></td>
<td valign="top">
<div><a style="font-family:calibri; color:#1B3E94; font-size:11pt">Shaun
Stokes - Infrastructure Analyst</a></div>
<div>
<table>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td><a style="font-family:calibri; color:#1B3E94; font-size:11pt">T : </a></td>
<td><a style="font-family:calibri; color:#1B3E94; font-size:11pt">01453
700713</a></td>
</tr>
<tr>
<td><a style="font-family:calibri; color:#1B3E94; font-size:11pt">E : </a></td>
<td><a
style="font-family:calibri; color:#1B3E94; font-size:11pt">shaun.stokes@itec-support.co.uk</a></td>
</tr>
<tr>
<td><a style="font-family:calibri; color:#1B3E94; font-size:11pt">W : </a></td>
<td><a
style="font-family:calibri; color:#1B3E94; font-size:11pt">www.itec-support.co.uk</a></td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
<div><a
style="font-family:calibri; color:#1B3E94; font-size:11pt">Registered
Address :- ITEC Support, Suite 2 Prospect House, Bath Road, Stroud,
Gloucestershire GL5 3QF</a>
<br>
<a style="font-family:calibri; color:#1B3E94; font-size:11pt">Company No.
06908001</a>
</div>
<div><br>
<a style="font-family:calibri; color:Grey; font-size:11pt">CONFIDENTIALITY
NOTICE</a>
<br>
<a style="font-family:calibri; color:Grey; font-size:11pt">This
communication and the information it contains are intended for the person
or organisation to which it is addressed. Its contents are confidential and
may be protected in law. Unauthorised use,
 copying or disclosure of any of it may be unlawful. If you are not the
intended recipient, please contact us immediately.</a>
<br>
<a style="font-family:calibri; color:Grey; font-size:11pt">The contents of
any attachments in this e-mail may contain software viruses, which could
damage your own computer system. While ITEC Support has taken every
reasonable precaution to minimise this risk,
 we cannot accept liability for any damage which you sustain as a result of
software viruses. You should carry out your own virus checking procedure
before opening any attachment.</a>
</div>
<br clear="both">
______________________________________________________________________<BR>
This message has been checked for all known viruses by  MessageLabs Virus
Scanning Service.<BR>
______________________________________________________________________<BR>

_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a class="aqm-autolink aqm-autowrap"
href="mailto:consulting%40freeswitch.org">consulting@freeswitch.org</a><br>
<a class="aqm-autolink aqm-autowrap"
href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a class="aqm-autolink aqm-autowrap"
href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>
<a class="aqm-autolink aqm-autowrap"
href="http://confluence.freeswitch.org">http://confluence.freeswitch.org</a><br>
<a class="aqm-autolink aqm-autowrap"
href="http://www.cluecon.com">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a class="aqm-autolink aqm-autowrap"
href="mailto:FreeSWITCH-users%40lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a class="aqm-autolink aqm-autowrap"
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a class="aqm-autolink aqm-autowrap"
href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a class="aqm-autolink aqm-autowrap"
href="http://www.freeswitch.org">http://www.freeswitch.org</a></blockquote>
</div>
</div>
</body>
</html>