Applications no longer need to call ast_module_user_add and ast_module_user_remove. This is now taken care of in the pbx_exec function outside of the application.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2007-07-16 14:39:29 +00:00
parent 96a646734f
commit b8cd949cce
70 changed files with 78 additions and 722 deletions

View File

@@ -66,7 +66,6 @@ static int transfer_exec(struct ast_channel *chan, void *data)
{
int res;
int len;
struct ast_module_user *u;
char *slash;
char *tech = NULL;
char *dest = NULL;
@@ -77,11 +76,8 @@ static int transfer_exec(struct ast_channel *chan, void *data)
AST_APP_ARG(options);
);
u = ast_module_user_add(chan);
if (ast_strlen_zero((char *)data)) {
ast_log(LOG_WARNING, "Transfer requires an argument ([Tech/]destination[|options])\n");
ast_module_user_remove(u);
pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "FAILURE");
return 0;
} else
@@ -100,7 +96,6 @@ static int transfer_exec(struct ast_channel *chan, void *data)
/* Allow execution only if the Tech/destination agrees with the type of the channel */
if (strncasecmp(chan->tech->type, tech, len)) {
pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "FAILURE");
ast_module_user_remove(u);
return 0;
}
}
@@ -108,7 +103,6 @@ static int transfer_exec(struct ast_channel *chan, void *data)
/* Check if the channel supports transfer before we try it */
if (!chan->tech->transfer) {
pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "UNSUPPORTED");
ast_module_user_remove(u);
return 0;
}
@@ -124,8 +118,6 @@ static int transfer_exec(struct ast_channel *chan, void *data)
pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", status);
ast_module_user_remove(u);
return res;
}