summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2007-11-26 18:11:31 +0000
committerJoshua Colp <jcolp@digium.com>2007-11-26 18:11:31 +0000
commit0619fb124826acd56e8eb8315c436f5098cabdc3 (patch)
treebc32cf402d4b92a0eb99ad61dddccb43632102db /apps
parent23eecf8c618db9ad08d023c7d3e4f7a7676c5bcc (diff)
Perform some module use counting audits. This is now done outside the scope of the application/dialplan function so they do not need to worry about it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index dc8454247..37473d318 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4306,8 +4306,8 @@ static int queue_function_queuememberlist(struct ast_channel *chan, const char *
/*! \brief Dialplan function QUEUE_MEMBER_PENALTY()
* Gets the members penalty. */
-static int queue_function_memberpenalty_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) {
- struct ast_module_user *lu;
+static int queue_function_memberpenalty_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
+{
int penalty;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(queuename);
@@ -4321,13 +4321,10 @@ static int queue_function_memberpenalty_read(struct ast_channel *chan, const cha
return -1;
}
- lu = ast_module_user_add(chan);
-
AST_STANDARD_APP_ARGS(args, data);
if (args.argc < 2) {
ast_log(LOG_ERROR, "Missing argument. QUEUE_MEMBER_PENALTY(<queuename>,<interface>)\n");
- ast_module_user_remove(lu);
return -1;
}
@@ -4335,15 +4332,14 @@ static int queue_function_memberpenalty_read(struct ast_channel *chan, const cha
if (penalty >= 0) /* remember that buf is already '\0' */
snprintf (buf, len, "%d", penalty);
-
- ast_module_user_remove(lu);
+
return 0;
}
/*! Dialplan function QUEUE_MEMBER_PENALTY()
* Sets the members penalty. */
-static int queue_function_memberpenalty_write(struct ast_channel *chan, const char *cmd, char *data, const char *value) {
- struct ast_module_user *lu;
+static int queue_function_memberpenalty_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
+{
int penalty;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(queuename);
@@ -4355,34 +4351,27 @@ static int queue_function_memberpenalty_write(struct ast_channel *chan, const ch
return -1;
}
- lu = ast_module_user_add(chan);
-
AST_STANDARD_APP_ARGS(args, data);
if (args.argc < 2) {
ast_log(LOG_ERROR, "Missing argument. QUEUE_MEMBER_PENALTY(<queuename>,<interface>)\n");
- ast_module_user_remove(lu);
return -1;
}
penalty = atoi(value);
if (penalty < 0) {
ast_log(LOG_ERROR, "Invalid penalty\n");
- ast_module_user_remove(lu);
return -1;
}
if (ast_strlen_zero(args.interface)) {
ast_log (LOG_ERROR, "<interface> parameter can't be null\n");
- ast_module_user_remove(lu);
return -1;
}
/* if queuename = NULL then penalty will be set for interface in all the queues. */
set_member_penalty(args.queuename, args.interface, penalty);
- ast_module_user_remove(lu);
-
return 0;
}