diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-19 23:34:57 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-19 23:34:57 +0000 |
commit | 83a4b299245d4b0ea76ef2234ef6b4597393c6ce (patch) | |
tree | 0356272ce81a6e605d3d2322e40187c011a7abd3 /include | |
parent | 37b839df49d82dcbdc7feae0c7cc4f42c5a2409c (diff) |
Backport of AUDIOHOOK_INHERIT for Asterisk 1.4
(closes issue #13538)
Reported by: mbit
Patches:
13538.patch uploaded by putnopvut (license 60)
Tested by: putnopvut
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166157 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/audiohook.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/asterisk/audiohook.h b/include/asterisk/audiohook.h index 337590636..8839cbde4 100644 --- a/include/asterisk/audiohook.h +++ b/include/asterisk/audiohook.h @@ -146,6 +146,21 @@ int ast_audiohook_detach(struct ast_audiohook *audiohook); */ int ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list); +/*! \brief Move an audiohook from one channel to a new one + * + * \todo Currently only the first audiohook of a specific source found will be moved. + * We should add the capability to move multiple audiohooks from a single source as well. + * + * \note It is required that both old_chan and new_chan are locked prior to calling + * this function. Besides needing to protect the data within the channels, not locking + * these channels can lead to a potential deadlock + * + * \param old_chan The source of the audiohook to move + * \param new_chan The destination to which we want the audiohook to move + * \param source The source of the audiohook we want to move + */ +void ast_audiohook_move_by_source(struct ast_channel *old_chan, struct ast_channel *new_chan, const char *source); + /*! \brief Detach specified source audiohook from channel * \param chan Channel to detach from * \param source Name of source to detach @@ -153,6 +168,18 @@ int ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list); */ int ast_audiohook_detach_source(struct ast_channel *chan, const char *source); +/*! + * \brief Remove an audiohook from a specified channel + * + * \param chan Channel to remove from + * \param audiohook Audiohook to remove + * + * \return Returns 0 on success, -1 on failure + * + * \note The channel does not need to be locked before calling this function + */ +int ast_audiohook_remove(struct ast_channel *chan, struct ast_audiohook *audiohook); + /*! \brief Pass a frame off to be handled by the audiohook core * \param chan Channel that the list is coming off of * \param audiohook_list List of audiohooks |