This issue has already been reported in other versions; I myself had already reported it in version 16 here, and it seems that it has not yet been fixed in version 20 or I am not knowing how to configure it.
I am creating the queues using realtime with PostgreSQL database.
I am defining the order in which extensions should be called based on the uniqueid column of the queue_members table. However, regardless of the order I specify or the order in which I perform the INSERT operations, Asterisk always sorts based on the interface column:
CLI> queue show
demo has 0 calls (max unlimited) in 'linear' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0%, SL2:0.0% within 0s
Members:
PJSIP/2000 (ringinuse disabled) (realtime) (Invalid) has taken no calls yet (login was 1191 secs ago)
PJSIP/4000 (ringinuse disabled) (realtime) (Invalid) has taken no calls yet (login was 1191 secs ago)
PJSIP/4001 (ringinuse disabled) (realtime) (Invalid) has taken no calls yet (login was 1191 secs ago)
No Callers
I am using the Debian 13 operating system, PostgreSQL 13.11, and Asterisk 20.1.0.
Please, could someone inform me if I am doing something wrong or if it is still pending correction by the Asterisk developers?
The issue tracker mentions that it affects version 16.
Should I create a new one stating that version 20 is affected, considering that version 16 no longer receives updates due to being in Security Fix Only mode?
Another reason is that there is a message on the JIRA page:
Thank you for the honest feedback. I have reported the bug there. We have been using Asterisk with a database since version 1.6, and we have been gradually migrating to realtime since version 13. This seems to be the only option that is still not working correctly in the queues.
I tested your suggestion and it worked partially.
It respects the value defined in penalty and starts calling the member with the lowest penalty.
However, it only calls this member without calling the others.
SELECT name, musiconhold, timeout, ringinuse, retry, strategy FROM public.queues;
name | musiconhold | timeout | ringinuse | retry | strategy
------+-------------+---------+-----------+-------+----------
demo | default | 12 | no | 2 | linear
demo has 0 calls (max unlimited) in 'linear' strategy (19s holdtime, 1s talktime), W:0, C:9, A:3, SL:0.0%, SL2:0.0% within 0s
Members:
PJSIP/2000 with penalty 3 (ringinuse disabled) (realtime) (Not in use) has taken 3 calls (last was 4787 secs ago) (login was 5875 secs ago)
PJSIP/4000 with penalty 2 (ringinuse disabled) (realtime) (Not in use) has taken no calls yet (login was 5875 secs ago)
PJSIP/4001 with penalty 1 (ringinuse disabled) (realtime) (Not in use) has taken 6 calls (last was 290 secs ago) (login was 5875 secs ago)
No Callers
In the test, it keeps calling only extension 4001 instead of switching to the others when it reaches the ring limit defined in the timeout.
[2023-06-29 09:45:46] -- Executing [1000@sandbox:1] Answer("Console/default", "") in new stack
[2023-06-29 09:45:46] --- <("<) --- Call from Console has been Answered --- (>")> ---
[2023-06-29 09:45:47] -- Executing [1000@sandbox:2] Queue("Console/default", "demo") in new stack
[2023-06-29 09:45:47] -- Started music on hold, class 'default', on channel 'Console/default'
[2023-06-29 09:45:47] -- Called PJSIP/4001
[2023-06-29 09:45:47] == Using SIP RTP Audio TOS bits 184
[2023-06-29 09:45:47] WARNING[769901][C-0000000c]: chan_console.c:651 console_indicate: Don't know how to display condition 22 on Console/default
[2023-06-29 09:45:47] -- PJSIP/4001-00000015 is ringing
[2023-06-29 09:45:47] == Manager 'asterisk' logged on from 127.0.0.1
[2023-06-29 09:45:59] -- Nobody picked up in 12000 ms
[2023-06-29 09:46:01] -- Called PJSIP/4001
[2023-06-29 09:46:01] == Using SIP RTP Audio TOS bits 184
[2023-06-29 09:46:01] -- PJSIP/4001-00000016 is ringing
[2023-06-29 09:46:13] -- Nobody picked up in 12000 ms
[2023-06-29 09:46:15] -- Called PJSIP/4001
[2023-06-29 09:46:15] == Using SIP RTP Audio TOS bits 184
[2023-06-29 09:46:15] -- PJSIP/4001-00000017 is ringing
[2023-06-29 09:46:27] -- Nobody picked up in 12000 ms
[2023-06-29 09:46:29] -- Called PJSIP/4001
[2023-06-29 09:46:29] == Using SIP RTP Audio TOS bits 184
[2023-06-29 09:46:29] -- PJSIP/4001-00000018 is ringing
bruce*CLI> console hangup
[2023-06-29 09:46:33] -- Stopped music on hold on Console/default
[2023-06-29 09:46:33] == Spawn extension (sandbox, 1000, 2) exited non-zero on 'Console/default'
[2023-06-29 09:46:33] --- <("<) --- Hangup on Console --- (>")> ---
autopauseyes, no, all Enables/disables the automatic pausing of members who fail to answer a call. A value of all causes this member to be paused in all queues she is a member of.
In this case, your suggestion will not solve the problem because I need it to ring the next extension if the current one doesn’t answer, and once it finishes ringing the last extension, it should go back to ringing the first one. The way it was suggested, if the call completes a cycle, it will not ring any other agent until they return to the queue or remove the pause from their extension.
@meightee
Thank you for the suggestions, I already use failover in some circumstances. However, in this case, besides losing the queue statistics, I would have to do a workaround to reach the desired flow, creating loops and counters along the way.