summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/app_queue.c21
-rw-r--r--res/res_features.c21
2 files changed, 5 insertions, 37 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;
}
diff --git a/res/res_features.c b/res/res_features.c
index 59ba1cf44..b483dbb00 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -2235,9 +2235,6 @@ static int park_call_exec(struct ast_channel *chan, void *data)
/* Data is unused at the moment but could contain a parking
lot context eventually */
int res = 0;
- struct ast_module_user *u;
-
- u = ast_module_user_add(chan);
/* Setup the exten/priority to be s/1 since we don't know
where this call should return */
@@ -2253,8 +2250,6 @@ static int park_call_exec(struct ast_channel *chan, void *data)
if (!res)
res = park_call_full(chan, chan, 0, NULL, orig_chan_name);
- ast_module_user_remove(u);
-
return !res ? AST_PBX_KEEPALIVE : res;
}
@@ -2262,15 +2257,12 @@ static int park_call_exec(struct ast_channel *chan, void *data)
static int park_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct ast_module_user *u;
struct ast_channel *peer=NULL;
struct parkeduser *pu;
struct ast_context *con;
int park = 0;
struct ast_bridge_config config;
- u = ast_module_user_add(chan);
-
if (data)
park = atoi((char *)data);
@@ -2336,7 +2328,6 @@ static int park_exec(struct ast_channel *chan, void *data)
if (error) {
ast_log(LOG_WARNING, "Failed to play courtesy tone!\n");
ast_hangup(peer);
- ast_module_user_remove(u);
return -1;
}
} else
@@ -2346,7 +2337,6 @@ static int park_exec(struct ast_channel *chan, void *data)
if (res < 0) {
ast_log(LOG_WARNING, "Could not make channels %s and %s compatible for bridge\n", chan->name, peer->name);
ast_hangup(peer);
- ast_module_user_remove(u);
return -1;
}
/* This runs sorta backwards, since we give the incoming channel control, as if it
@@ -2372,7 +2362,6 @@ static int park_exec(struct ast_channel *chan, void *data)
/* Simulate the PBX hanging up */
if (res != AST_PBX_NO_HANGUP_PEER)
ast_hangup(peer);
- ast_module_user_remove(u);
return res;
} else {
/*! \todo XXX Play a message XXX */
@@ -2382,8 +2371,6 @@ static int park_exec(struct ast_channel *chan, void *data)
res = -1;
}
- ast_module_user_remove(u);
-
return res;
}
@@ -3147,7 +3134,6 @@ END_OPTIONS );
*/
static int bridge_exec(struct ast_channel *chan, void *data)
{
- struct ast_module_user *u;
struct ast_channel *current_dest_chan, *final_dest_chan;
char *tmp_data = NULL;
struct ast_flags opts = { 0, };
@@ -3162,8 +3148,6 @@ static int bridge_exec(struct ast_channel *chan, void *data)
ast_log(LOG_WARNING, "Bridge require at least 1 argument specifying the other end of the bridge\n");
return -1;
}
-
- u = ast_module_user_add(chan);
tmp_data = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, tmp_data);
@@ -3182,7 +3166,6 @@ static int bridge_exec(struct ast_channel *chan, void *data)
"Channel2: %s\r\n",
chan->name, args.dest_chan);
pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "LOOP");
- ast_module_user_remove(u);
return 0;
}
@@ -3197,7 +3180,6 @@ static int bridge_exec(struct ast_channel *chan, void *data)
"Channel1: %s\r\n"
"Channel2: %s\r\n", chan->name, args.dest_chan);
pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "NONEXISTENT");
- ast_module_user_remove(u);
return 0;
}
ast_channel_unlock(current_dest_chan);
@@ -3229,7 +3211,6 @@ static int bridge_exec(struct ast_channel *chan, void *data)
"Channel2: %s\r\n", chan->name, final_dest_chan->name);
ast_hangup(final_dest_chan); /* may be we should return this channel to the PBX? */
pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "INCOMPATIBLE");
- ast_module_user_remove(u);
return 0;
}
@@ -3267,8 +3248,6 @@ static int bridge_exec(struct ast_channel *chan, void *data)
ast_hangup(final_dest_chan);
}
- ast_module_user_remove(u);
-
return 0;
}