From d04046fbe7ab5876bc08c5e0d273a96b08dfe5f8 Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Fri, 10 Sep 2010 22:15:47 +0000 Subject: Merged revisions 286189 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r286189 | twilson | 2010-09-10 17:04:53 -0500 (Fri, 10 Sep 2010) | 30 lines Merged revisions 286115 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r286115 | twilson | 2010-09-10 15:35:25 -0500 (Fri, 10 Sep 2010) | 23 lines Merged revisions 286059 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r286059 | twilson | 2010-09-10 14:25:08 -0500 (Fri, 10 Sep 2010) | 16 lines Inherit CHANNEL() writes to both sides of a Local channel Having Local (/n) channels as queue members and setting the language in the extension with Set(CHANNEL(language)=fr) sets the language on the Local/...,2 channel. Hold time report playbacks happen on the Local/...,1 channel and therefor do not play in the specified language. This patch modifies func_channel_write to call the setoption callback and pass the CHANNEL() write info to the callback. chan_local uses this information to look up the other side of the channel and apply the same changes to it. (closes issue #17673) Reported by: Guggemand Review: https://reviewboard.asterisk.org/r/903/ ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@286190 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- funcs/func_channel.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'funcs/func_channel.c') diff --git a/funcs/func_channel.c b/funcs/func_channel.c index 69fb72fb3..c0f85d372 100644 --- a/funcs/func_channel.c +++ b/funcs/func_channel.c @@ -378,7 +378,7 @@ static int func_channel_read(struct ast_channel *chan, const char *function, return ret; } -static int func_channel_write(struct ast_channel *chan, const char *function, +static int func_channel_write_real(struct ast_channel *chan, const char *function, char *data, const char *value) { int ret = 0; @@ -496,6 +496,24 @@ static int func_channel_write(struct ast_channel *chan, const char *function, return ret; } +static int func_channel_write(struct ast_channel *chan, const 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", .read = func_channel_read, -- cgit v1.2.3