From 43150cc58d88a79017f930edff2ae8d62bb9bb79 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 14 Aug 2015 12:55:28 -0500 Subject: [PATCH] app_queue.c: Fix setting QUEUE_MEMBER 'paused' and 'ringinuse'. Setting the 'paused' and 'ringinuse' options on a queue member using the dialplan function QUEUE_MEMBER did not behave the same way as the equivalent dialplan applications or AMI actions. * Made queue_function_mem_write() call the set_member_paused() and set_member_value() for the 'paused' and 'ringinuse' options respectively. A beneficial side effect is that the queue name is now optional and sets the value in all queues the interface is a member. NOTE: This may fix a consistency issue with the realtime paused setting since how the value is set is controlled by set_member_paused() which treats realtime a little better. * Update QUEUE_MEMBER XML documentation. * Fix error checking in QUEUE_MEMBER() write. ASTERISK-25215 #close Reported by: Lorne Gaetz Change-Id: I3a016be8dc94d63a9cc155295ff9c9afa5f707cb --- apps/app_queue.c | 93 +++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 52 deletions(-) diff --git a/apps/app_queue.c b/apps/app_queue.c index c670f20786..3c6d9e0417 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -528,7 +528,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Count number of members answering a queue. - + @@ -544,13 +544,22 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Returns the total number of members for the specified queue. - Gets or sets queue member penalty. + Gets or sets queue member penalty. If + queuename is not specified + when setting the penalty then the penalty is set in all queues + the interface is a member. - Gets or sets queue member paused status. + Gets or sets queue member paused status. If + queuename is not specified + when setting the paused status then the paused status is set + in all queues the interface is a member. - Gets or sets queue member ringinuse. + Gets or sets queue member ringinuse. If + queuename is not specified + when setting ringinuse then ringinuse is set + in all queues the interface is a member. @@ -558,10 +567,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Allows access to queue counts [R] and member information [R/W]. - - queuename is required for all operations - interface is required for all member operations. - + queuename is required for all read operations. + interface is required for all member operations. Queue @@ -7493,9 +7500,6 @@ static int queue_function_mem_read(struct ast_channel *chan, const char *cmd, ch static int queue_function_mem_write(struct ast_channel *chan, const char *cmd, char *data, const char *value) { int memvalue; - struct call_queue *q; - struct member *m; - char rtvalue[80]; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(queuename); @@ -7504,63 +7508,48 @@ static int queue_function_mem_write(struct ast_channel *chan, const char *cmd, c ); if (ast_strlen_zero(data)) { - ast_log(LOG_ERROR, "Missing argument. QUEUE_MEMBER(,