diff options
author | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-10 20:35:25 +0000 |
---|---|---|
committer | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-10 20:35:25 +0000 |
commit | b77e092994c1416a570dac1975f9a1282da2ee44 (patch) | |
tree | 476c406379683d1018a036d970ed92eedac55b88 /include | |
parent | 2cf5ce1b3ea30ea29cfdaa59d65099a8f496f753 (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.6.2@286115 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/channel.h | 18 | ||||
-rw-r--r-- | include/asterisk/frame.h | 7 | ||||
-rw-r--r-- | include/asterisk/pbx.h | 4 |
3 files changed, 27 insertions, 2 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 208f88402..9345a402d 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -210,6 +210,24 @@ struct ast_callerid { int cid_tns; /*!< Callerid Transit Network Select */ }; +/*! \brief Typedef for a custom read function */ +typedef int (*ast_acf_read_fn_t)(struct ast_channel *, const char *, char *, char *, size_t); + +/*! \brief Typedef for a custom write function */ +typedef int (*ast_acf_write_fn_t)(struct ast_channel *, const char *, char *, const char *); + +/*! \brief Structure to handle passing func_channel_write info to channels via setoption */ +typedef struct { + /*! \brief ast_chan_write_info_t version. Must be incremented if structure is changed */ + #define AST_CHAN_WRITE_INFO_T_VERSION 1 + uint32_t version; + ast_acf_write_fn_t write_fn; + struct ast_channel *chan; + const char *function; + char *data; + const char *value; +} ast_chan_write_info_t; + /*! \brief Structure to describe a channel "technology", ie a channel driver See for examples: diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h index 8d38ffefb..ed9ff9665 100644 --- a/include/asterisk/frame.h +++ b/include/asterisk/frame.h @@ -400,6 +400,13 @@ struct ast_control_t38_parameters { /*! Explicitly enable or disable echo cancelation for the given channel */ #define AST_OPTION_ECHOCAN 8 +/*! \brief Handle channel write data + * If a channel needs to process the data from a func_channel write operation + * after func_channel_write executes, it can define the setoption callback + * and process this option. A pointer to an ast_chan_write_info_t will be passed. + * */ +#define AST_OPTION_CHANNEL_WRITE 9 + /* ! * Read-only. Allows query current status of T38 on the channel. * data: ast_t38state diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h index 4f2d6facb..9cffe21b1 100644 --- a/include/asterisk/pbx.h +++ b/include/asterisk/pbx.h @@ -90,8 +90,8 @@ struct ast_custom_function { AST_STRING_FIELD(seealso); /*!< See also */ ); enum ast_doc_src docsrc; /*!< Where the documentation come from */ - int (*read)(struct ast_channel *, const char *, char *, char *, size_t); /*!< Read function, if read is supported */ - int (*write)(struct ast_channel *, const char *, char *, const char *); /*!< Write function, if write is supported */ + ast_acf_read_fn_t read; /*!< Read function, if read is supported */ + ast_acf_write_fn_t write; /*!< Write function, if write is supported */ struct ast_module *mod; /*!< Module this custom function belongs to */ AST_RWLIST_ENTRY(ast_custom_function) acflist; }; |