summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/app.h22
-rw-r--r--include/asterisk/ccss.h19
-rw-r--r--include/asterisk/channel.h75
3 files changed, 103 insertions, 13 deletions
diff --git a/include/asterisk/app.h b/include/asterisk/app.h
index 87f7c80ed..359c2b1a6 100644
--- a/include/asterisk/app.h
+++ b/include/asterisk/app.h
@@ -131,10 +131,30 @@ int ast_app_getdata_full(struct ast_channel *c, const char *prompt, char *s, int
* \retval 0 success
* \retval -1 failure
*/
-int ast_app_run_macro(struct ast_channel *autoservice_chan, struct ast_channel
+int ast_app_run_macro(struct ast_channel *autoservice_chan, struct ast_channel
*macro_chan, const char * const macro_name, const char * const macro_args);
/*!
+ * \since 11
+ * \brief Run a subroutine on a channel, placing a second channel 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.
+ *
+ * \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
+ * \retval 0 success
+ * \retval -1 failure
+ */
+int ast_app_run_sub(struct ast_channel *autoservice_chan, struct ast_channel
+ *sub_chan, const char * const name, const char * const args);
+
+/*!
* \brief Set voicemail function callbacks
* \param[in] has_voicemail_func set function pointer
* \param[in] inboxcount2_func set function pointer
diff --git a/include/asterisk/ccss.h b/include/asterisk/ccss.h
index ae85e044f..acb3148c7 100644
--- a/include/asterisk/ccss.h
+++ b/include/asterisk/ccss.h
@@ -386,11 +386,28 @@ const char *ast_get_cc_callback_macro(struct ast_cc_config_params *config);
* \since 1.8
* \brief Set the callback_macro name
* \param config The configuration to set the callback_macro on
- * \param value The new callback macro we want to change to
+ * \param value The new callback macro we want to change to
* \retval void
*/
void ast_set_cc_callback_macro(struct ast_cc_config_params *config, const char * const value);
+/*!
+ * \since 11
+ * \brief Get the name of the callback subroutine
+ * \param config The configuration to retrieve the callback_sub from
+ * \return The callback_sub name
+ */
+const char *ast_get_cc_callback_sub(struct ast_cc_config_params *config);
+
+/*!
+ * \since 11
+ * \brief Set the callback subroutine name
+ * \param config The configuration to set the callback_sub on
+ * \param value The new callback subroutine we want to change to
+ * \retval void
+ */
+void ast_set_cc_callback_sub(struct ast_cc_config_params *config, const char * const value);
+
/* END CONFIGURATION FUNCTIONS */
/* BEGIN AGENT/MONITOR REGISTRATION API */
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 7b4313b2b..20fcc4344 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -3418,30 +3418,56 @@ void ast_channel_queue_redirecting_update(struct ast_channel *chan, const struct
* \since 1.8
* \brief Run a connected line interception macro and update a channel's connected line
* information
+ * \deprecated You should use the ast_channel_connected_line_sub() function instead.
*
* Whenever we want to update a channel's connected line information, we may need to run
* a macro so that an administrator can manipulate the information before sending it
* out. This function both runs the macro and sends the update to the channel.
*
* \param autoservice_chan Channel to place into autoservice while the macro is running.
- * It is perfectly safe for this to be NULL
+ * It is perfectly safe for this to be NULL
* \param macro_chan The channel to run the macro on. Also the channel from which we
- * determine which macro we need to run.
+ * determine which macro we need to run.
* \param connected_info Either an ast_party_connected_line or ast_frame pointer of type
- * AST_CONTROL_CONNECTED_LINE
- * \param caller If true, then run CONNECTED_LINE_CALLER_SEND_MACRO, otherwise run
- * CONNECTED_LINE_CALLEE_SEND_MACRO
+ * AST_CONTROL_CONNECTED_LINE
+ * \param is_caller If true, then run CONNECTED_LINE_CALLER_SEND_MACRO with arguments from
+ * CONNECTED_LINE_CALLER_SEND_MACRO_ARGS, otherwise run CONNECTED_LINE_CALLEE_SEND_MACRO
+ * with arguments from CONNECTED_LINE_CALLEE_SEND_MACRO_ARGS
* \param frame If true, then connected_info is an ast_frame pointer, otherwise it is an
- * ast_party_connected_line pointer.
+ * ast_party_connected_line pointer.
* \retval 0 Success
* \retval -1 Either the macro does not exist, or there was an error while attempting to
- * run the macro
+ * run the macro
*
* \todo Have multiple return codes based on the MACRO_RESULT
* \todo Make constants so that caller and frame can be more expressive than just '1' and
- * '0'
+ * '0'
+ */
+int ast_channel_connected_line_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const void *connected_info, int is_caller, int frame);
+
+/*!
+ * \since 11
+ * \brief Run a connected line interception subroutine and update a channel's connected line
+ * information
+ *
+ * Whenever we want to update a channel's connected line information, we may need to run
+ * a subroutine so that an administrator can manipulate the information before sending it
+ * out. This function both runs the subroutine specified by CONNECTED_LINE_SEND_SUB and
+ * sends the update to the channel.
+ *
+ * \param autoservice_chan Channel to place into autoservice while the sub is running.
+ * It is perfectly safe for this to be NULL
+ * \param sub_chan The channel to run the subroutine on. Also the channel from which we
+ * determine which subroutine we need to run.
+ * \param connected_info Either an ast_party_connected_line or ast_frame pointer of type
+ * AST_CONTROL_CONNECTED_LINE
+ * \param frame If true, then connected_info is an ast_frame pointer, otherwise it is an
+ * ast_party_connected_line pointer.
+ * \retval 0 Success
+ * \retval -1 Either the subroutine does not exist, or there was an error while attempting to
+ * run the subroutine
*/
-int ast_channel_connected_line_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const void *connected_info, int caller, int frame);
+int ast_channel_connected_line_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const void *connected_info, int frame);
/*!
* \brief Insert into an astdata tree, the channel structure.
@@ -3467,6 +3493,7 @@ int ast_channel_data_cmp_structure(const struct ast_data_search *tree, struct as
/*!
* \since 1.8
* \brief Run a redirecting interception macro and update a channel's redirecting information
+ * \deprecated You should use the ast_channel_redirecting_sub() function instead.
*
* \details
* Whenever we want to update a channel's redirecting information, we may need to run
@@ -3479,8 +3506,9 @@ int ast_channel_data_cmp_structure(const struct ast_data_search *tree, struct as
* determine which macro we need to run.
* \param redirecting_info Either an ast_party_redirecting or ast_frame pointer of type
* AST_CONTROL_REDIRECTING
- * \param is_caller If true, then run REDIRECTING_CALLER_SEND_MACRO, otherwise run
- * REDIRECTING_CALLEE_SEND_MACRO
+ * \param is_caller If true, then run REDIRECTING_CALLER_SEND_MACRO with arguments from
+ * REDIRECTING_CALLER_SEND_MACRO_ARGS, otherwise run REDIRECTING_CALLEE_SEND_MACRO with
+ * arguments from REDIRECTING_CALLEE_SEND_MACRO_ARGS
* \param is_frame If true, then redirecting_info is an ast_frame pointer, otherwise it is an
* ast_party_redirecting pointer.
*
@@ -3494,6 +3522,31 @@ int ast_channel_data_cmp_structure(const struct ast_data_search *tree, struct as
*/
int ast_channel_redirecting_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const void *redirecting_info, int is_caller, int is_frame);
+/*!
+ * \since 11
+ * \brief Run a redirecting interception subroutine and update a channel's redirecting information
+ *
+ * \details
+ * Whenever we want to update a channel's redirecting information, we may need to run
+ * a subroutine so that an administrator can manipulate the information before sending it
+ * out. This function both runs the subroutine specified by REDIRECTING_SEND_SUB and
+ * sends the update to the channel.
+ *
+ * \param autoservice_chan Channel to place into autoservice while the subroutine is running.
+ * It is perfectly safe for this to be NULL
+ * \param sub_chan The channel to run the subroutine on. Also the channel from which we
+ * determine which subroutine we need to run.
+ * \param redirecting_info Either an ast_party_redirecting or ast_frame pointer of type
+ * AST_CONTROL_REDIRECTING
+ * \param is_frame If true, then redirecting_info is an ast_frame pointer, otherwise it is an
+ * ast_party_redirecting pointer.
+ *
+ * \retval 0 Success
+ * \retval -1 Either the subroutine does not exist, or there was an error while attempting to
+ * run the subroutine
+ */
+int ast_channel_redirecting_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const void *redirecting_info, int is_frame);
+
#include "asterisk/ccss.h"
/*!