Summary:ASTERISK-23378: [patch]Queue with 'ringinuse=no' and members in realtime can get several calls at the same time (with patch)
Reporter:Shlomi Gutman (voicenter)Labels:
Date Opened:2014-02-26 11:10:53.000-0600Date Closed:2014-02-27 16:31:08.000-0600
Versions: 11.6.0 Frequency of
duplicatesASTERISK-16115 [patch] problem with ringinuse=no, queue members receive sometimes two calls
Environment:Debian 7 64 bit (11), Centos 5.8 (1.8) 64 bitAttachments:( 0) app_queue.c.patch
Description:We have queue with realtime config on both 1.8 and 11 (including 11.6-cert1) versions.
As well we have queue members and sip devices in realtime.

Scenario is:
Q with realtime members (local sip devices with config in realtime as well).
Set the timeout of Q to small number ( 5-10s) so it would be easier to reproduce.
Have 1 member in Q with ringinuse=no, call him and start talking to him.
Call second time and it would work as expected - in other words the agent would not have waiting call .
Now call again and run "sip reload" in CLI a lot of times(so it would be in perfect timing of sip not being reachable after sip reload and before it checks if it should call the sip) till at some point it would ring the same talking agent and you'll have waiting call.
Afaik  It would be displayed as (not in use) at some point if you run queue show $QUEUE_NAME

The solution was to add new check if agent is realtime - i would check if there is channel that device is involved with. But the tricky thing is to only check if it has channel and set to inuse and do not change status if there is no channel ( so we would not get not in use in case the sip device is unavailable)

The patch i'm applying is for 11.6-cert1 but it was copied from 1.8.23 which is now more than month in production and customers we have there told that issue was resolved.

Comments:By: Shlomi Gutman (voicenter) 2014-02-26 11:22:36.919-0600

The patched can be used, i'm waiting for approve after signing the contribution license.

By: Rusty Newton (rnewton) 2014-02-27 16:30:39.195-0600

Thanks for the report and patch. I'm going to close this out as duplicate, as it appears to duplicate ASTERISK-16115 and we don't want to spread this out over many issues.

You'll want to attach your patch to ASTERISK-16115 and ask others there to try it. It is possible that your patch doesn't cover every scenario and may not be a complete solution.

By: Shlomi Gutman (voicenter) 2014-03-02 04:18:12.696-0600

I'll comment there, but we do not have any 1.4 version of asterisk so i'm not sure if patch can be applied against those. I do have patch for 1.8 and this one is for 11.  
It might be as well other problem and not related. though patch should fix it anyway, just not sure of the cost of resources in this case.