[asterisk-bugs] [Asterisk 0014650]: leavewhenempty=yes doesn't work as expected, operates in reverse.

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Mar 12 14:54:31 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14650 
====================================================================== 
Reported By:                alecdavis
Assigned To:                mmichelson
====================================================================== 
Project:                    Asterisk
Issue ID:                   14650
Category:                   Applications/app_queue
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 181371 
Request Review:              
====================================================================== 
Date Submitted:             2009-03-12 04:09 CDT
Last Modified:              2009-03-12 14:54 CDT
====================================================================== 
Summary:                    leavewhenempty=yes doesn't work as expected,
operates in reverse.
Description: 
With 'leavewhenempty=yes' and 'timeout=15' in queues.conf

When the last agent logs out of a queue while a call is waiting in the
queue, I'd expect the call to drop out of the queue with
QUEUESTATUS=LEAVEEMPTY after 15 seconds, but instead app_queue exits with
QUEUESTATUS=TIMEOUT after the full timeout (60 seconds as specified in the
dialplan).

App_queue only seems drop out if the queue early (15s) when
'leavewhenempty=no', also note, the agent's phone keeps ringing until the
timeout of 15s is reached.

After a reload of queue below (with small patch @line 1502 applied to show
q->leavewhenempty value), you can see that the 'value=yes' but the
'q->leavewhenempty=0'

CLI> queue reload all

[Mar 12 21:24:20] NOTICE[19248]: app_queue.c:5545 reload_queue_rules:
queuerules.conf has not changed since it was last loaded. Not taking any
action.
  == Parsing '/etc/asterisk/queues.conf':   == Found
  == Parsing '/etc/asterisk/queues/chch_queue.conf':   == Found
[Mar 12 21:24:20] WARNING[19248]: app_queue.c:1502 queue_set_param:
leavewhenempty 'chch_queue': leavewhenempty at line 202 of queues.conf
value=yes, q->leavewhenempty=0

And when 'leavewhenempty=no';

CLI> queue reload all
chch1*CLI> queue reload all
[Mar 12 21:46:06] NOTICE[19519]: app_queue.c:5545 reload_queue_rules:
queuerules.conf has not changed since it was last loaded. Not taking any
action.
  == Parsing '/etc/asterisk/queues.conf':   == Found
  == Parsing '/etc/asterisk/queues/chch_queue.conf':   == Found
[Mar 12 21:46:06] WARNING[19519]: app_queue.c:1502 queue_set_param:
leavewhenempty 'chch_queue': leavewhenempty at line 202 of queues.conf
value=no, q->leavewhenempty=35
chch1*CLI>

It seems as though
       parse_empty_options(val, &q->leavewhenempty);
is getting it wrong, but someone that know this code, better change it as
they'll better understand the impact of the change.

====================================================================== 

---------------------------------------------------------------------- 
 (0101687) alecdavis (reporter) - 2009-03-12 14:54
 http://bugs.digium.com/view.php?id=14650#c101687 
---------------------------------------------------------------------- 
To maintain backwards compatiblity for users that have noticed the problem,
and have set it backwards, could be to introduce new options for
'leavewhenempty' like 'leavewhenempty=stay' and 'leavewhenempty=leave'

'leavewhenempty=leave' would set q->leavewhenempty=35
'leavewhenempty=stay' would set q->leavewhenempty=0

Adding a new keyword, like 'staywhenempty' would add a whole load of
addiional code, including a new variable 'staywhenempty' that needed to be
checked in the same places as 'leavewhenempty'. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-12 14:54 alecdavis      Note Added: 0101687                          
======================================================================




More information about the asterisk-bugs mailing list