Summary:ASTERISK-06860: [patch] Queue(somequeue,,,,) -> interpreted as Queue(somequeue,,,,0)
Reporter:Nathan Stocks (nathan)Labels:
Date Opened:2006-04-27 13:08:51Date Closed:2006-04-27 14:11:55
Versions:Frequency of
Environment:Attachments:( 0) queue_empty_timeout_fix.txt
( 1) queue_empty_timeout_fix2.txt
Description:queue_exec() interprets the presence of a timeout field as a timeout, even if no timeout is provided.  The blank timeout is run through atoi(), which apparently returns 0.

The attached patch adds detection of an empty string, causes it to be properly treated as the absence of a timeout option.

****** STEPS TO REPRODUCE ******

In queues.conf, create a queue named 'test' with only Agents as members of the queue, and set joinempty=no.

Don't log any agents into the queue.

Attempt Queue(test) and notice that it lets you onto the queue (CORRECT)
Attempt Queue(test,,,,) and notice that it immediately times you out of the Queue (BUG).


This bug doesn't appear to exist in the trunk.

According to the docs, joinempty=no should let a caller join a queue as long as members are assigned to it, even if the members are all Agents which are not logged on.
Comments:By: Jared Smith (jsmith) 2006-04-27 13:12:15

I've verified that the bug does indeed exist in the 1.2 branch, and that the patch fixes the problem.

I've also verified that this problem doesn't exist in 1.4, due to the argument parsing macros.

By: Russell Bryant (russell) 2006-04-27 13:18:12

the standard way of doing this check is ...

if (!ast_strlen_zero(queuetimeoutstr))

By: Jared Smith (jsmith) 2006-04-27 13:23:03

I've uploaded a patch which uses ast_strlen_zero().

By: Joshua C. Colp (jcolp) 2006-04-27 14:11:55

Fixed in 1.2 revision 22954.