[Home]

Summary:ASTERISK-13734: leavewhenempty=yes doesn't work as expected, operates in reverse.
Reporter:Alec Davis (alecdavis)Labels:
Date Opened:2009-03-12 04:09:38Date Closed:2009-04-23 12:47:18
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_queue
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 14650.patch
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.


****** ADDITIONAL INFORMATION ******

debug patch in queue_set_param line 1502 to print leavewhenempty value on queue reload.

       } else if (!strcasecmp(param, "leavewhenempty")) {
               parse_empty_options(val, &q->leavewhenempty);
               ast_log(LOG_WARNING, "leavewhenempty '%s': %s at line %d of queues.conf value=%s, q->leavewhenempty=%d \n",
                       q->name, param, linenum, val, q->leavewhenempty);

********************************************************************************
dialplan code:
********************************************************************************;Incoming calls to queue 1
exten => 8301,1,Answer()
exten => 8301,n,Wait(1)
exten => 8301,n,Queue(chch_queue,hH,,,60)
exten => 8301,n,NoOp(QUEUE1STATUS=${QUEUESTATUS})
exten => 8301,n,Hangup()

********************************************************************************
console output below with 'leavewhenempty=no', operates asif 'yes' was set.
********************************************************************************
chch1*CLI> console dial 8301
[Mar 12 21:56:54] WARNING[19519]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:56:54] NOTICE[19519]: console_video.c:133 console_video_start: voice only, console video support not present
   -- Executing [8301@default:1] Answer("Console/dsp", "") in new stack
<< Console call has been answered >>
   -- Executing [8301@default:2] Wait("Console/dsp", "1") in new stack
   -- Executing [8301@default:3] Queue("Console/dsp", "chch_queue,hH,,,60") in new stack
   -- Started music on hold, class 'default', on Console/dsp
 == Using SIP RTP CoS mark 5
[Mar 12 21:56:56] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- SIP/GXP3010-083e5318 is ringing
[Mar 12 21:56:57] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:56:58] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory

*******************************START OF AGENT LOGOUT**************************  == Using SIP RTP CoS mark 5
   -- Executing [8301GXP3010@trusted:1] Macro("SIP/GXP3010-083f2d58", "custom-agent-inout,chch_queue") in new stack
   -- Executing [s@macro-custom-agent-inout:1] MYSQL("SIP/GXP3010-083f2d58", "Connect connid localhost asterisk xxxxxxxxxx xxxxxxxxxxxxxxx") in new stack
   -- Executing [s@macro-custom-agent-inout:2] MYSQL("SIP/GXP3010-083f2d58", "Query resultid 1 SELECT channel, extension, name FROM pbx WHERE cid_num='GXP3010'") in new stack
   -- Executing [s@macro-custom-agent-inout:3] MYSQL("SIP/GXP3010-083f2d58", "Fetch fetchid 2 channelpath CALLBACKNUM callername") in new stack
   -- Executing [s@macro-custom-agent-inout:4] MYSQL("SIP/GXP3010-083f2d58", "Clear 2") in new stack
   -- Executing [s@macro-custom-agent-inout:5] MYSQL("SIP/GXP3010-083f2d58", "Disconnect 1") in new stack
   -- Executing [s@macro-custom-agent-inout:6] NoOp("SIP/GXP3010-083f2d58", "MACRO_EXTEN=GXP3010 callbacknum= channelpath= callername=") in new stack
   -- Executing [s@macro-custom-agent-inout:7] NoOp("SIP/GXP3010-083f2d58", "MACRO_EXTEN=GXP3010 CALLBACKNUM= channelpath= callername=") in new stack
   -- Executing [s@macro-custom-agent-inout:8] AddQueueMember("SIP/GXP3010-083f2d58", "chch_queue") in new stack
[Mar 12 21:56:59] WARNING[19722]: app_queue.c:4813 aqm_exec: Unable to add interface 'SIP/GXP3010' to queue 'chch_queue': Already there
   -- Executing [s@macro-custom-agent-inout:9] GotoIf("SIP/GXP3010-083f2d58", "1?a2") in new stack
   -- Goto (macro-custom-agent-inout,s,15)
   -- Executing [s@macro-custom-agent-inout:15] RemoveQueueMember("SIP/GXP3010-083f2d58", "chch_queue") in new stack
[Mar 12 21:56:59] NOTICE[19722]: app_queue.c:4743 rqm_exec: Removed interface 'SIP/GXP3010' from queue 'chch_queue'
   -- Executing [s@macro-custom-agent-inout:16] Set("SIP/GXP3010-083f2d58", "DEVICE_STATE(Custom:q8301_a)=NOT_INUSE") in new stack
   -- Executing [s@macro-custom-agent-inout:17] UserEvent("SIP/GXP3010-083f2d58", "Agentlogoff,Agent: ") in new stack
   -- Executing [s@macro-custom-agent-inout:18] SendText("SIP/GXP3010-083f2d58", "chch_queue LOGOFF") in new stack
   -- Executing [s@macro-custom-agent-inout:19] Playback("SIP/GXP3010-083f2d58", "agent-loggedoff") in new stack
[Mar 12 21:56:59] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- <SIP/GXP3010-083f2d58> Playing 'agent-loggedoff.gsm' (language 'en')
[Mar 12 21:57:00] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- Executing [s@macro-custom-agent-inout:20] Hangup("SIP/GXP3010-083f2d58", "") in new stack
 == Spawn extension (macro-custom-agent-inout, s, 20) exited non-zero on 'SIP/GXP3010-083f2d58' in macro 'custom-agent-inout'
 == Spawn extension (trusted, 8301GXP3010, 1) exited non-zero on 'SIP/GXP3010-083f2d58'
*******************************END OF AGENT LOGOUT**************************  

[Mar 12 21:57:01] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:57:02] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:57:03] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:57:04] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:57:05] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:57:06] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:57:07] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:57:08] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:57:09] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:57:10] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:57:11] WARNING[19721]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- Nobody picked up in 15000 ms
   -- Stopped music on hold on Console/dsp
   -- Executing [8301@default:4] NoOp("Console/dsp", "QUEUE1STATUS=LEAVEEMPTY") in new stack
   -- Executing [8301@default:5] Hangup("Console/dsp", "") in new stack
 == Spawn extension (default, 8301, 5) exited non-zero on 'Console/dsp'
<< Hangup on console >>
chch1*CLI>

********************************************************************************Wrong console output below with 'leavewhenempty=yes', lasts for 60 seconds (as per dialplan) before exiting app_queue with QUEUESTATUS=TIMEOUT.
********************************************************************************

chch1*CLI> console dial 8301
[Mar 12 21:32:39] WARNING[19248]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:39] NOTICE[19248]: console_video.c:133 console_video_start: voice only, console video support not present
   -- Executing [8301@default:1] Answer("Console/dsp", "") in new stack
<< Console call has been answered >>
   -- Executing [8301@default:2] Wait("Console/dsp", "1") in new stack
   -- Executing [8301@default:3] Queue("Console/dsp", "chch_queue,hH,,,60") in new stack
   -- Started music on hold, class 'default', on Console/dsp
 == Using SIP RTP CoS mark 5
[Mar 12 21:32:40] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- SIP/GXP3010-083c34f0 is ringing
[Mar 12 21:32:41] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:42] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
 == Using SIP RTP CoS mark 5

*******************************START OF AGENT LOGOUT**************************
   -- Executing [8301GXP3010@trusted:1] Macro("SIP/GXP3010-083fd408", "custom-agent-inout,chch_queue") in new stack
   -- Executing [s@macro-custom-agent-inout:1] MYSQL("SIP/GXP3010-083fd408", "Connect connid localhost asterisk xxxxxxxxxx xxxxxxxxxxxxxxx") in new stack
   -- Executing [s@macro-custom-agent-inout:2] MYSQL("SIP/GXP3010-083fd408", "Query resultid 1 SELECT channel, extension, name FROM pbx WHERE cid_num='GXP3010'") in new stack
   -- Executing [s@macro-custom-agent-inout:3] MYSQL("SIP/GXP3010-083fd408", "Fetch fetchid 2 channelpath CALLBACKNUM callername") in new stack
   -- Executing [s@macro-custom-agent-inout:4] MYSQL("SIP/GXP3010-083fd408", "Clear 2") in new stack
   -- Executing [s@macro-custom-agent-inout:5] MYSQL("SIP/GXP3010-083fd408", "Disconnect 1") in new stack
   -- Executing [s@macro-custom-agent-inout:6] NoOp("SIP/GXP3010-083fd408", "MACRO_EXTEN=GXP3010 callbacknum= channelpath= callername=") in new stack
   -- Executing [s@macro-custom-agent-inout:7] NoOp("SIP/GXP3010-083fd408", "MACRO_EXTEN=GXP3010 CALLBACKNUM= channelpath= callername=") in new stack
   -- Executing [s@macro-custom-agent-inout:8] AddQueueMember("SIP/GXP3010-083fd408", "chch_queue") in new stack
[Mar 12 21:32:43] WARNING[19498]: app_queue.c:4813 aqm_exec: Unable to add interface 'SIP/GXP3010' to queue 'chch_queue': Already there
   -- Executing [s@macro-custom-agent-inout:9] GotoIf("SIP/GXP3010-083fd408", "1?a2") in new stack
   -- Goto (macro-custom-agent-inout,s,15)
   -- Executing [s@macro-custom-agent-inout:15] RemoveQueueMember("SIP/GXP3010-083fd408", "chch_queue") in new stack
[Mar 12 21:32:43] NOTICE[19498]: app_queue.c:4743 rqm_exec: Removed interface 'SIP/GXP3010' from queue 'chch_queue'
   -- Executing [s@macro-custom-agent-inout:16] Set("SIP/GXP3010-083fd408", "DEVICE_STATE(Custom:q8301_a)=NOT_INUSE") in new stack
   -- Executing [s@macro-custom-agent-inout:17] UserEvent("SIP/GXP3010-083fd408", "Agentlogoff,Agent: ") in new stack
   -- Executing [s@macro-custom-agent-inout:18] SendText("SIP/GXP3010-083fd408", "chch_queue LOGOFF") in new stack
   -- Executing [s@macro-custom-agent-inout:19] Playback("SIP/GXP3010-083fd408", "agent-loggedoff") in new stack
[Mar 12 21:32:43] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- <SIP/GXP3010-083fd408> Playing 'agent-loggedoff.gsm' (language 'en')
[Mar 12 21:32:44] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- Executing [s@macro-custom-agent-inout:20] Hangup("SIP/GXP3010-083fd408", "") in new stack
 == Spawn extension (macro-custom-agent-inout, s, 20) exited non-zero on 'SIP/GXP3010-083fd408' in macro 'custom-agent-inout'
 == Spawn extension (trusted, 8301GXP3010, 1) exited non-zero on 'SIP/GXP3010-083fd408'
*******************************END OF AGENT LOGOUT**************************

[Mar 12 21:32:45] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:46] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:48] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:49] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:50] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:51] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:52] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:53] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:54] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:55] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:56] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- Nobody picked up in 15000 ms
[Mar 12 21:32:57] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:58] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:32:59] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:00] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:01] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:02] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:03] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:04] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:05] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:06] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:07] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:08] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:09] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- Stopped music on hold on Console/dsp
   -- Playing periodic announcement
   -- <Console/dsp> Playing 'queue-periodic-announce.gsm' (language 'en')
[Mar 12 21:33:10] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:11] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:12] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:13] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:14] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:15] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:16] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:17] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- Started music on hold, class 'default', on Console/dsp
[Mar 12 21:33:18] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:19] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:20] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:21] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:22] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:23] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:24] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:25] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:26] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:27] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:28] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:29] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:30] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:31] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:32] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:33] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:34] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:35] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:36] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:37] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:38] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Mar 12 21:33:39] WARNING[19497]: chan_oss.c:492 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
   -- Stopped music on hold on Console/dsp
   -- Executing [8301@default:4] NoOp("Console/dsp", "QUEUE1STATUS=TIMEOUT") in new stack
   -- Executing [8301@default:5] Hangup("Console/dsp", "") in new stack
 == Spawn extension (default, 8301, 5) exited non-zero on 'Console/dsp'
<< Hangup on console >>
chch1*CLI>

Comments:By: Alec Davis (alecdavis) 2009-03-12 14:54:30

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'.

By: Alec Davis (alecdavis) 2009-03-13 13:29:14

I was using a queues.conf from 1.4 days. Reading an upto date version of queues.conf describes leavewhenempty, as operating like this.

The proper use now documented as 'leavewhenempty=inuse,ringing', and this worked for us.

Although backwards when using 'leavewhenempty=yes', it is documented, so this bug can be closed. Unless you fell you can make it right.

By: Mark Michelson (mmichelson) 2009-03-13 16:31:17

leavewhenempty=yes is supposed to work the same as it did in 1.4. If the logic has been reversed, it needs to be addressed. I will get it fixed. Thanks for the report. This shouldn't be too difficult to get corrected. I'll have a patch up shortly.

By: Mark Michelson (mmichelson) 2009-03-13 16:36:55

I've uploaded a patch for testing. Let me know how it goes.

By: Leif Madsen (lmadsen) 2009-04-23 10:40:02

* Ran this scenario on 1.4 so I knew what to look for in trunk.
* Reproduced the issue on trunk and saw that it was not the same as 1.4.
* Tested the patch, which now provides the same functionality as 1.4.

Worked for me!

By: Digium Subversion (svnbot) 2009-04-23 12:45:36

Repository: asterisk
Revision: 190250

U   trunk/apps/app_queue.c

------------------------------------------------------------------------
r190250 | mmichelson | 2009-04-23 12:45:35 -0500 (Thu, 23 Apr 2009) | 9 lines

Fix reversed behavior of leavewhenempty option in queues.conf.

(closes issue ASTERISK-13734)
Reported by: alecdavis
Patches:
     14650.patch uploaded by mmichelson (license 60)
Tested by: mmichelson, lmadsen


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=190250

By: Digium Subversion (svnbot) 2009-04-23 12:46:07

Repository: asterisk
Revision: 190251

_U  branches/1.6.0/

------------------------------------------------------------------------
r190251 | mmichelson | 2009-04-23 12:46:07 -0500 (Thu, 23 Apr 2009) | 14 lines

Blocked revisions 190250 via svnmerge

........
 r190250 | mmichelson | 2009-04-23 12:45:35 -0500 (Thu, 23 Apr 2009) | 9 lines
 
 Fix reversed behavior of leavewhenempty option in queues.conf.
 
 (closes issue ASTERISK-13734)
 Reported by: alecdavis
 Patches:
       14650.patch uploaded by mmichelson (license 60)
 Tested by: mmichelson, lmadsen
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=190251

By: Digium Subversion (svnbot) 2009-04-23 12:46:42

Repository: asterisk
Revision: 190252

_U  branches/1.6.1/

------------------------------------------------------------------------
r190252 | mmichelson | 2009-04-23 12:46:42 -0500 (Thu, 23 Apr 2009) | 14 lines

Blocked revisions 190250 via svnmerge

........
 r190250 | mmichelson | 2009-04-23 12:45:35 -0500 (Thu, 23 Apr 2009) | 9 lines
 
 Fix reversed behavior of leavewhenempty option in queues.conf.
 
 (closes issue ASTERISK-13734)
 Reported by: alecdavis
 Patches:
       14650.patch uploaded by mmichelson (license 60)
 Tested by: mmichelson, lmadsen
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=190252

By: Digium Subversion (svnbot) 2009-04-23 12:47:17

Repository: asterisk
Revision: 190253

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_queue.c

------------------------------------------------------------------------
r190253 | mmichelson | 2009-04-23 12:47:17 -0500 (Thu, 23 Apr 2009) | 15 lines

Merged revisions 190250 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r190250 | mmichelson | 2009-04-23 12:45:35 -0500 (Thu, 23 Apr 2009) | 9 lines
 
 Fix reversed behavior of leavewhenempty option in queues.conf.
 
 (closes issue ASTERISK-13734)
 Reported by: alecdavis
 Patches:
       14650.patch uploaded by mmichelson (license 60)
 Tested by: mmichelson, lmadsen
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=190253