aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_realtime.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-16 18:24:29 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-16 18:24:29 +0000
commite61903fcf60ee38e6d968a793460292ab186de83 (patch)
tree421e0b496d4bd2074e436c513a30b752557e35c7 /funcs/func_realtime.c
parent27c6701a34eed39589aa33fcfdaf264bd35fbe7e (diff)
For my next trick I will make it so dialplan functions no longer need to call ast_module_user_add and ast_module_user_remove. These are now called in the ast_func_read and ast_func_write functions outside of the module.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75255 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_realtime.c')
-rw-r--r--funcs/func_realtime.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/funcs/func_realtime.c b/funcs/func_realtime.c
index 7ffe8122c..611e6ecc6 100644
--- a/funcs/func_realtime.c
+++ b/funcs/func_realtime.c
@@ -48,7 +48,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static int function_realtime_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
struct ast_variable *var, *head;
- struct ast_module_user *u;
struct ast_str *out;
size_t resultslen;
int n;
@@ -65,8 +64,6 @@ static int function_realtime_read(struct ast_channel *chan, const char *cmd, cha
return -1;
}
- u = ast_module_user_add(chan);
-
AST_STANDARD_APP_ARGS(args, data);
if (!args.delim1)
@@ -76,10 +73,9 @@ static int function_realtime_read(struct ast_channel *chan, const char *cmd, cha
head = ast_load_realtime_all(args.family, args.fieldmatch, args.value, NULL);
- if (!head) {
- ast_module_user_remove(u);
+ if (!head)
return -1;
- }
+
resultslen = 0;
n = 0;
for (var = head; var; n++, var = var->next)
@@ -92,14 +88,11 @@ static int function_realtime_read(struct ast_channel *chan, const char *cmd, cha
ast_str_append(&out, 0, "%s%s%s%s", var->name, args.delim2, var->value, args.delim1);
ast_copy_string(buf, out->str, len);
- ast_module_user_remove(u);
-
return 0;
}
static int function_realtime_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
{
- struct ast_module_user *u;
int res = 0;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(family);
@@ -113,8 +106,6 @@ static int function_realtime_write(struct ast_channel *chan, const char *cmd, ch
return -1;
}
- u = ast_module_user_add(chan);
-
AST_STANDARD_APP_ARGS(args, data);
res = ast_update_realtime(args.family, args.fieldmatch, args.value, args.field, (char *)value, NULL);
@@ -123,8 +114,6 @@ static int function_realtime_write(struct ast_channel *chan, const char *cmd, ch
ast_log(LOG_WARNING, "Failed to update. Check the debug log for possible data repository related entries.\n");
}
- ast_module_user_remove(u);
-
return 0;
}