<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6817">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  Kevin Harwell: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_macro deprecation.<br><br>* Mark the module deprecated.<br>* Disable the module by default.<br>* Produce a warning the first time a macro is used.<br>* Note deprecation related options in app_dial and app_queue.<br><br>ASTERISK-27350<br><br>Change-Id: I560ea043bacdbc5534a17d97854273d52c2f1bdc<br>---<br>M CHANGES<br>M UPGRADE.txt<br>M apps/app_dial.c<br>M apps/app_macro.c<br>M apps/app_queue.c<br>5 files changed, 28 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/CHANGES b/CHANGES<br>index 63c8c6f..68617a4 100644<br>--- a/CHANGES<br>+++ b/CHANGES<br>@@ -12,6 +12,12 @@<br> --- Functionality changes from Asterisk 15 to Asterisk 16 --------------------<br> ------------------------------------------------------------------------------<br> <br>+app_macro<br>+------------------<br>+ * The app_macro module is now deprecated and by default it is no longer<br>+   built.  Users should migrate to app_stack (Gosub).  A warning is logged<br>+   the first time any Macro is used.<br>+<br> chan_sip<br> ------------------<br>  * New function SIP_HEADERS() enumerates all headers in the incoming INVITE.<br>diff --git a/UPGRADE.txt b/UPGRADE.txt<br>index 1fe82c0..39c0f8c 100644<br>--- a/UPGRADE.txt<br>+++ b/UPGRADE.txt<br>@@ -26,6 +26,11 @@<br> <br> New in 16.0.0:<br> <br>+app_macro:<br>+ - The app_macro module is now deprecated and by default it is no longer<br>+   built.  Users should migrate to app_stack (Gosub).  A warning is logged<br>+   the first time any Macro is used.<br>+<br> New in 15.0.0:<br> <br> Build System:<br>diff --git a/apps/app_dial.c b/apps/app_dial.c<br>index 847a095..8c51f3f 100644<br>--- a/apps/app_dial.c<br>+++ b/apps/app_dial.c<br>@@ -324,6 +324,10 @@<br>                                      <warning><para>Be aware of the limitations that macros have, specifically with regards to use of<br>                                  the <literal>WaitExten</literal> application. For more information, see the documentation for<br>                                     <literal>Macro()</literal>.</para></warning><br>+                                 <note><br>+                                         <para>Macros are deprecated, GoSub should be used instead,<br>+                                             see the <literal>U</literal> option.</para><br>+                                        </note><br>                                 </option><br>                               <option name="n"><br>                                     <argument name="delete"><br>diff --git a/apps/app_macro.c b/apps/app_macro.c<br>index 4ef5252..c6f051e 100644<br>--- a/apps/app_macro.c<br>+++ b/apps/app_macro.c<br>@@ -26,7 +26,8 @@<br>  */<br> <br> /*** MODULEINFO<br>-      <support_level>core</support_level><br>+      <defaultenabled>no</defaultenabled><br>+      <support_level>deprecated</support_level><br>         <replacement>app_stack (GoSub)</replacement><br>  ***/<br> <br>@@ -250,10 +251,17 @@<br>    char *save_macro_offset;<br>      int save_in_subroutine;<br>       struct ast_datastore *macro_store = ast_channel_datastore_find(chan, &macro_ds_info, NULL);<br>+      static int deprecation_notice = 0;<br> <br>         if (ast_strlen_zero(data)) {<br>          ast_log(LOG_WARNING, "Macro() requires arguments. See \"core show application macro\" for help.\n");<br>              return -1;<br>+   }<br>+<br>+ if (!deprecation_notice) {<br>+           deprecation_notice = 1;<br>+              ast_log(LOG_WARNING, "Macro() is deprecated and will be removed from a future version of Asterisk.\n");<br>+            ast_log(LOG_WARNING, "Dialplan should be updated to use Gosub instead.\n");<br>         }<br> <br>  do {<br>@@ -665,4 +673,4 @@<br>     return res;<br> }<br> <br>-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Extension Macros");<br>+AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Extension Macros");<br>diff --git a/apps/app_queue.c b/apps/app_queue.c<br>index e3a4e22..801695f 100644<br>--- a/apps/app_queue.c<br>+++ b/apps/app_queue.c<br>@@ -235,6 +235,9 @@<br>                   </parameter><br>                    <parameter name="macro"><br>                              <para>Will run a macro on the called party's channel (the queue member) once the parties are connected.</para><br>+                               <note><br>+                                 <para>Macros are deprecated, GoSub should be used instead.</para><br>+                                </note><br>                         </parameter><br>                    <parameter name="gosub"><br>                              <para>Will run a gosub on the called party's channel (the queue member) once the parties are connected.</para><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6817">change 6817</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6817"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I560ea043bacdbc5534a17d97854273d52c2f1bdc </div>
<div style="display:none"> Gerrit-Change-Number: 6817 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>