summaryrefslogtreecommitdiff
path: root/include/asterisk/stasis_app_impl.h
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2014-08-22 16:44:21 +0000
committerJonathan Rose <jrose@digium.com>2014-08-22 16:44:21 +0000
commit712907eec683f6c2e1bd8e51ae8f29a31c19a205 (patch)
treee12bf92740a81800e9d62f8fef0708cfb98dbb3a /include/asterisk/stasis_app_impl.h
parent50381d2c77dec85a480abfd8961eefb09e78e474 (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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@421880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/stasis_app_impl.h')
-rw-r--r--include/asterisk/stasis_app_impl.h25
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 */