aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_while.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-16 14:39:29 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-16 14:39:29 +0000
commitd17ff1ea42571817d74962062410ca54a06b2053 (patch)
tree1236d574745c7d4d49bb3fb658e3a6bdd3e88a22 /apps/app_while.c
parent9e24ed5ccff762fa9d412d1a1321df2de1b26423 (diff)
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: http://svn.digium.com/svn/asterisk/trunk@75200 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_while.c')
-rw-r--r--apps/app_while.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/apps/app_while.c b/apps/app_while.c
index 3733d3bdc..f7da65b19 100644
--- a/apps/app_while.c
+++ b/apps/app_while.c
@@ -44,9 +44,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/lock.h"
#include "asterisk/options.h"
-#define ALL_DONE(u,ret) {ast_module_user_remove(u); return ret;}
-
-
static char *start_app = "While";
static char *start_desc =
"Usage: While(<expr>)\n"
@@ -164,7 +161,6 @@ static int find_matching_endwhile(struct ast_channel *chan)
static int _while_exec(struct ast_channel *chan, void *data, int end)
{
int res=0;
- struct ast_module_user *u;
const char *while_pri = NULL;
char *my_name = NULL;
const char *condition = NULL, *label = NULL;
@@ -179,14 +175,11 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
return -1;
}
- u = ast_module_user_add(chan);
-
/* dont want run away loops if the chan isn't even up
this is up for debate since it slows things down a tad ......
*/
if (ast_waitfordigit(chan,1) < 0)
- ALL_DONE(u,-1);
-
+ return -1;
for (x=0;;x++) {
if (get_index(chan, prefix, x)) {
@@ -243,7 +236,7 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
ast_log(LOG_WARNING, "Couldn't find matching EndWhile? (While at %s@%s priority %d)\n", chan->context, chan->exten, chan->priority);
}
}
- ALL_DONE(u,res);
+ return res;
}
if (!end && !while_pri) {
@@ -268,11 +261,8 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
}
ast_parseable_goto(chan, while_pri);
}
-
-
-
- ALL_DONE(u, res);
+ return res;
}
static int while_start_exec(struct ast_channel *chan, void *data) {