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

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Mar 13 16:36:55 CDT 2009


The following issue is now READY FOR TESTING. 
====================================================================== 
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:                     ready for testing
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-13 16:36 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.

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

---------------------------------------------------------------------- 
 (0101765) mmichelson (administrator) - 2009-03-13 16:36
 http://bugs.digium.com/view.php?id=14650#c101765 
---------------------------------------------------------------------- 
I've uploaded a patch for testing. Let me know how it goes. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-13 16:36 mmichelson     Note Added: 0101765                          
2009-03-13 16:36 mmichelson     Status                   assigned => ready for
testing
======================================================================




More information about the asterisk-bugs mailing list