aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_channel.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 99f6d1e61..c0ca62ec8 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -96,7 +96,7 @@ static int func_channel_read(struct ast_channel *chan, char *function,
return ret;
}
-static int func_channel_write(struct ast_channel *chan, char *function,
+static int func_channel_write_real(struct ast_channel *chan, char *function,
char *data, const char *value)
{
int ret = 0;
@@ -139,6 +139,24 @@ static int func_channel_write(struct ast_channel *chan, char *function,
return ret;
}
+static int func_channel_write(struct ast_channel *chan, char *function, char *data, const char *value)
+{
+ int res;
+ ast_chan_write_info_t write_info = {
+ .version = AST_CHAN_WRITE_INFO_T_VERSION,
+ .write_fn = func_channel_write_real,
+ .chan = chan,
+ .function = function,
+ .data = data,
+ .value = value,
+ };
+
+ res = func_channel_write_real(chan, function, data, value);
+ ast_channel_setoption(chan, AST_OPTION_CHANNEL_WRITE, &write_info, sizeof(write_info), 0);
+
+ return res;
+}
+
static struct ast_custom_function channel_function = {
.name = "CHANNEL",
.synopsis = "Gets/sets various pieces of information about the channel.",