diff options
author | Jonathan Rose <jrose@digium.com> | 2014-08-22 16:52:51 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2014-08-22 16:52:51 +0000 |
commit | 33835e17a08641f3b54a9293a13a08ca30b43fd6 (patch) | |
tree | 484add3c1ec136e31d2fb1e0f2afcda4b005efe3 /include/asterisk | |
parent | 1498ae0830d946a9b8185131d510b1b864fd3d11 (diff) |
ARI: Fix a crash caused by hanging during playback to a channel in a bridge
ASTERISK-24147 #close
Reported by: Edvin Vidmar
Review: https://reviewboard.asterisk.org/r/3908/
........
Merged revisions 421879 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 421880 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/stasis_app_impl.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/include/asterisk/stasis_app_impl.h b/include/asterisk/stasis_app_impl.h index a8c8c0586..ce60804a8 100644 --- a/include/asterisk/stasis_app_impl.h +++ b/include/asterisk/stasis_app_impl.h @@ -48,6 +48,19 @@ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc, char *argv[]); +/*! + * \brief Typedef for data destructor for stasis app commands + * + * \param data Data to destroy. + * + * \details + * This is called during destruction of the command or if we fail to schedule + * a command. It is passed a pointer to the user-defined data of the command. + * + * \return Nothing + */ +typedef void (*command_data_destructor_fn)(void *data); + /*! Callback type for stasis app commands */ typedef int (*stasis_app_command_cb)(struct stasis_app_control *control, struct ast_channel *chan, void *data); @@ -63,16 +76,19 @@ typedef int (*stasis_app_command_cb)(struct stasis_app_control *control, * \param control Control object for the channel to send the command to. * \param command Command function to execute. * \param data Optional data to pass along with the control function. + * \param data_destructor Optional function which will be called on + * the data in either the event of command completion or failure + * to schedule or complete the command * * \return zero on success. * \return error code otherwise. */ int stasis_app_send_command(struct stasis_app_control *control, - stasis_app_command_cb command, void *data); + stasis_app_command_cb command, void *data, command_data_destructor_fn data_destructor); /*! * \since 12 - * \brief Asynchronous version of stasis_app_send(). + * \brief Asynchronous version of stasis_app_send_command(). * * This function enqueues a command for execution, but returns immediately * without waiting for the response. @@ -80,10 +96,13 @@ int stasis_app_send_command(struct stasis_app_control *control, * \param control Control object for the channel to send the command to. * \param command Command function to execute. * \param data Optional data to pass along with the control function. + * \param data_destructor Optional function which will be called on + * the data in either the event of command completion or failure + * to schedule or complete the command * \return 0 on success. * \return Non-zero on error. */ int stasis_app_send_command_async(struct stasis_app_control *control, - stasis_app_command_cb command, void *data); + stasis_app_command_cb command, void *data, command_data_destructor_fn data_destructor); #endif /* _ASTERISK_RES_STASIS_H */ |