[Home]

Summary:ASTERISK-26462: [patch] app_queue: While using queues with realtime, setting back to an empty context doesn't stop the exit key usage
Reporter:Leandro Dardini (ldardini)Labels:
Date Opened:2016-10-13 04:03:06Date Closed:2016-11-22 11:11:42.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Applications/app_queue
Versions:13.11.2 Frequency of
Occurrence
Related
Issues:
Environment:CentOS 6 64bit, MySQL 5.7 used with ODBCAttachments:( 0) app_queue.c.patch
Description:I am using realtime queues and they perform great. In extconfig.conf I have them configured as

queues => odbc,asterisk1,queue,1
queues => odbc,asterisk2,queue,2
queue_members => odbc,asterisk1,queue_member,1
queue_members => odbc,asterisk2,queue_member,2

If I have a queue and if I set a context name in the "context" field, when listening to MOH, pressing a DTMF key will exit to that context. If I set back the field "context" to an empty value, I can still exit the queue by pressing a DTMF key. I have tried issuing a QUEUE REFRESH command, a queue reload, even reloading the app_queue module... nothing works. Only restarting asterisk will fix the problem, correctly forbidding the user to exit the queue with a DTMF key.
If I check the database, every time a caller joins the queue, the table queue is read, but probably "internally" the context data is not updated.

After a check of the source code, I think to have identified the problem and applying a small change, fixed the issue, but I need your quality checks to confirm this.

The problem is in the app_queue.c file, in the init_queue function. It initializes a lots of variables to its default values, but not the "context" field. In this way, the context field it is never reset because empty values are skipped while loading from the database. Other fields may suffer the same problem.

--- app_queue.c~        2016-09-09 18:14:37.000000000 +0200
+++ app_queue.c 2016-10-13 09:01:31.000000000 +0200
@@ -2646,6 +2646,9 @@
       q->retry = DEFAULT_RETRY;
       q->timeout = DEFAULT_TIMEOUT;
       q->maxlen = 0;
+
+       ast_string_field_set(q, context, "");
+
       q->announcefrequency = 0;
       q->minannouncefrequency = DEFAULT_MIN_ANNOUNCE_FREQUENCY;
       q->announceholdtime = 1;
Comments:By: Asterisk Team (asteriskteam) 2016-10-13 04:03:08.813-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: Leandro Dardini (ldardini) 2016-10-13 04:04:35.105-0500

Small patch that fixes the problem

By: Rusty Newton (rnewton) 2016-10-13 12:34:12.096-0500

[~ldardini] thanks for the report and patch. Go ahead and push the patch up onto Gerrit if you would.