[asterisk-bugs] [JIRA] (ASTERISK-28354) app_queue: Call to Unavailable member when ringinuse=yes and another member is available

Ivan Poddubny (JIRA) noreply at issues.asterisk.org
Mon Feb 8 14:51:59 CST 2021


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=253734#comment-253734 ] 

Ivan Poddubny commented on ASTERISK-28354:
------------------------------------------

Hi Igor. The issue remains open, which means the bug is acknowledged, simply no one has time to work on it.

I have looked at the code, my conclusions are below.

Every call executing the Queue application goes through 2 stages:
- waiting for a turn,
- calling queue members.

In the first stage, the call is caught in a loop in queue_exec -> wait_our_turn.
wait_our_turn calls is_our_turn on every iteration of its loop.
is_our_turn uses num_available_members to find how many members are available.
Finally, num_available_members uses is_member_available to determine if a member is available or not.
is_member_available considers "invalid" and "unavailable" as "not available" regardless of ringinuse value (and it makes sense).
When is_our_turn gets 0 from num_available_members, it concludes that it's not "our turn", and the call stays in wait_our_turn for another iteration.

A call to a queue where all members are unavailable never leaves the stage 1.
When at least 1 member is available, the call is proceeding to the stage 2, that calls try_calling in a loop.

The interesting call chain here is try_calling -> ring_one -> ring_entry -> can_ring_entry.
When ringinuse is NOT set, can_ring_entry selects only those members whose status is "not in use" or "unknown".
But when ringinuse IS set, members' statuses are completely ignored, and that's why calls are made to "unavailable" members too.
can_ring_entry / member_status_available should use the same logic as is_member_available (at the stage 1).
Ideally, there should be only one function used at both stages.

So, it shouldn't be hard to fix. I might try later when I have time, if nobody submits a fix before.

> app_queue: Call to Unavailable member when ringinuse=yes and another member is available
> ----------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-28354
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28354
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_queue
>    Affects Versions: 13.26.0, 16.2.0
>         Environment: Asterisk 16.2.0
> PJSIP
> CentOS 7
>            Reporter: Vyrva Igor
>            Assignee: Unassigned
>            Severity: Major
>              Labels: pjsip
>
> If the Queue parameters are set to ringinuse=yes, then the call occurs including on the Members with the status "unavailable". 
> This leads to Errors in the CLI / logs with the content that these Membranes have the wrong contact
> For example:
> queue.conf:
> {noformat}
> [test]
> ringinuse=yes
> member => PJSIP/666,1,Test User
> {noformat}
> test extenion
> {noformat}
> exten => *666,1,NoOp(Test call)
>  same => n,Queue(test,ct,,,15)
>  same => n,NoOp(${QUEUESTATUS})
>  same => n,Hangup()
> {noformat}
> queue show test
> {noformat}
> test has 0 calls (max unlimited) in 'ringall' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0%, SL2:0.0% within 0s
>    Members: 
>       PJSIP/115 with penalty 1 (ringinuse enabled) (dynamic) (Not in use) has taken no calls yet
>       Test User (PJSIP/666) with penalty 1 (ringinuse enabled) (Unavailable) has taken no calls yet
>    No Callers
> {noformat}
> Call
> {noformat}
>    -- Executing [*666 at local:1] NoOp("PJSIP/423-00000000", "Test call") in new stack
>     -- Executing [*666 at local:2] Queue("PJSIP/423-00000000", "test,ct,,,15") in new stack
>     -- Started music on hold, class 'default', on channel 'PJSIP/423-00000000'
> [2019-03-27 14:50:52] ERROR[24233]: res_pjsip.c:3500 ast_sip_create_dialog_uac: Endpoint '666': Could not create dialog to invalid URI '666'.  Is endpoint registered and reachable?
> [2019-03-27 14:50:52] ERROR[24233]: chan_pjsip.c:2498 request: Failed to create outgoing session to endpoint '666'
>     -- Called PJSIP/115
> {noformat}
> However, if all Members in the Queue are not available, the call is not assigned.
> queue show test
> {noformat}
> test has 0 calls (max unlimited) in 'ringall' strategy (0s holdtime, 0s talktime), W:0, C:0, A:1, SL:0.0%, SL2:0.0% within 0s
>    Members: 
>       PJSIP/115 with penalty 1 (ringinuse enabled) (dynamic) (Unavailable) has taken no calls yet
>       Test User (PJSIP/666) with penalty 1 (ringinuse enabled) (Unavailable) has taken no calls yet
>    No Callers
> {noformat}
> Call:
> {noformat}
>     -- Executing [*666 at local:1] NoOp("PJSIP/423-00000002", "Test call") in new stack
>     -- Executing [*666 at local:2] Queue("PJSIP/423-00000002", "test,ct,,,15") in new stack
>     -- Started music on hold, class 'default', on channel 'PJSIP/423-00000002'
>     -- Stopped music on hold on PJSIP/423-00000002
>     -- Executing [*666 at local:3] NoOp("PJSIP/423-00000002", "TIMEOUT") in new stack
>     -- Executing [*666 at local:4] Hangup("PJSIP/423-00000002", "") in new stack
> {noformat}
> In queue_log:
> {noformat}
> '2019-03-27 14:50:52.942106', '1553687452.0', 'test', 'NONE', 'ENTERQUEUE', NULL, '', '423', '1', '', ''
> '2019-03-27 14:50:58.066067', '1553687452.0', 'test', 'PJSIP/115', 'RINGCANCELED', NULL, '5121', '', '', '', ''
> '2019-03-27 14:50:58.067558', '1553687452.0', 'test', 'NONE', 'ABANDON', NULL, '1', '1', '6', '', ''
> '2019-03-27 15:02:53.852089', '1553688173.2', 'test', 'NONE', 'ENTERQUEUE', NULL, '', '423', '1', '', ''
> '2019-03-27 15:03:08.867865', '1553688173.2', 'test', 'NONE', 'EXITWITHTIMEOUT', NULL, '1', '1', '15', '', ''
> {noformat}
> Although in normal operation we need to only call on those Members that have a status other than "unavailable."
> If you remove ringinuse=yes then the call to the Members with the status "unavailable" is not made. But at the same time the call of Members with the status "in use" is also not made.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list