<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hello,</p><p class=MsoNormal>I want to restrict the number of incoming calls to my internal extensions to 1 per extension, because I don’t want to receive another call to an extension that is already in a call.</p><p class=MsoNormal>I tried setting the max_calls variable to 1 and adding this to the dialplan </p><div><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'><o:p> </o:p></span></code></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'><extension</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>name="limit_exceeded"></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'> <condition</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>field="destination_number"</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>expression="^limit_exceeded$"></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'> <action</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>application="playback"</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>data="/sounds/overthelimit.wav"/></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'> <action</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>application="hangup"/></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'> </condition></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'></extension></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> <o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'><extension</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>name="limit"</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>continue="true"></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'> <condition></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'> <!-- You can set ${max_calls} per user in directory.conf and remove the line below --></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'> <action</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>application="set"</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>data="max_calls=1"</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>inline="true"/></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'> <action</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>application="limit"</span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'> </span><code><span style='font-size:10.0pt;color:#333333'>data="db $${domain} ${sip_auth_username} ${max_calls}"/></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'> </condition></span></code><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p></o:p></span></p><p class=MsoNormal><code><span style='font-size:10.0pt;color:#333333'></extension><o:p></o:p></span></code></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;color:#333333'><o:p> </o:p></span></p></div><p class=MsoNormal>Also I tried adding this to my dialplan where the condition matches my internal extensions </p><p class=MsoNormal><action application="limit_execute" data="hash outbound carrier1 1 bridge {ignore_early_media=true}user/${dialed_extension}@${domain_name}" /></p><p class=MsoNormal> </p><p class=MsoNormal>It works if I dial normally but if I do a conference conf dial {ignore_early_media=true,conference_member_flags=moderator}user/XXX@${domain_name} it always calls even if that user is already in a call. </p><p class=MsoNormal>How can I fix this? Thank you.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Kind regards,</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Vlad Toma</p></div></body></html>