diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-16 14:39:29 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-16 14:39:29 +0000 |
commit | d17ff1ea42571817d74962062410ca54a06b2053 (patch) | |
tree | 1236d574745c7d4d49bb3fb658e3a6bdd3e88a22 /apps/app_macro.c | |
parent | 9e24ed5ccff762fa9d412d1a1321df2de1b26423 (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_macro.c')
-rw-r--r-- | apps/app_macro.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c index 01556d3a7..5f71bcd7f 100644 --- a/apps/app_macro.c +++ b/apps/app_macro.c @@ -166,15 +166,12 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) char *save_macro_context; char *save_macro_priority; char *save_macro_offset; - struct ast_module_user *u; if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Macro() requires arguments. See \"show application macro\" for help.\n"); return -1; } - u = ast_module_user_add(chan); - /* does the user want a deeper rabbit hole? */ s = pbx_builtin_getvar_helper(chan, "MACRO_RECURSION"); if (s) @@ -193,7 +190,6 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) if (depth >= maxdepth) { ast_log(LOG_ERROR, "Macro(): possible infinite loop detected. Returning early.\n"); - ast_module_user_remove(u); return 0; } snprintf(depthc, sizeof(depthc), "%d", depth + 1); @@ -204,7 +200,6 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) macro = strsep(&rest, "|"); if (ast_strlen_zero(macro)) { ast_log(LOG_WARNING, "Invalid macro name specified\n"); - ast_module_user_remove(u); return 0; } @@ -214,7 +209,6 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) ast_log(LOG_WARNING, "No such context '%s' for macro '%s'\n", fullmacro, macro); else ast_log(LOG_WARNING, "Context '%s' for macro '%s' lacks 's' extension, priority 1\n", fullmacro, macro); - ast_module_user_remove(u); return 0; } @@ -225,8 +219,6 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) if (ast_context_lockmacro(fullmacro)) { ast_log(LOG_WARNING, "Failed to lock macro '%s' as in-use\n", fullmacro); ast_autoservice_stop(chan); - ast_module_user_remove(u); - return 0; } ast_autoservice_stop(chan); @@ -474,8 +466,6 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) res = 0; } } - - ast_module_user_remove(u); return res; } @@ -494,14 +484,9 @@ static int macroif_exec(struct ast_channel *chan, void *data) { char *expr = NULL, *label_a = NULL, *label_b = NULL; int res = 0; - struct ast_module_user *u; - u = ast_module_user_add(chan); - - if (!(expr = ast_strdupa(data))) { - ast_module_user_remove(u); + if (!(expr = ast_strdupa(data))) return -1; - } if ((label_a = strchr(expr, '?'))) { *label_a = '\0'; @@ -517,8 +502,6 @@ static int macroif_exec(struct ast_channel *chan, void *data) } else ast_log(LOG_WARNING, "Invalid Syntax.\n"); - ast_module_user_remove(u); - return res; } |