Merge "app_macro deprecation."

This commit is contained in:
Joshua Colp 2017-10-18 19:22:12 -05:00 committed by Gerrit Code Review
commit 7b8f199a50
5 changed files with 28 additions and 2 deletions

View File

@ -12,6 +12,12 @@
--- Functionality changes from Asterisk 15 to Asterisk 16 -------------------- --- Functionality changes from Asterisk 15 to Asterisk 16 --------------------
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
app_macro
------------------
* The app_macro module is now deprecated and by default it is no longer
built. Users should migrate to app_stack (Gosub). A warning is logged
the first time any Macro is used.
chan_sip chan_sip
------------------ ------------------
* New function SIP_HEADERS() enumerates all headers in the incoming INVITE. * New function SIP_HEADERS() enumerates all headers in the incoming INVITE.

View File

@ -26,6 +26,11 @@
New in 16.0.0: New in 16.0.0:
app_macro:
- The app_macro module is now deprecated and by default it is no longer
built. Users should migrate to app_stack (Gosub). A warning is logged
the first time any Macro is used.
New in 15.0.0: New in 15.0.0:
Build System: Build System:

View File

@ -324,6 +324,10 @@
<warning><para>Be aware of the limitations that macros have, specifically with regards to use of <warning><para>Be aware of the limitations that macros have, specifically with regards to use of
the <literal>WaitExten</literal> application. For more information, see the documentation for the <literal>WaitExten</literal> application. For more information, see the documentation for
<literal>Macro()</literal>.</para></warning> <literal>Macro()</literal>.</para></warning>
<note>
<para>Macros are deprecated, GoSub should be used instead,
see the <literal>U</literal> option.</para>
</note>
</option> </option>
<option name="n"> <option name="n">
<argument name="delete"> <argument name="delete">

View File

@ -26,7 +26,8 @@
*/ */
/*** MODULEINFO /*** MODULEINFO
<support_level>core</support_level> <defaultenabled>no</defaultenabled>
<support_level>deprecated</support_level>
<replacement>app_stack (GoSub)</replacement> <replacement>app_stack (GoSub)</replacement>
***/ ***/
@ -250,12 +251,19 @@ static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive
char *save_macro_offset; char *save_macro_offset;
int save_in_subroutine; int save_in_subroutine;
struct ast_datastore *macro_store = ast_channel_datastore_find(chan, &macro_ds_info, NULL); struct ast_datastore *macro_store = ast_channel_datastore_find(chan, &macro_ds_info, NULL);
static int deprecation_notice = 0;
if (ast_strlen_zero(data)) { if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Macro() requires arguments. See \"core show application macro\" for help.\n"); ast_log(LOG_WARNING, "Macro() requires arguments. See \"core show application macro\" for help.\n");
return -1; return -1;
} }
if (!deprecation_notice) {
deprecation_notice = 1;
ast_log(LOG_WARNING, "Macro() is deprecated and will be removed from a future version of Asterisk.\n");
ast_log(LOG_WARNING, "Dialplan should be updated to use Gosub instead.\n");
}
do { do {
if (macro_store) { if (macro_store) {
break; break;
@ -665,4 +673,4 @@ static int load_module(void)
return res; return res;
} }
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Extension Macros"); AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Extension Macros");

View File

@ -235,6 +235,9 @@
</parameter> </parameter>
<parameter name="macro"> <parameter name="macro">
<para>Will run a macro on the called party's channel (the queue member) once the parties are connected.</para> <para>Will run a macro on the called party's channel (the queue member) once the parties are connected.</para>
<note>
<para>Macros are deprecated, GoSub should be used instead.</para>
</note>
</parameter> </parameter>
<parameter name="gosub"> <parameter name="gosub">
<para>Will run a gosub on the called party's channel (the queue member) once the parties are connected.</para> <para>Will run a gosub on the called party's channel (the queue member) once the parties are connected.</para>