From e5f5b9f384eef0389a7e35d40c91d3586869a125 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 14 Aug 2015 12:55:28 -0500 Subject: 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. * 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 | 95 ++++++++++++++++++++++++-------------------------------- 1 file changed, 41 insertions(+), 54 deletions(-) (limited to 'apps/app_queue.c') diff --git a/apps/app_queue.c b/apps/app_queue.c index c0018b555..9e21ab961 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -542,7 +542,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Count number of members answering a queue. - + @@ -558,13 +558,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. @@ -572,10 +581,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 @@ -8106,9 +8113,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); @@ -8117,65 +8121,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(,