From 9fb4a96e159ac9a24400a2e1863954962be37b43 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(-) diff --git a/apps/app_queue.c b/apps/app_queue.c index 69cd79002..0c5757d5d 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -549,7 +549,7 @@ ASTERISK_REGISTER_FILE() Count number of members answering a queue. - + @@ -565,13 +565,22 @@ ASTERISK_REGISTER_FILE() 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. @@ -579,10 +588,8 @@ ASTERISK_REGISTER_FILE() 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 @@ -8147,9 +8154,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); @@ -8158,65 +8162,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(,