[asterisk-users] Queues and penalties

Leon Wright lwright at corpcloud.com.au
Thu Nov 29 20:16:36 CST 2018


Paddy,

This appears to be how the queue app works. I ended up patching the queue
app:

diff --git a/apps/app_queue.c b/apps/app_queue.c
index e3a4e22..72072d0 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4571,7 +4571,7 @@ static int ring_one(struct queue_ent *qe, struct
callattempt *outgoing, int *bus
                        struct callattempt *cur;
                        /* Ring everyone who shares this best metric (for
ringall) */
                        for (cur = outgoing; cur; cur = cur->q_next) {
-                               if (cur->stillgoing && !cur->chan &&
cur->metric <= best->metric) {
+                               if (cur->stillgoing && !cur->chan &&
cur->metric >= qe->min_penalty * 1000000 && cur->metric <= qe->max_penalty
* 1000000) {
                                        ast_debug(1, "(Parallel) Trying
'%s' with metric %d\n", cur->interface, cur->metric);
                                        ret |= ring_entry(qe, cur, busies);
                                }

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.

Leon

On Thu, 29 Nov 2018 at 18:24, Paddy Grice <paddy at wizaner.com> wrote:

> Hi John
>
> 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.
>
> This is well described in the History section of the following link
> https://wiki.freepbx.org/display/PPS/lazymembers+patch+to+app_queue
>
> As I say this seems to be a real shortcoming in app_queue.
>
> Any ideas, suggestions, anyone want to work with me to sort this ?
>
> Paddy
>
>
> ------------------------------
> *From:* John Kiniston [mailto:johnkiniston at gmail.com]
> *Sent:* 28 November 2018 21:17
> *To:* paddy at wizaner.com; Asterisk Users Mailing List - Non-Commercial
> Discussion
> *Subject:* Re: [asterisk-users] Queues and penalties
>
> This should work, How are you defining your timeouts in the queues.conf ?
>
> And to verify, in your extensions.conf you are calling Queue with the
> queue name and the ruleset to apply from queuerules.conf?
>
> On Wed, Nov 28, 2018 at 12:45 PM Paddy Grice <paddy at wizaner.com> wrote:
>
>> Hi All
>>
>> I have been looking at this problem for a few days/weeks now and after
>> some advice please.
>>
>> 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
>>
>> The problem I have is the customer want a simple call distribution like
>> this
>>
>> 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.
>>
>> Seems a simple queue application to me
>>
>> 1001, 1002 and 1003 in the queue with a penalty of 1 strategy ringall
>> 2001, 2002 and 2003 in the queue with a penalty of 2 strategy ringall
>> 3001, 3002 and 3003 in the queue with a penalty of 3 strategy ringall
>>
>> and rules
>>
>> increasing the maxpenalty 1->2 after 20 seconds
>> and increasing maxpenalty 2->3 after another 20 seconds.
>>
>> But this doesn't work if users don't answer!!
>>
>> if user 1002 or (2001 etc)  just lets his phone ring - he forgot to
>> logoff or DND then the penalty is ignored.
>>
>> 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
>>
>> 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.
>>
>> This seems to be a real shortcoming in app_queue.
>>
>> Any ideas, suggestions, anyone want to work with me to sort this ?
>>
>> Paddy Grice
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Astricon is coming up October 9-11!  Signup is available at:
>> https://www.asterisk.org/community/astricon-user-conference
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
> --
> 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.
> ---Heinlein
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20181130/74da02e0/attachment.html>


More information about the asterisk-users mailing list