summaryrefslogtreecommitdiff
path: root/include/asterisk/app.h
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-04-20 23:29:56 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-04-20 23:29:56 +0000
commit3a874139d4ae0f38f5d2ffaf470b62d4f120dc2d (patch)
tree619db20b50170f0279246abb8b56124289c83ad8 /include/asterisk/app.h
parente6d08d92e35e176d02b6d1cc7da3696d2c12e86f (diff)
Fix connected-line/redirecting interception gosubs executing more than intended.
* Redo ast_app_run_sub()/ast_app_exec_sub() to use a known return point so execution will stop after the routine returns there. (s@gosub_virtual_context:1) * Create ast_app_exec_macro() and ast_app_exec_sub() to run the macro and gosub application respectively with the parameter string already created. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/app.h')
-rw-r--r--include/asterisk/app.h94
1 files changed, 73 insertions, 21 deletions
diff --git a/include/asterisk/app.h b/include/asterisk/app.h
index a9b0d3441..edf1c1c37 100644
--- a/include/asterisk/app.h
+++ b/include/asterisk/app.h
@@ -115,44 +115,96 @@ int ast_app_getdata(struct ast_channel *c, const char *prompt, char *s, int maxl
int ast_app_getdata_full(struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout, int audiofd, int ctrlfd);
/*!
+ * \brief Run a macro on a channel, placing an optional second channel into autoservice.
+ * \since 11.0
+ *
+ * \details
+ * This is a shorthand method that makes it very easy to run a
+ * macro on any given channel. It is perfectly reasonable to
+ * supply a NULL autoservice_chan here in case there is no
+ * channel to place into autoservice.
+ *
+ * \note It is very important that the autoservice_chan is not
+ * locked prior to calling. Otherwise, a deadlock could result.
+ *
+ * \param autoservice_chan A channel to place into autoservice while the macro is run
+ * \param macro_chan Channel to execute macro on.
+ * \param macro_args Macro application argument string.
+ *
+ * \retval 0 success
+ * \retval -1 on error
+ */
+int ast_app_exec_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const char *macro_args);
+
+/*!
* \since 1.8
- * \brief Run a macro on a channel, placing a second channel into autoservice.
+ * \brief Run a macro on a channel, placing an optional second channel into autoservice.
*
- * This is a shorthand method that makes it very easy to run a macro on any given
- * channel. It is perfectly reasonable to supply a NULL autoservice_chan here in case
- * there is no channel to place into autoservice. It is very important that the
- * autoservice_chan parameter is not locked prior to calling ast_app_run_macro. A
- * deadlock could result, otherwise.
+ * \details
+ * This is a shorthand method that makes it very easy to run a
+ * macro on any given channel. It is perfectly reasonable to
+ * supply a NULL autoservice_chan here in case there is no
+ * channel to place into autoservice.
+ *
+ * \note It is very important that the autoservice_chan is not
+ * locked prior to calling. Otherwise, a deadlock could result.
*
* \param autoservice_chan A channel to place into autoservice while the macro is run
- * \param macro_chan The channel to run the macro on
- * \param macro_name The name of the macro to run
- * \param macro_args The arguments to pass to the macro
+ * \param macro_chan Channel to execute macro on.
+ * \param macro_name The name of the macro to run.
+ * \param macro_args The arguments to pass to the macro.
+ *
* \retval 0 success
- * \retval -1 failure
+ * \retval -1 on error
*/
int ast_app_run_macro(struct ast_channel *autoservice_chan,
struct ast_channel *macro_chan, const char *macro_name, const char *macro_args);
/*!
* \since 11
- * \brief Run a subroutine on a channel, placing a second channel into autoservice.
+ * \brief Run a subroutine on a channel, placing an optional second channel into autoservice.
+ *
+ * \details
+ * This is a shorthand method that makes it very easy to run a
+ * subroutine on any given channel. It is perfectly reasonable
+ * to supply a NULL autoservice_chan here in case there is no
+ * channel to place into autoservice.
*
- * This is a shorthand method that makes it very easy to run a subroutine on any given
- * channel. It is perfectly reasonable to supply a NULL autoservice_chan here in case
- * there is no channel to place into autoservice. It is very important that the
- * autoservice_chan parameter is not locked prior to calling ast_app_run_sub. A
- * deadlock could result, otherwise.
+ * \note It is very important that the autoservice_chan is not
+ * locked prior to calling. Otherwise, a deadlock could result.
*
* \param autoservice_chan A channel to place into autoservice while the subroutine is run
- * \param sub_chan The channel to run the subroutine on
- * \param name The name of the subroutine to run
- * \param args The arguments to pass to the subroutien
+ * \param sub_chan Channel to execute subroutine on.
+ * \param sub_args Gosub application argument string.
+ *
+ * \retval 0 success
+ * \retval -1 on error
+ */
+int ast_app_exec_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const char *sub_args);
+
+/*!
+ * \since 11
+ * \brief Run a subroutine on a channel, placing an optional second channel into autoservice.
+ *
+ * \details
+ * This is a shorthand method that makes it very easy to run a
+ * subroutine on any given channel. It is perfectly reasonable
+ * to supply a NULL autoservice_chan here in case there is no
+ * channel to place into autoservice.
+ *
+ * \note It is very important that the autoservice_chan is not
+ * locked prior to calling. Otherwise, a deadlock could result.
+ *
+ * \param autoservice_chan A channel to place into autoservice while the subroutine is run
+ * \param sub_chan Channel to execute subroutine on.
+ * \param sub_location The location of the subroutine to run.
+ * \param sub_args The arguments to pass to the subroutine.
+ *
* \retval 0 success
- * \retval -1 failure
+ * \retval -1 on error
*/
int ast_app_run_sub(struct ast_channel *autoservice_chan,
- struct ast_channel *sub_chan, const char *name, const char *args);
+ struct ast_channel *sub_chan, const char *sub_location, const char *sub_args);
/*!
* \brief Set voicemail function callbacks