diff --git a/CHANGES b/CHANGES index 63c8c6f7cec8d64a5a2f47fac8a890cd03581a61..68617a441893b7eef6371743eccb41452dd91fdf 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,12 @@ --- 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 ------------------ * New function SIP_HEADERS() enumerates all headers in the incoming INVITE. diff --git a/UPGRADE.txt b/UPGRADE.txt index 1fe82c04eae1e366dcf59c047dc6b66838b07a8e..39c0f8cec85fa3bf15a7ab2f635053f6c4eb05e7 100644 --- a/UPGRADE.txt +++ b/UPGRADE.txt @@ -26,6 +26,11 @@ 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: Build System: diff --git a/apps/app_dial.c b/apps/app_dial.c index 847a095f44a77d9984bd07167168392af8284da1..8c51f3f1a48d592c0216d235c9d3e6c8b84aad0f 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -324,6 +324,10 @@ <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 <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 name="n"> <argument name="delete"> diff --git a/apps/app_macro.c b/apps/app_macro.c index 4ef525295c0c9f0177f6d884d4c24255cf1d99d6..c6f051ea09264e817e7a8efff99382dcd7ecad26 100644 --- a/apps/app_macro.c +++ b/apps/app_macro.c @@ -26,7 +26,8 @@ */ /*** MODULEINFO - <support_level>core</support_level> + <defaultenabled>no</defaultenabled> + <support_level>deprecated</support_level> <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; int save_in_subroutine; struct ast_datastore *macro_store = ast_channel_datastore_find(chan, ¯o_ds_info, NULL); + static int deprecation_notice = 0; if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Macro() requires arguments. See \"core show application macro\" for help.\n"); 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 { if (macro_store) { break; @@ -665,4 +673,4 @@ static int load_module(void) return res; } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Extension Macros"); +AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Extension Macros"); diff --git a/apps/app_queue.c b/apps/app_queue.c index e3a4e22a9f0bc28a9793fcec9741afd67e4cd2be..801695ffffcfc67dc50bf656c70c5accef88746b 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -235,6 +235,9 @@ </parameter> <parameter name="macro"> <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 name="gosub"> <para>Will run a gosub on the called party's channel (the queue member) once the parties are connected.</para>