<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1649" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=914171309-30112018><FONT face=Arial 
color=#0000ff size=2>Thanks Leon </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=914171309-30112018><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=914171309-30112018><FONT face=Arial 
color=#0000ff size=2>I will implement and test but I knew there would be a fix 
for what I believe is a short coming in app_queue. How do I suggest this as a 
option to the base code?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=914171309-30112018><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=914171309-30112018><FONT face=Arial 
color=#0000ff size=2>Paddy</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Leon Wright 
[mailto:lwright@corpcloud.com.au] <BR><B>Sent:</B> 30 November 2018 
02:17<BR><B>To:</B> paddy@wizaner.com; 
asterisk-users@lists.digium.com<BR><B>Cc:</B> 
johnkiniston@gmail.com<BR><B>Subject:</B> Re: [asterisk-users] Queues and 
penalties<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr>
<DIV dir=ltr>Paddy,
<DIV><BR></DIV>
<DIV>This appears to be how the queue app works. I ended up patching the queue 
app:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV>diff --git a/apps/app_queue.c b/apps/app_queue.c</DIV>
<DIV>index e3a4e22..72072d0 100644</DIV>
<DIV>--- a/apps/app_queue.c</DIV>
<DIV>+++ b/apps/app_queue.c</DIV>
<DIV>@@ -4571,7 +4571,7 @@ static int ring_one(struct queue_ent *qe, struct 
callattempt *outgoing, int *bus</DIV>
<DIV>                    
    struct callattempt *cur;</DIV>
<DIV>                    
    /* Ring everyone who shares this best metric (for ringall) 
*/</DIV>
<DIV>                    
    for (cur = outgoing; cur; cur = cur->q_next) {</DIV>
<DIV>-                    
           if (cur->stillgoing && 
!cur->chan && cur->metric <= best->metric) {</DIV>
<DIV>+                    
           if (cur->stillgoing && 
!cur->chan && cur->metric >= qe->min_penalty * 1000000 
&& cur->metric <= qe->max_penalty * 1000000) {</DIV>
<DIV>                    
                    
ast_debug(1, "(Parallel) Trying '%s' with metric %d\n", cur->interface, 
cur->metric);</DIV>
<DIV>                    
                    ret |= 
ring_entry(qe, cur, busies);</DIV>
<DIV>                    
            }</DIV></DIV>
<DIV><BR></DIV>
<DIV>So the penalties get calculated during the 'ringall' strategy and allowing 
the queue app to exit, looping and raising the max penalty and calling the queue 
app again.</DIV>
<DIV><BR></DIV>
<DIV>Leon</DIV></DIV></DIV><BR>
<DIV class=gmail_quote>
<DIV dir=ltr>On Thu, 29 Nov 2018 at 18:24, Paddy Grice <<A 
href="mailto:paddy@wizaner.com">paddy@wizaner.com</A>> wrote:<BR></DIV>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><U></U>
  <DIV>
  <DIV dir=ltr align=left><SPAN 
  class=m_-1213785864519627822140261310-29112018><FONT face=Arial color=#0000ff 
  size=2>Hi John</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN 
  class=m_-1213785864519627822140261310-29112018><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN 
  class=m_-1213785864519627822140261310-29112018><FONT face=Arial color=#0000ff 
  size=2>This works fine providing extensions 1001,1002 and 1003 are "Incall" or 
  "Paused" - the problem appears to be that is a handset say 1002 is "ringing" 
  then the 2xxx then the penalty is not honoured.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN 
  class=m_-1213785864519627822140261310-29112018><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN 
  class=m_-1213785864519627822140261310-29112018><FONT face=Arial color=#0000ff 
  size=2>This is well described in the History section of the following link 
  <FONT size=2><A 
  href="https://wiki.freepbx.org/display/PPS/lazymembers+patch+to+app_queue" 
  target=_blank>https://wiki.freepbx.org/display/PPS/lazymembers+patch+to+app_queue</A></FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN 
  class=m_-1213785864519627822140261310-29112018><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN 
  class=m_-1213785864519627822140261310-29112018><FONT face=Arial><FONT 
  color=#0000ff><FONT size=2>As I say t<SPAN 
  class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>his 
  seems to be a real shortcoming in app_queue.</SPAN></FONT></FONT></FONT> 
  <DIV><SPAN 
  class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>Any 
  ideas, suggestions, anyone want to work with me to sort this 
  ?</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018><SPAN 
  class=m_-1213785864519627822140261310-29112018>Paddy</SPAN></SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018><SPAN 
  class=m_-1213785864519627822140261310-29112018></SPAN></SPAN></FONT> </DIV></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN 
  class=m_-1213785864519627822140261310-29112018><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left>
  <HR>
  </DIV>
  <DIV dir=ltr align=left><FONT face=Tahoma size=2><B>From:</B> John Kiniston 
  [mailto:<A href="mailto:johnkiniston@gmail.com" 
  target=_blank>johnkiniston@gmail.com</A>] <BR><B>Sent:</B> 28 November 2018 
  21:17<BR><B>To:</B> <A href="mailto:paddy@wizaner.com" 
  target=_blank>paddy@wizaner.com</A>; Asterisk Users Mailing List - 
  Non-Commercial Discussion<BR><B>Subject:</B> Re: [asterisk-users] Queues and 
  penalties<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV dir=ltr>
  <DIV>This should work, How are you defining your timeouts in the queues.conf ? 
  <BR><BR></DIV>And to verify, in your extensions.conf you are calling Queue 
  with the queue name and the ruleset to apply from queuerules.conf? 
  <BR></DIV><BR>
  <DIV class=gmail_quote>
  <DIV dir=ltr>On Wed, Nov 28, 2018 at 12:45 PM Paddy Grice <<A 
  href="mailto:paddy@wizaner.com" target=_blank>paddy@wizaner.com</A>> 
  wrote:<BR></DIV>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"><U></U>
    <DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>Hi 
    All </SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>I 
    have been looking at this problem for a few days/weeks now and after some 
    advice please.</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>I 
    currently have a customer on 11.25.3 and I am in the process of upgrading 
    versions and OS (Debian) and all things that involves mysql -> PDO 
    etc</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>The 
    problem I have is the customer want a simple call distribution like 
    this</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>Extn 
    1001, 1002, 1003 to be called on an incoming call - if they don't answer 
    after 20 seconds then 2001, 2002, 2003 to be added to the ringing extensions 
    and if no one answers after another 20 seconds the add in 3001, 3002, 
    3003.</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>Seems 
    a simple queue application to me</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>1001, 
    1002 and 1003 in the queue with a penalty of 1 strategy 
    ringall</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>2001, 
    2002 and 2003 in the queue with a penalty of 2 strategy 
    ringall</SPAN></FONT></DIV></SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>3001, 
    3002 and 3003 in the queue with a penalty of 3 strategy 
    ringall</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>and 
    rules </SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>increasing 
    the maxpenalty 1->2 after 20 seconds</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>and 
    increasing maxpenalty 2->3 after another 20 seconds.</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>But 
    this doesn't work if users don't answer!!</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>if 
    user 1002 or (2001 etc)  just lets his phone ring - he forgot to logoff 
    or DND then the penalty is ignored.</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>There 
    seems to have been a patch for FreePBX on V13 - LazyMembers - but that is 
    all I can find and later versions have no mention of this 
    </SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>I 
    guess I can use autopause and some AMI / Script but this stops phones 
    ringing because of the timeout so the user has a ringing phone and then it 
    stops and then it starts again whereas the penalty just adds handsets into 
    the ringing group.</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>This 
    seems to be a real shortcoming in app_queue.</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>Any 
    ideas, suggestions, anyone want to work with me to sort this 
    ?</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018>Paddy 
    Grice</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT></DIV></SPAN></FONT><FONT 
    face=Arial size=2></FONT> </DIV></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=m_-1213785864519627822gmail-m_-1820171214829832071073072019-28112018></SPAN></FONT> </DIV>-- 
    <BR>_____________________________________________________________________<BR>-- 
    Bandwidth and Colocation Provided by <A href="http://www.api-digital.com" 
    target=_blank rel=noreferrer>http://www.api-digital.com</A> 
    --<BR><BR>Astricon is coming up October 9-11!  Signup is available at: 
    <A href="https://www.asterisk.org/community/astricon-user-conference" 
    target=_blank 
    rel=noreferrer>https://www.asterisk.org/community/astricon-user-conference</A><BR><BR>Check 
    out the new Asterisk community forum at: <A 
    href="https://community.asterisk.org/" target=_blank 
    rel=noreferrer>https://community.asterisk.org/</A><BR><BR>New to Asterisk? 
    Start here:<BR>      <A 
    href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" 
    target=_blank 
    rel=noreferrer>https://wiki.asterisk.org/wiki/display/AST/Getting+Started</A><BR><BR>asterisk-users 
    mailing list<BR>To UNSUBSCRIBE or update options visit:<BR>   <A 
    href="http://lists.digium.com/mailman/listinfo/asterisk-users" target=_blank 
    rel=noreferrer>http://lists.digium.com/mailman/listinfo/asterisk-users</A></BLOCKQUOTE></DIV><BR 
  clear=all><BR>-- <BR>
  <DIV class=m_-1213785864519627822gmail_signature dir=ltr>A human being should 
  be able to change a diaper, plan an invasion, butcher a hog, conn a ship, 
  design a building, write a sonnet, balance accounts, build a wall, set a bone, 
  comfort the dying, take orders, give orders, cooperate, act alone, solve 
  equations, analyze a new problem, pitch manure, program a computer, cook a 
  tasty meal, fight efficiently, die gallantly. Specialization is for 
  insects.<BR>---Heinlein</DIV></DIV>-- 
  <BR>_____________________________________________________________________<BR>-- 
  Bandwidth and Colocation Provided by <A href="http://www.api-digital.com" 
  target=_blank rel=noreferrer>http://www.api-digital.com</A> --<BR><BR>Check 
  out the new Asterisk community forum at: <A 
  href="https://community.asterisk.org/" target=_blank 
  rel=noreferrer>https://community.asterisk.org/</A><BR><BR>New to Asterisk? 
  Start here:<BR>      <A 
  href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" 
  target=_blank 
  rel=noreferrer>https://wiki.asterisk.org/wiki/display/AST/Getting+Started</A><BR><BR>asterisk-users 
  mailing list<BR>To UNSUBSCRIBE or update options visit:<BR>   <A 
  href="http://lists.digium.com/mailman/listinfo/asterisk-users" target=_blank 
  rel=noreferrer>http://lists.digium.com/mailman/listinfo/asterisk-users</A></BLOCKQUOTE></DIV></BODY></HTML>