[Home]

Summary:ASTERISK-18416: [patch] Realtime queue agents unavailable via AMI before a call event.
Reporter:kwk (kwk)Labels:patch
Date Opened:2011-09-05 03:57:40Date Closed:2022-02-11 12:21:17.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:1.8.5.0 13.18.4 Frequency of
Occurrence
Frequent
Related
Issues:
causesASTERISK-30402 app_queue: QueuePause generates an excessively large number of database queries
Environment:RHEL 6.1 64 Bit, Queues stored realtime in MySQL via ODBC.Attachments:( 0) app_queue_qstatus.patch
Description:Hi,

I have an asterisk with realtime queues.

When I fire an AMI "queuestatus" event for my realtime queue 1650, the AMI returns no info for the queue:

{panel:title=Query AMI for Queue 1650|borderStyle=dashed| borderColor=#ccc| titleBGColor=#F7D6C1| bgColor=#FFFFCE}{color:blue}{noformat}action: queuestatus
queues: 1650

Response: Success
Message: Queue status will follow

Event: QueueStatusComplete{noformat}{color}{panel}

When I do {color:blue}{{queue show 1650}}{color} on the CLI and fire the same AMI event from before afterwards, I get the correct queue status.

{panel:title=Query CLI for Queue 1650|borderStyle=dashed| borderColor=#ccc| titleBGColor=#F7D6C1| bgColor=#FFFFCE}{color:blue}{noformat}
myhost*CLI> queue show 1650
1650 has 0 calls (max 1) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
  Members:
     SIP/1660 (realtime) (Not in use) has taken no calls yet
     SIP/1660 (realtime) (Not in use) has taken no calls yet
  No Callers
{noformat}{color}{panel}

{panel:title=Query AMI for Queue 1650 again|borderStyle=dashed| borderColor=#ccc| titleBGColor=#F7D6C1| bgColor=#FFFFCE}{color:blue}{noformat}
action: queuestatus
queues: 1650

Response: Success
Message: Queue status will follow

Event: QueueParams
Queue: 1650
Max: 1
Strategy: rrmemory
Calls: 0
Holdtime: 0
TalkTime: 0
Completed: 0
Abandoned: 0
ServiceLevel: 0
ServicelevelPerf: 0.0
Weight: 0

Event: QueueMember
Queue: 1650
Name: SIP/1660
Location: SIP/1660
Membership: static
Penalty: 0
CallsTaken: 0
LastCall: 0
Status: 1
Paused: 0

Event: QueueMember
Queue: 1650
Name: SIP/1660
Location: SIP/1660
Membership: static
Penalty: 0
CallsTaken: 0
LastCall: 0
Status: 1
Paused: 0

Event: QueueStatusComplete
{noformat}{color}{panel}

I've discussed this issue on IRC with irroot and we found out that only a *call*-event in between two AMI requests will show the logged in agents. If an agent logs in a queue between two AMI requests, the AMI request {color:blue}{{action: queuestatus \n queues: 1650}}{color} still won't return the agents.

I hope, there's a way to avoid a CLI query before the AMI produces useable answers to queue status requests. IMO it shouldn't be that the AMI reacts differently if the queues are stored in a realtime DB or statically.
Comments:By: kwk (kwk) 2011-09-05 03:59:55.941-0500

Changed environment: Added note about queue storage.

By: Gregory Hinton Nietsky (irroot) 2011-09-05 04:18:28.852-0500

There is no function in app_queue to load all the queues from realtime ill look at doing this.

By: Gregory Hinton Nietsky (irroot) 2011-09-05 05:16:01.329-0500

Hi there this is a quick and dirty patch to load the queue if it was specified it could be neatened up a bit and avoid the while loop if it is specified.

By: Leif Madsen (lmadsen) 2011-09-13 12:25:30.394-0500

Basically ya, the data isn't in memory yet, so there is nothing to query.

By: Friendly Automation (friendly-automation) 2022-02-11 12:21:18.158-0600

Change 17918 merged by Friendly Automation:
app_queue: load queues and members from Realtime when needed

[https://gerrit.asterisk.org/c/asterisk/+/17918|https://gerrit.asterisk.org/c/asterisk/+/17918]

By: Friendly Automation (friendly-automation) 2022-02-11 12:43:20.447-0600

Change 17987 merged by Friendly Automation:
app_queue: load queues and members from Realtime when needed

[https://gerrit.asterisk.org/c/asterisk/+/17987|https://gerrit.asterisk.org/c/asterisk/+/17987]

By: Friendly Automation (friendly-automation) 2022-02-11 12:44:36.252-0600

Change 17985 merged by Friendly Automation:
app_queue: load queues and members from Realtime when needed

[https://gerrit.asterisk.org/c/asterisk/+/17985|https://gerrit.asterisk.org/c/asterisk/+/17985]

By: Friendly Automation (friendly-automation) 2022-02-11 12:57:01.960-0600

Change 17986 merged by Joshua Colp:
app_queue: load queues and members from Realtime when needed

[https://gerrit.asterisk.org/c/asterisk/+/17986|https://gerrit.asterisk.org/c/asterisk/+/17986]