[Home]

Summary:ASTERISK-26431: Queues doesn't appear when using realtime configuration
Reporter:Marcelo Terres (mhterres)Labels:
Date Opened:2016-10-02 13:42:53Date Closed:2016-10-04 12:24:06
Priority:MajorRegression?
Status:Closed/CompleteComponents:Applications/app_queue
Versions:14.0.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Ubuntu 14.04.5 LTS \n \l Linux rtc 4.7.0-x86_64-linode72 #1 SMP Thu Aug 4 15:15:18 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux Attachments:
Description:When using queue realtime configuration, the queues doesn't appear in CLI (queue show command) until someone login in them.

And it happens even if I have online agents that are configured in queue_members table. Somebody needs to login to queue appears.

Another way to make queue appears (and in this case, all queues) is to use Action Queues in AMI.

Investigating the bug I noticed that when app_queue is loaded, it doesn't query the queues table, just the queue_members table.

[Oct  2 15:30:15] DEBUG[9309] loader.c: Registering module app_queue
[Oct  2 15:30:15] DEBUG[9309] config.c: Parsing /etc/asterisk/queuerules.conf
[Oct  2 15:30:15] VERBOSE[9309] config.c: Parsing '/etc/asterisk/queuerules.conf': Found
[Oct  2 15:30:15] DEBUG[9309] config.c: Parsing /etc/asterisk/queues.conf
[Oct  2 15:30:15] VERBOSE[9309] config.c: Parsing '/etc/asterisk/queues.conf': Found
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Found queue_name column with type 12 with len 80, octetlen 255, and numlen (0,0)
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Found interface column with type 12 with len 80, octetlen 255, and numlen (0,0)
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Found membername column with type 12 with len 80, octetlen 255, and numlen (0,0)
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Found state_interface column with type 12 with len 80, octetlen 255, and numlen (0,0)
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Found penalty column with type 4 with len 10, octetlen -1, and numlen (0,10)
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Found paused column with type 4 with len 10, octetlen -1, and numlen (0,10)
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Found uniqueid column with type 4 with len 10, octetlen -1, and numlen (0,10)
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:15] DEBUG[9309] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queue_members WHERE interface LIKE ? AND queue_name LIKE ? ORDER BY interface
[Oct  2 15:30:15] DEBUG[9309] res_config_odbc.c: Parameter 1 ('interface LIKE') = '%'
[Oct  2 15:30:15] DEBUG[9309] res_config_odbc.c: Parameter 2 ('queue_name LIKE') = '%'
[Oct  2 15:30:15] DEBUG[9309] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:15] NOTICE[9309] app_queue.c: No entries were found for ringinuse/ignorebusy in queue_members table. Using 'ringinuse'
[Oct  2 15:30:15] VERBOSE[9309] pbx_app.c: Registered application 'Queue'
[Oct  2 15:30:15] VERBOSE[9309] pbx_app.c: Registered application 'AddQueueMember'
[Oct  2 15:30:15] VERBOSE[9309] pbx_app.c: Registered application 'RemoveQueueMember'
[Oct  2 15:30:15] VERBOSE[9309] pbx_app.c: Registered application 'PauseQueueMember'
[Oct  2 15:30:15] VERBOSE[9309] pbx_app.c: Registered application 'UnpauseQueueMember'
[Oct  2 15:30:15] VERBOSE[9309] pbx_app.c: Registered application 'QueueLog'
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action Queues
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueueStatus
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueueSummary
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueueAdd
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueueRemove
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueuePause
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueueLog
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueuePenalty
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueueMemberRingInUse
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueueRule
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueueReload
[Oct  2 15:30:15] VERBOSE[9309] manager.c: Manager registered action QueueReset
[Oct  2 15:30:15] VERBOSE[9309] pbx_functions.c: Registered custom function 'QUEUE_VARIABLES'
[Oct  2 15:30:15] VERBOSE[9309] pbx_functions.c: Registered custom function 'QUEUE_EXISTS'
[Oct  2 15:30:15] VERBOSE[9309] pbx_functions.c: Registered custom function 'QUEUE_MEMBER'
[Oct  2 15:30:15] VERBOSE[9309] pbx_functions.c: Registered custom function 'QUEUE_MEMBER_COUNT'
[Oct  2 15:30:15] VERBOSE[9309] pbx_functions.c: Registered custom function 'QUEUE_MEMBER_LIST'
[Oct  2 15:30:15] VERBOSE[9309] pbx_functions.c: Registered custom function 'QUEUE_GET_CHANNEL'
[Oct  2 15:30:15] VERBOSE[9309] pbx_functions.c: Registered custom function 'QUEUE_WAITING_COUNT'
[Oct  2 15:30:15] VERBOSE[9309] pbx_functions.c: Registered custom function 'QUEUE_MEMBER_PENALTY'
[Oct  2 15:30:15] VERBOSE[9309] loader.c: Loaded app_queue.so => (True Call Queueing)


But you can see the difference when the Queues Action is called:

[Oct  2 15:30:31] DEBUG[23281] manager.c: Running action 'Queues'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queues WHERE name LIKE ? ORDER BY name
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('name LIKE') = '%'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queues WHERE name = ?
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('name') = 'reception'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queue_members WHERE interface LIKE ? AND queue_name = ? ORDER BY interface
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('interface LIKE') = '%'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 2 ('queue_name') = 'reception'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] app_queue.c: No queue_members defined in config extconfig.conf
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[13876] app_queue.c: Device 'Queue:reception_avail' changed to state '2' (In use) but we don't care because they're not a member of any queue.
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queues WHERE name = ?
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('name') = 'sales'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queue_members WHERE interface LIKE ? AND queue_name = ? ORDER BY interface
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('interface LIKE') = '%'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 2 ('queue_name') = 'sales'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] app_queue.c: No queue_members defined in config extconfig.conf
[Oct  2 15:30:31] DEBUG[13876] app_queue.c: Device 'Queue:sales_avail' changed to state '2' (In use) but we don't care because they're not a member of any queue.
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queues WHERE name = ?
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('name') = 'support'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queue_members WHERE interface LIKE ? AND queue_name = ? ORDER BY interface
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('interface LIKE') = '%'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 2 ('queue_name') = 'support'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] devicestate.c: No provider found, checking channel drivers for SIP - 1000
[Oct  2 15:30:31] DEBUG[23281] chan_sip.c: Checking device state for peer 1000
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM sippeers WHERE name = ? AND host = ?
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('name') = '1000'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 2 ('host') = 'dynamic'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM sippeers WHERE name = ?
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('name') = '1000'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[9212] threadpool.c: Increasing threadpool stasis-core's size by 1
[Oct  2 15:30:31] DEBUG[23281] chan_sip.c: Not an IPv4 nor IPv6 address, cannot get port.
[Oct  2 15:30:31] DEBUG[23281] chan_sip.c: Not an IPv4 nor IPv6 address, cannot set port.
[Oct  2 15:30:31] DEBUG[23281] chan_sip.c: Not an IPv4 nor IPv6 address, cannot get port.
[Oct  2 15:30:31] DEBUG[23281] chan_sip.c: Not an IPv4 nor IPv6 address, cannot set port.
[Oct  2 15:30:31] DEBUG[23281] chan_sip.c: -REALTIME- loading peer from database to memory. Name: 1000. Peer objects: 0
[Oct  2 15:30:31] DEBUG[23281] chan_sip.c: Destroying SIP peer 1000
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queues WHERE name = ?
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('name') = 'reception'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queue_members WHERE interface LIKE ? AND queue_name = ? ORDER BY interface
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('interface LIKE') = '%'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 2 ('queue_name') = 'reception'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] app_queue.c: No queue_members defined in config extconfig.conf
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queues WHERE name = ?
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('name') = 'support'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queue_members WHERE interface LIKE ? AND queue_name = ? ORDER BY interface
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('interface LIKE') = '%'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 2 ('queue_name') = 'support'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queues WHERE name = ?
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('name') = 'sales'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Reusing ODBC handle 0x1adbc80 from class 'asterisk'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM queue_members WHERE interface LIKE ? AND queue_name = ? ORDER BY interface
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 1 ('interface LIKE') = '%'
[Oct  2 15:30:31] DEBUG[23281] res_config_odbc.c: Parameter 2 ('queue_name') = 'sales'
[Oct  2 15:30:31] DEBUG[23281] res_odbc.c: Releasing ODBC handle 0x1adbc80 into pool
[Oct  2 15:30:31] DEBUG[23281] app_queue.c: No queue_members defined in config extconfig.conf
[Oct  2 15:30:31] DEBUG[13876] app_queue.c: Device 'Queue:support_avail' changed to state '2' (In use) but we don't care because they're not a member of any queue.
[Oct  2 15:30:31] DEBUG[13876] app_queue.c: Device 'Queue:support_pause_SIP/1000' changed to state '1' (Not in use) but we don't care because they're not a member of any queue.

Maybe the same process should be called in both occasions.
Comments:By: Asterisk Team (asteriskteam) 2016-10-02 13:42:55.223-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2016-10-04 12:24:06.896-0500

This is on purpose. When realtime is in use it's only when the queues are used that they are then retrieved. They are not completely pulled in at load time.

If you are experiencing some other problem as a result please describe it in a comment and the issue will automatically reopen.

By: Marcelo Terres (mhterres) 2016-10-05 09:59:03.804-0500

Ok, point taken.

Thanks for the explanation.



By: Asterisk Team (asteriskteam) 2016-10-05 09:59:04.129-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.

By: Marcelo Terres (mhterres) 2016-10-05 10:02:04.725-0500

Joshua explains how realtime queues work.