<p>Michael Bradeen has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19708">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_macro: Remove deprecated module.<br><br>ASTERISK-30304<br><br>Change-Id: I830daab293117179b8d61bd4df0d971a1b3d07f6<br>---<br>M addons/chan_ooh323.c<br>M apps/app_chanspy.c<br>M apps/app_dial.c<br>M apps/app_directory.c<br>M apps/app_followme.c<br>D apps/app_macro.c<br>M apps/app_meetme.c<br>M apps/app_minivm.c<br>M apps/app_mixmonitor.c<br>M apps/app_queue.c<br>M apps/app_voicemail.c<br>M channels/chan_dahdi.c<br>M channels/chan_pjsip.c<br>M channels/chan_sip.c<br>A doc/UPGRADE-staging/app_macro_removal.txt<br>M funcs/func_callcompletion.c<br>M include/asterisk/app.h<br>M include/asterisk/ccss.h<br>M include/asterisk/channel.h<br>M include/asterisk/extconf.h<br>M include/asterisk/options.h<br>M include/asterisk/pbx.h<br>M main/app.c<br>M main/bridge_basic.c<br>M main/bridge_channel.c<br>M main/ccss.c<br>M main/channel.c<br>M main/channel_internal_api.c<br>M main/dial.c<br>M main/features.c<br>M main/pbx.c<br>M main/pickup.c<br>M menuselect/example_menuselect-tree<br>M menuselect/test/menuselect-tree<br>M pbx/pbx_config.c<br>M pbx/pbx_dundi.c<br>M res/res_fax.c<br>M res/snmp/agent.c<br>M utils/extconf.c<br>39 files changed, 107 insertions(+), 1,547 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/08/19708/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c</span><br><span>index 814022c..67a7688 100644</span><br><span>--- a/addons/chan_ooh323.c</span><br><span>+++ b/addons/chan_ooh323.c</span><br><span>@@ -5047,7 +5047,7 @@</span><br><span>                       p->faxdetected = 1;</span><br><span>                       ooRequestChangeMode(p->callToken, 1);</span><br><span>             } else if ((dfr->subclass.integer == 'f') && !p->faxdetected) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   const char *target_context = S_OR(ast_channel_macrocontext(p->owner), ast_channel_context(p->owner));</span><br><span style="color: hsl(120, 100%, 40%);">+                   const char *target_context = ast_channel_context(p->owner);</span><br><span>                       if ((strcmp(ast_channel_exten(p->owner), "fax")) &&</span><br><span>                         (ast_exists_extension(p->owner, target_context, "fax", 1,</span><br><span>                       S_COR(ast_channel_caller(p->owner)->id.number.valid, ast_channel_caller(p->owner)->id.number.str, NULL)))) {</span><br><span>@@ -5123,7 +5123,7 @@</span><br><span>                         if ((p->faxdetect & FAXDETECT_T38) && !p->faxdetected) {</span><br><span>                                   const char *target_context;</span><br><span>                          ast_debug(1, "* Detected T.38 Request\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                            target_context = S_OR(ast_channel_macrocontext(p->owner), ast_channel_context(p->owner));</span><br><span style="color: hsl(120, 100%, 40%);">+                               target_context = ast_channel_context(p->owner);</span><br><span>                           if ((strcmp(ast_channel_exten(p->owner), "fax")) &&</span><br><span>                                             (ast_exists_extension(p->owner, target_context, "fax", 1,</span><br><span>                                       S_COR(ast_channel_caller(p->owner)->id.number.valid, ast_channel_caller(p->owner)->id.number.str, NULL)))) {</span><br><span>diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c</span><br><span>index 2d720ee..e8167d8 100644</span><br><span>--- a/apps/app_chanspy.c</span><br><span>+++ b/apps/app_chanspy.c</span><br><span>@@ -907,8 +907,6 @@</span><br><span>          ast_channel_lock(chan);</span><br><span>              if ((c = pbx_builtin_getvar_helper(chan, "SPY_EXIT_CONTEXT"))) {</span><br><span>                   ast_copy_string(exitcontext, c, sizeof(exitcontext));</span><br><span style="color: hsl(0, 100%, 40%);">-           } else if (!ast_strlen_zero(ast_channel_macrocontext(chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  ast_copy_string(exitcontext, ast_channel_macrocontext(chan), sizeof(exitcontext));</span><br><span>           } else {</span><br><span>                     ast_copy_string(exitcontext, ast_channel_context(chan), sizeof(exitcontext));</span><br><span>                }</span><br><span>diff --git a/apps/app_dial.c b/apps/app_dial.c</span><br><span>index c389225..4973934 100644</span><br><span>--- a/apps/app_dial.c</span><br><span>+++ b/apps/app_dial.c</span><br><span>@@ -208,7 +208,7 @@</span><br><span>                                     and <emphasis>start</emphasis> execution at that location.</para></span><br><span>                                  <para>NOTE: Any channel variables you want the called channel to inherit from the caller channel must be</span><br><span>                                       prefixed with one or two underbars ('_').</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                  <para>NOTE: Using this option from a Macro() or GoSub() might not make sense as there would be no return points.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                   <para>NOTE: Using this option from a GoSub() might not make sense as there would be no return points.</para></span><br><span>                             </option></span><br><span>                              <option name="g"></span><br><span>                                    <para>Proceed with dialplan execution at the next priority in the current extension if the</span><br><span>@@ -297,47 +297,6 @@</span><br><span>                                      channel answers. A specific music on hold <replaceable>class</replaceable></span><br><span>                                       (as defined in <filename>musiconhold.conf</filename>) can be specified.</para></span><br><span>                             </option></span><br><span style="color: hsl(0, 100%, 40%);">-                         <option name="M" argsep="^"></span><br><span style="color: hsl(0, 100%, 40%);">-                                  <argument name="macro" required="true"></span><br><span style="color: hsl(0, 100%, 40%);">-                                               <para>Name of the macro that should be executed.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                     </argument></span><br><span style="color: hsl(0, 100%, 40%);">-                                       <argument name="arg" multiple="true"></span><br><span style="color: hsl(0, 100%, 40%);">-                                         <para>Macro arguments</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                        </argument></span><br><span style="color: hsl(0, 100%, 40%);">-                                       <para>Execute the specified <replaceable>macro</replaceable> for the <emphasis>called</emphasis> channel</span><br><span style="color: hsl(0, 100%, 40%);">-                                  before connecting to the calling channel. Arguments can be specified to the Macro</span><br><span style="color: hsl(0, 100%, 40%);">-                                       using <literal>^</literal> as a delimiter. The macro can set the variable</span><br><span style="color: hsl(0, 100%, 40%);">-                                   <variable>MACRO_RESULT</variable> to specify the following actions after the macro is</span><br><span style="color: hsl(0, 100%, 40%);">-                                       finished executing:</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                        <variablelist></span><br><span style="color: hsl(0, 100%, 40%);">-                                            <variable name="MACRO_RESULT"></span><br><span style="color: hsl(0, 100%, 40%);">-                                                  <para>If set, this action will be taken after the macro finished executing.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                                  <value name="ABORT"></span><br><span style="color: hsl(0, 100%, 40%);">-                                                            Hangup both legs of the call</span><br><span style="color: hsl(0, 100%, 40%);">-                                                    </value></span><br><span style="color: hsl(0, 100%, 40%);">-                                                  <value name="CONGESTION"></span><br><span style="color: hsl(0, 100%, 40%);">-                                                               Behave as if line congestion was encountered</span><br><span style="color: hsl(0, 100%, 40%);">-                                                    </value></span><br><span style="color: hsl(0, 100%, 40%);">-                                                  <value name="BUSY"></span><br><span style="color: hsl(0, 100%, 40%);">-                                                             Behave as if a busy signal was encountered</span><br><span style="color: hsl(0, 100%, 40%);">-                                                      </value></span><br><span style="color: hsl(0, 100%, 40%);">-                                                  <value name="CONTINUE"></span><br><span style="color: hsl(0, 100%, 40%);">-                                                         Hangup the called party and allow the calling party to continue dialplan execution at the next priority</span><br><span style="color: hsl(0, 100%, 40%);">-                                                 </value></span><br><span style="color: hsl(0, 100%, 40%);">-                                                  <value name="GOTO:[[&lt;context&gt;^]&lt;exten&gt;^]&lt;priority&gt;"></span><br><span style="color: hsl(0, 100%, 40%);">-                                                          Transfer the call to the specified destination.</span><br><span style="color: hsl(0, 100%, 40%);">-                                                 </value></span><br><span style="color: hsl(0, 100%, 40%);">-                                          </variable></span><br><span style="color: hsl(0, 100%, 40%);">-                                       </variablelist></span><br><span style="color: hsl(0, 100%, 40%);">-                                   <para>NOTE: You cannot use any additional action post answer options in conjunction</span><br><span style="color: hsl(0, 100%, 40%);">-                                       with this option. Also, pbx services are run on the peer (called) channel,</span><br><span style="color: hsl(0, 100%, 40%);">-                                      so you will not be able to set timeouts via the <literal>TIMEOUT()</literal> function in this macro.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                   <para>WARNING: Be aware of the limitations that macros have, specifically with regards to use of</span><br><span style="color: hsl(0, 100%, 40%);">-                                  the <literal>WaitExten</literal> application. For more information, see the documentation for</span><br><span style="color: hsl(0, 100%, 40%);">-                                       <literal>Macro()</literal>.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                    <para>NOTE: Macros are deprecated, GoSub should be used instead,</span><br><span style="color: hsl(0, 100%, 40%);">-                                  see the <literal>U</literal> option.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                           </option></span><br><span>                              <option name="n"></span><br><span>                                    <argument name="delete"></span><br><span>                                             <para>With <replaceable>delete</replaceable> either not specified or set to <literal>0</literal>,</span><br><span>@@ -657,7 +616,6 @@</span><br><span>                        <ref type="application">RetryDial</ref></span><br><span>                        <ref type="application">SendDTMF</ref></span><br><span>                         <ref type="application">Gosub</ref></span><br><span style="color: hsl(0, 100%, 40%);">-                       <ref type="application">Macro</ref></span><br><span>            </see-also></span><br><span>    </application></span><br><span>         <application name="RetryDial" language="en_US"></span><br><span>@@ -712,7 +670,6 @@</span><br><span>      OPT_ORIGINAL_CLID =     (1 << 8),</span><br><span>      OPT_DURATION_LIMIT =    (1 << 9),</span><br><span>      OPT_MUSICBACK =         (1 << 10),</span><br><span style="color: hsl(0, 100%, 40%);">-        OPT_CALLEE_MACRO =      (1 << 11),</span><br><span>     OPT_SCREEN_NOINTRO =    (1 << 12),</span><br><span>     OPT_SCREEN_NOCALLERID = (1 << 13),</span><br><span>     OPT_IGNORE_CONNECTEDLINE = (1 << 14),</span><br><span>@@ -757,7 +714,6 @@</span><br><span>    OPT_ARG_GOTO,</span><br><span>        OPT_ARG_DURATION_LIMIT,</span><br><span>      OPT_ARG_MUSICBACK,</span><br><span style="color: hsl(0, 100%, 40%);">-      OPT_ARG_CALLEE_MACRO,</span><br><span>        OPT_ARG_RINGBACK,</span><br><span>    OPT_ARG_CALLEE_GOSUB,</span><br><span>        OPT_ARG_CALLEE_GO_ON,</span><br><span>@@ -799,7 +755,6 @@</span><br><span>  AST_APP_OPTION('K', OPT_CALLER_PARK),</span><br><span>        AST_APP_OPTION_ARG('L', OPT_DURATION_LIMIT, OPT_ARG_DURATION_LIMIT),</span><br><span>         AST_APP_OPTION_ARG('m', OPT_MUSICBACK, OPT_ARG_MUSICBACK),</span><br><span style="color: hsl(0, 100%, 40%);">-      AST_APP_OPTION_ARG('M', OPT_CALLEE_MACRO, OPT_ARG_CALLEE_MACRO),</span><br><span>     AST_APP_OPTION_ARG('n', OPT_SCREEN_NOINTRO, OPT_ARG_SCREEN_NOINTRO),</span><br><span>         AST_APP_OPTION('N', OPT_SCREEN_NOCALLERID),</span><br><span>  AST_APP_OPTION_ARG('o', OPT_ORIGINAL_CLID, OPT_ARG_ORIGINAL_CLID),</span><br><span>@@ -825,7 +780,7 @@</span><br><span> #define CAN_EARLY_BRIDGE(flags,chan,peer) (!ast_test_flag64(flags, OPT_CALLEE_HANGUP | \</span><br><span>         OPT_CALLER_HANGUP | OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER | \</span><br><span>    OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR | OPT_CALLEE_PARK |  \</span><br><span style="color: hsl(0, 100%, 40%);">-  OPT_CALLER_PARK | OPT_ANNOUNCE | OPT_CALLEE_MACRO | OPT_CALLEE_GOSUB) && \</span><br><span style="color: hsl(120, 100%, 40%);">+    OPT_CALLER_PARK | OPT_ANNOUNCE | OPT_CALLEE_GOSUB) && \</span><br><span>      !ast_channel_audiohooks(chan) && !ast_channel_audiohooks(peer) && \</span><br><span>  ast_framehook_list_is_empty(ast_channel_framehooks(chan)) && ast_framehook_list_is_empty(ast_channel_framehooks(peer)))</span><br><span> </span><br><span>@@ -927,10 +882,6 @@</span><br><span>   } else {</span><br><span>             if (!ast_goto_if_exists(chan, ast_channel_context(chan), rexten, pri))</span><br><span>                       return 1;</span><br><span style="color: hsl(0, 100%, 40%);">-               else if (!ast_strlen_zero(ast_channel_macrocontext(chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    if (!ast_goto_if_exists(chan, ast_channel_macrocontext(chan), rexten, pri))</span><br><span style="color: hsl(0, 100%, 40%);">-                             return 1;</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span>    }</span><br><span>    return 0;</span><br><span> }</span><br><span>@@ -942,8 +893,8 @@</span><br><span>         const char *exten;</span><br><span> </span><br><span>       ast_channel_lock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- context = ast_strdupa(S_OR(ast_channel_macrocontext(chan), ast_channel_context(chan)));</span><br><span style="color: hsl(0, 100%, 40%);">- exten = ast_strdupa(S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)));</span><br><span style="color: hsl(120, 100%, 40%);">+     context = ast_strdupa(ast_channel_context(chan));</span><br><span style="color: hsl(120, 100%, 40%);">+     exten = ast_strdupa(ast_channel_exten(chan));</span><br><span>        ast_channel_unlock(chan);</span><br><span> </span><br><span>        return ast_get_hint(NULL, 0, name, namelen, chan, context, exten) ? name : "";</span><br><span>@@ -1078,7 +1029,7 @@</span><br><span>                     ast_party_number_init(&ast_channel_redirecting(c)->from.number);</span><br><span>                      ast_channel_redirecting(c)->from.number.valid = 1;</span><br><span>                        ast_channel_redirecting(c)->from.number.str =</span><br><span style="color: hsl(0, 100%, 40%);">-                                ast_strdup(S_OR(ast_channel_macroexten(in), ast_channel_exten(in)));</span><br><span style="color: hsl(120, 100%, 40%);">+                          ast_strdup(ast_channel_exten(in));</span><br><span>           }</span><br><span> </span><br><span>                ast_channel_dialed(c)->transit_network_select = ast_channel_dialed(in)->transit_network_select;</span><br><span>@@ -1127,17 +1078,12 @@</span><br><span>                       * Redirecting updates to the caller make sense only on single</span><br><span>                        * calls.</span><br><span>                     *</span><br><span style="color: hsl(0, 100%, 40%);">-                       * We must unlock c before calling</span><br><span style="color: hsl(0, 100%, 40%);">-                       * ast_channel_redirecting_macro, because we put c into</span><br><span style="color: hsl(0, 100%, 40%);">-                  * autoservice there.  That is pretty much a guaranteed</span><br><span style="color: hsl(0, 100%, 40%);">-                  * deadlock.  This is why the handling of c's lock may seem a</span><br><span style="color: hsl(0, 100%, 40%);">-                        * bit unusual here.</span><br><span style="color: hsl(120, 100%, 40%);">+                   * Need to re-evalute if unlocking is still required here as macro is gone</span><br><span>                    */</span><br><span>                  ast_party_redirecting_init(&redirecting);</span><br><span>                        ast_party_redirecting_copy(&redirecting, ast_channel_redirecting(c));</span><br><span>                    ast_channel_unlock(c);</span><br><span style="color: hsl(0, 100%, 40%);">-                  if (ast_channel_redirecting_sub(c, in, &redirecting, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                          ast_channel_redirecting_macro(c, in, &redirecting, 1, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       if (ast_channel_redirecting_sub(c, in, &redirecting, 0)) {</span><br><span>                               ast_channel_update_redirecting(in, &redirecting, NULL);</span><br><span>                  }</span><br><span>                    ast_party_redirecting_free(&redirecting);</span><br><span>@@ -1213,8 +1159,7 @@</span><br><span>        ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(peer));</span><br><span>        ast_channel_unlock(peer);</span><br><span>    connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;</span><br><span style="color: hsl(0, 100%, 40%);">-      if (ast_channel_connected_line_sub(peer, chan, &connected_caller, 0)</span><br><span style="color: hsl(0, 100%, 40%);">-                && ast_channel_connected_line_macro(peer, chan, &connected_caller, is_caller, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+       if (ast_channel_connected_line_sub(peer, chan, &connected_caller, 0)) {</span><br><span>          ast_channel_update_connected_line(chan, &connected_caller, NULL);</span><br><span>        }</span><br><span>    ast_party_connected_line_free(&connected_caller);</span><br><span>@@ -1346,8 +1291,7 @@</span><br><span>                                                update_connected_line_from_peer(in, c, 1);</span><br><span>                                   } else if (!single && !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {</span><br><span>                                               if (o->pending_connected_update) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                   if (ast_channel_connected_line_sub(c, in, &o->connected, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                           ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                        if (ast_channel_connected_line_sub(c, in, &o->connected, 0)) {</span><br><span>                                                                ast_channel_update_connected_line(in, &o->connected, NULL);</span><br><span>                                                   }</span><br><span>                                            } else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {</span><br><span>@@ -1445,8 +1389,7 @@</span><br><span>                                                      update_connected_line_from_peer(in, c, 1);</span><br><span>                                           } else if (!single && !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {</span><br><span>                                                       if (o->pending_connected_update) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                           if (ast_channel_connected_line_sub(c, in, &o->connected, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                   ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                if (ast_channel_connected_line_sub(c, in, &o->connected, 0)) {</span><br><span>                                                                        ast_channel_update_connected_line(in, &o->connected, NULL);</span><br><span>                                                           }</span><br><span>                                                    } else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {</span><br><span>@@ -1678,8 +1621,7 @@</span><br><span>                                              o->pending_connected_update = 1;</span><br><span>                                          break;</span><br><span>                                       }</span><br><span style="color: hsl(0, 100%, 40%);">-                                       if (ast_channel_connected_line_sub(c, in, f, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                              ast_channel_connected_line_macro(c, in, f, 1, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                   if (ast_channel_connected_line_sub(c, in, f, 1)) {</span><br><span>                                           ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);</span><br><span>                                    }</span><br><span>                                    break;</span><br><span>@@ -1708,8 +1650,7 @@</span><br><span>                                       }</span><br><span>                                    ast_verb(3, "%s redirecting info has changed, passing it to %s\n",</span><br><span>                                                 ast_channel_name(c), ast_channel_name(in));</span><br><span style="color: hsl(0, 100%, 40%);">-                                     if (ast_channel_redirecting_sub(c, in, f, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                         ast_channel_redirecting_macro(c, in, f, 1, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                      if (ast_channel_redirecting_sub(c, in, f, 1)) {</span><br><span>                                              ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);</span><br><span>                                       }</span><br><span>                                    pa->sentringing = 0;</span><br><span>@@ -1917,8 +1858,7 @@</span><br><span>                                                      ast_verb(3, "Connected line update to %s prevented.\n", ast_channel_name(o->chan));</span><br><span>                                                     break;</span><br><span>                                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                                               if (ast_channel_connected_line_sub(in, o->chan, f, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                     ast_channel_connected_line_macro(in, o->chan, f, 0, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                          if (ast_channel_connected_line_sub(in, o->chan, f, 1)) {</span><br><span>                                                  ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);</span><br><span>                                                }</span><br><span>                                            break;</span><br><span>@@ -1927,8 +1867,7 @@</span><br><span>                                                       ast_verb(3, "Redirecting update to %s prevented.\n", ast_channel_name(o->chan));</span><br><span>                                                        break;</span><br><span>                                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                                               if (ast_channel_redirecting_sub(in, o->chan, f, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                        ast_channel_redirecting_macro(in, o->chan, f, 0, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                             if (ast_channel_redirecting_sub(in, o->chan, f, 1)) {</span><br><span>                                                     ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);</span><br><span>                                                }</span><br><span>                                            break;</span><br><span>@@ -2485,7 +2424,7 @@</span><br><span>       if (ast_test_flag64(&opts, OPT_FORCECLID)) {</span><br><span>             if (ast_strlen_zero(opt_args[OPT_ARG_FORCECLID])) {</span><br><span>                  ast_channel_lock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-                 forced_clid.number.str = ast_strdupa(S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)));</span><br><span style="color: hsl(120, 100%, 40%);">+                    forced_clid.number.str = ast_strdupa(ast_channel_exten(chan));</span><br><span>                       ast_channel_unlock(chan);</span><br><span>                    forced_clid_name[0] = '\0';</span><br><span>                  forced_clid.name.str = (char *) get_cid_name(forced_clid_name,</span><br><span>@@ -2562,7 +2501,7 @@</span><br><span>                       stored_clid.name.valid = 1;</span><br><span>          }</span><br><span>            ast_channel_lock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-         stored_clid.number.str = ast_strdupa(S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)));</span><br><span style="color: hsl(120, 100%, 40%);">+            stored_clid.number.str = ast_strdupa(ast_channel_exten(chan));</span><br><span>               stored_clid.number.valid = 1;</span><br><span>                ast_channel_unlock(chan);</span><br><span>    }</span><br><span>@@ -2597,7 +2536,7 @@</span><br><span>    /* Set per dial instance flags.  These flags are also passed back to RetryDial. */</span><br><span>   ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID</span><br><span>                 | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING | OPT_CANCEL_TIMEOUT</span><br><span style="color: hsl(0, 100%, 40%);">-                | OPT_ANNOUNCE | OPT_CALLEE_MACRO | OPT_CALLEE_GOSUB | OPT_FORCECLID);</span><br><span style="color: hsl(120, 100%, 40%);">+                | OPT_ANNOUNCE | OPT_CALLEE_GOSUB | OPT_FORCECLID);</span><br><span> </span><br><span>      /* PREDIAL: Run gosub on the caller's channel */</span><br><span>         if (ast_test_flag64(&opts, OPT_PREDIAL_CALLER)</span><br><span>@@ -2823,11 +2762,8 @@</span><br><span> </span><br><span> </span><br><span>          /* Inherit context and extension */</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_channel_dialcontext_set(tc, ast_strlen_zero(ast_channel_macrocontext(chan)) ? ast_channel_context(chan) : ast_channel_macrocontext(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-          if (!ast_strlen_zero(ast_channel_macroexten(chan)))</span><br><span style="color: hsl(0, 100%, 40%);">-                     ast_channel_exten_set(tc, ast_channel_macroexten(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-                else</span><br><span style="color: hsl(0, 100%, 40%);">-                    ast_channel_exten_set(tc, ast_channel_exten(chan));</span><br><span style="color: hsl(120, 100%, 40%);">+           ast_channel_dialcontext_set(tc, ast_channel_context(chan));</span><br><span style="color: hsl(120, 100%, 40%);">+           ast_channel_exten_set(tc, ast_channel_exten(chan));</span><br><span> </span><br><span>              ast_channel_stage_snapshot_done(tc);</span><br><span> </span><br><span>@@ -3150,9 +3086,7 @@</span><br><span>                                                     } else {</span><br><span>                                                             other_chan = chan;</span><br><span>                                                   }</span><br><span style="color: hsl(0, 100%, 40%);">-                                                       if (ast_channel_connected_line_sub(active_chan, other_chan, fr, 1)</span><br><span style="color: hsl(0, 100%, 40%);">-                                                              && ast_channel_connected_line_macro(active_chan,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                        other_chan, fr, other_chan == chan, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                     if (ast_channel_connected_line_sub(active_chan, other_chan, fr, 1)) {</span><br><span>                                                                ast_indicate_data(other_chan, fr->subclass.integer,</span><br><span>                                                                       fr->data.ptr, fr->datalen);</span><br><span>                                                    }</span><br><span>@@ -3199,66 +3133,6 @@</span><br><span>                   goto done;</span><br><span>           }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-           if (ast_test_flag64(&opts, OPT_CALLEE_MACRO) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_MACRO])) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 const char *macro_result_peer;</span><br><span style="color: hsl(0, 100%, 40%);">-                  int macro_res;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                  /* Set peer->exten and peer->context so that MACRO_EXTEN and MACRO_CONTEXT get set */</span><br><span style="color: hsl(0, 100%, 40%);">-                     ast_channel_lock_both(chan, peer);</span><br><span style="color: hsl(0, 100%, 40%);">-                      ast_channel_context_set(peer, ast_channel_context(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-                       ast_channel_exten_set(peer, ast_channel_exten(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-                   ast_channel_unlock(peer);</span><br><span style="color: hsl(0, 100%, 40%);">-                       ast_channel_unlock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-                       ast_replace_subargument_delimiter(opt_args[OPT_ARG_CALLEE_MACRO]);</span><br><span style="color: hsl(0, 100%, 40%);">-                      macro_res = ast_app_exec_macro(chan, peer, opt_args[OPT_ARG_CALLEE_MACRO]);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                     ast_channel_lock(peer);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                 if (!macro_res && (macro_result_peer = pbx_builtin_getvar_helper(peer, "MACRO_RESULT"))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                            char *macro_result = ast_strdupa(macro_result_peer);</span><br><span style="color: hsl(0, 100%, 40%);">-                            char *macro_transfer_dest;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                              ast_channel_unlock(peer);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                               if (!strcasecmp(macro_result, "BUSY")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                      ast_copy_string(pa.status, macro_result, sizeof(pa.status));</span><br><span style="color: hsl(0, 100%, 40%);">-                                    ast_set_flag64(peerflags, OPT_GO_ON);</span><br><span style="color: hsl(0, 100%, 40%);">-                                   macro_res = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-                         } else if (!strcasecmp(macro_result, "CONGESTION") || !strcasecmp(macro_result, "CHANUNAVAIL")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                   ast_copy_string(pa.status, macro_result, sizeof(pa.status));</span><br><span style="color: hsl(0, 100%, 40%);">-                                    ast_set_flag64(peerflags, OPT_GO_ON);</span><br><span style="color: hsl(0, 100%, 40%);">-                                   macro_res = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-                         } else if (!strcasecmp(macro_result, "CONTINUE")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                   /* hangup peer and keep chan alive assuming the macro has changed</span><br><span style="color: hsl(0, 100%, 40%);">-                                          the context / exten / priority or perhaps</span><br><span style="color: hsl(0, 100%, 40%);">-                                       the next priority in the current exten is desired.</span><br><span style="color: hsl(0, 100%, 40%);">-                                   */</span><br><span style="color: hsl(0, 100%, 40%);">-                                      ast_set_flag64(peerflags, OPT_GO_ON);</span><br><span style="color: hsl(0, 100%, 40%);">-                                   macro_res = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-                         } else if (!strcasecmp(macro_result, "ABORT")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                      /* Hangup both ends unless the caller has the g flag */</span><br><span style="color: hsl(0, 100%, 40%);">-                                 macro_res = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-                         } else if (!strncasecmp(macro_result, "GOTO:", 5)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                  macro_transfer_dest = macro_result + 5;</span><br><span style="color: hsl(0, 100%, 40%);">-                                 macro_res = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-                                 /* perform a transfer to a new extension */</span><br><span style="color: hsl(0, 100%, 40%);">-                                     if (strchr(macro_transfer_dest, '^')) { /* context^exten^priority*/</span><br><span style="color: hsl(0, 100%, 40%);">-                                             ast_replace_subargument_delimiter(macro_transfer_dest);</span><br><span style="color: hsl(0, 100%, 40%);">-                                 }</span><br><span style="color: hsl(0, 100%, 40%);">-                                       if (!ast_parseable_goto(chan, macro_transfer_dest)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                           ast_set_flag64(peerflags, OPT_GO_ON);</span><br><span style="color: hsl(0, 100%, 40%);">-                                   }</span><br><span style="color: hsl(0, 100%, 40%);">-                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                               if (macro_res && !dial_end_raised) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                    ast_channel_publish_dial(chan, peer, NULL, macro_result);</span><br><span style="color: hsl(0, 100%, 40%);">-                                       dial_end_raised = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-                            }</span><br><span style="color: hsl(0, 100%, 40%);">-                       } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                                ast_channel_unlock(peer);</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-                       res = macro_res;</span><br><span style="color: hsl(0, 100%, 40%);">-                }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>            if (ast_test_flag64(&opts, OPT_CALLEE_GOSUB) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_GOSUB])) {</span><br><span>                      const char *gosub_result_peer;</span><br><span>                       char *gosub_argstart;</span><br><span>diff --git a/apps/app_directory.c b/apps/app_directory.c</span><br><span>index 36da702..d76d07a 100644</span><br><span>--- a/apps/app_directory.c</span><br><span>+++ b/apps/app_directory.c</span><br><span>@@ -267,9 +267,7 @@</span><br><span> </span><br><span> static int goto_exten(struct ast_channel *chan, const char *dialcontext, char *ext)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-        if (!ast_goto_if_exists(chan, S_OR(dialcontext, ast_channel_context(chan)), ext, 1) ||</span><br><span style="color: hsl(0, 100%, 40%);">-          (!ast_strlen_zero(ast_channel_macrocontext(chan)) &&</span><br><span style="color: hsl(0, 100%, 40%);">-            !ast_goto_if_exists(chan, ast_channel_macrocontext(chan), ext, 1))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!ast_goto_if_exists(chan, S_OR(dialcontext, ast_channel_context(chan)), ext, 1)) {</span><br><span>               return 0;</span><br><span>    } else {</span><br><span>             ast_log(LOG_WARNING, "Can't find extension '%s' in current context.  "</span><br><span>diff --git a/apps/app_followme.c b/apps/app_followme.c</span><br><span>index bc60b36..4b7862d 100644</span><br><span>--- a/apps/app_followme.c</span><br><span>+++ b/apps/app_followme.c</span><br><span>@@ -1527,8 +1527,7 @@</span><br><span> </span><br><span>            /* Update connected line to caller if available. */</span><br><span>          if (targs->pending_out_connected_update) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   if (ast_channel_connected_line_sub(outbound, caller, &targs->connected_out, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                ast_channel_connected_line_macro(outbound, caller, &targs->connected_out, 1, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     if (ast_channel_connected_line_sub(outbound, caller, &targs->connected_out, 0)) {</span><br><span>                             ast_channel_update_connected_line(caller, &targs->connected_out, NULL);</span><br><span>                       }</span><br><span>            }</span><br><span>@@ -1553,8 +1552,7 @@</span><br><span> </span><br><span>                /* Update connected line to winner if changed. */</span><br><span>            if (targs->pending_in_connected_update) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    if (ast_channel_connected_line_sub(caller, outbound, &targs->connected_in, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                         ast_channel_connected_line_macro(caller, outbound, &targs->connected_in, 0, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      if (ast_channel_connected_line_sub(caller, outbound, &targs->connected_in, 0)) {</span><br><span>                              ast_channel_update_connected_line(outbound, &targs->connected_in, NULL);</span><br><span>                      }</span><br><span>            }</span><br><span>diff --git a/apps/app_macro.c b/apps/app_macro.c</span><br><span>deleted file mode 100644</span><br><span>index b426cf8..0000000</span><br><span>--- a/apps/app_macro.c</span><br><span>+++ /dev/null</span><br><span>@@ -1,691 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-/*</span><br><span style="color: hsl(0, 100%, 40%);">- * Asterisk -- An open source telephony toolkit.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Copyright (C) 1999 - 2005, Digium, Inc.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Mark Spencer <markster@digium.com></span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * See http://www.asterisk.org for more information about</span><br><span style="color: hsl(0, 100%, 40%);">- * the Asterisk project. Please do not directly contact</span><br><span style="color: hsl(0, 100%, 40%);">- * any of the maintainers of this project for assistance;</span><br><span style="color: hsl(0, 100%, 40%);">- * the project provides a web site, mailing lists and IRC</span><br><span style="color: hsl(0, 100%, 40%);">- * channels for your use.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * This program is free software, distributed under the terms of</span><br><span style="color: hsl(0, 100%, 40%);">- * the GNU General Public License Version 2. See the LICENSE file</span><br><span style="color: hsl(0, 100%, 40%);">- * at the top of the source tree.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*! \file</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Dial plan macro Implementation</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \author Mark Spencer <markster@digium.com></span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \ingroup applications</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*** MODULEINFO</span><br><span style="color: hsl(0, 100%, 40%);">-        <defaultenabled>no</defaultenabled></span><br><span style="color: hsl(0, 100%, 40%);">- <support_level>deprecated</support_level></span><br><span style="color: hsl(0, 100%, 40%);">-   <replacement>app_stack (GoSub)</replacement></span><br><span style="color: hsl(0, 100%, 40%);">-        <deprecated_in>16</deprecated_in></span><br><span style="color: hsl(0, 100%, 40%);">-   <removed_in>21</removed_in></span><br><span style="color: hsl(0, 100%, 40%);">- ***/</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk.h"</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/file.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/channel.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/pbx.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/module.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/extconf.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/config.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/utils.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/lock.h"</span><br><span style="color: hsl(0, 100%, 40%);">-#include "asterisk/app.h"</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*** DOCUMENTATION</span><br><span style="color: hsl(0, 100%, 40%);">-      <application name="Macro" language="en_US"></span><br><span style="color: hsl(0, 100%, 40%);">-           <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-                        Macro Implementation.</span><br><span style="color: hsl(0, 100%, 40%);">-           </synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-               <syntax></span><br><span style="color: hsl(0, 100%, 40%);">-                  <parameter name="name" required="true"></span><br><span style="color: hsl(0, 100%, 40%);">-                               <para>The name of the macro</para></span><br><span style="color: hsl(0, 100%, 40%);">-                  </parameter></span><br><span style="color: hsl(0, 100%, 40%);">-                      <parameter name="args"></span><br><span style="color: hsl(0, 100%, 40%);">-                         <argument name="arg1" required="true" /></span><br><span style="color: hsl(0, 100%, 40%);">-                              <argument name="arg2" multiple="true" /></span><br><span style="color: hsl(0, 100%, 40%);">-                      </parameter></span><br><span style="color: hsl(0, 100%, 40%);">-              </syntax></span><br><span style="color: hsl(0, 100%, 40%);">-         <description></span><br><span style="color: hsl(0, 100%, 40%);">-                     <para>Executes a macro using the context macro-<replaceable>name</replaceable>,</span><br><span style="color: hsl(0, 100%, 40%);">-                       jumping to the <literal>s</literal> extension of that context and executing each step,</span><br><span style="color: hsl(0, 100%, 40%);">-                      then returning when the steps end.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                 <para>The calling extension, context, and priority are stored in <variable>MACRO_EXTEN</variable>,</span><br><span style="color: hsl(0, 100%, 40%);">-                    <variable>MACRO_CONTEXT</variable> and <variable>MACRO_PRIORITY</variable> respectively. Arguments</span><br><span style="color: hsl(0, 100%, 40%);">-                      become <variable>ARG1</variable>, <variable>ARG2</variable>, etc in the macro context.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                     <para>If you Goto out of the Macro context, the Macro will terminate and control will be returned</span><br><span style="color: hsl(0, 100%, 40%);">-                 at the location of the Goto.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                       <para>If <variable>MACRO_OFFSET</variable> is set at termination, Macro will attempt to continue</span><br><span style="color: hsl(0, 100%, 40%);">-                      at priority MACRO_OFFSET + N + 1 if such a step exists, and N + 1 otherwise.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                       <warning><para>Because of the way Macro is implemented (it executes the priorities contained within</span><br><span style="color: hsl(0, 100%, 40%);">-                 it via sub-engine), and a fixed per-thread memory stack allowance, macros are limited to 7 levels</span><br><span style="color: hsl(0, 100%, 40%);">-                       of nesting (macro calling macro calling macro, etc.); It may be possible that stack-intensive</span><br><span style="color: hsl(0, 100%, 40%);">-                   applications in deeply nested macros could cause asterisk to crash earlier than this limit.</span><br><span style="color: hsl(0, 100%, 40%);">-                     It is advised that if you need to deeply nest macro calls, that you use the Gosub application</span><br><span style="color: hsl(0, 100%, 40%);">-                   (now allows arguments like a Macro) with explicit Return() calls instead.</para></warning></span><br><span style="color: hsl(0, 100%, 40%);">-                  <warning><para>Use of the application <literal>WaitExten</literal> within a macro will not function</span><br><span style="color: hsl(0, 100%, 40%);">-                     as expected. Please use the <literal>Read</literal> application in order to read DTMF from a channel</span><br><span style="color: hsl(0, 100%, 40%);">-                        currently executing a macro.</para></warning></span><br><span style="color: hsl(0, 100%, 40%);">-               </description></span><br><span style="color: hsl(0, 100%, 40%);">-            <see-also></span><br><span style="color: hsl(0, 100%, 40%);">-                        <ref type="application">MacroExit</ref></span><br><span style="color: hsl(0, 100%, 40%);">-                   <ref type="application">Goto</ref></span><br><span style="color: hsl(0, 100%, 40%);">-                        <ref type="application">Gosub</ref></span><br><span style="color: hsl(0, 100%, 40%);">-               </see-also></span><br><span style="color: hsl(0, 100%, 40%);">-       </application></span><br><span style="color: hsl(0, 100%, 40%);">-    <application name="MacroIf" language="en_US"></span><br><span style="color: hsl(0, 100%, 40%);">-         <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-                        Conditional Macro implementation.</span><br><span style="color: hsl(0, 100%, 40%);">-               </synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-               <syntax argsep="?"></span><br><span style="color: hsl(0, 100%, 40%);">-                     <parameter name="expr" required="true" /></span><br><span style="color: hsl(0, 100%, 40%);">-                     <parameter name="destination" required="true" argsep=":"></span><br><span style="color: hsl(0, 100%, 40%);">-                           <argument name="macroiftrue" required="true"></span><br><span style="color: hsl(0, 100%, 40%);">-                                 <argument name="macroiftrue" required="true" /></span><br><span style="color: hsl(0, 100%, 40%);">-                                       <argument name="arg1" multiple="true" /></span><br><span style="color: hsl(0, 100%, 40%);">-                              </argument></span><br><span style="color: hsl(0, 100%, 40%);">-                               <argument name="macroiffalse"></span><br><span style="color: hsl(0, 100%, 40%);">-                                  <argument name="macroiffalse" required="true" /></span><br><span style="color: hsl(0, 100%, 40%);">-                                      <argument name="arg1" multiple="true" /></span><br><span style="color: hsl(0, 100%, 40%);">-                              </argument></span><br><span style="color: hsl(0, 100%, 40%);">-                       </parameter></span><br><span style="color: hsl(0, 100%, 40%);">-              </syntax></span><br><span style="color: hsl(0, 100%, 40%);">-         <description></span><br><span style="color: hsl(0, 100%, 40%);">-                     <para>Executes macro defined in <replaceable>macroiftrue</replaceable> if</span><br><span style="color: hsl(0, 100%, 40%);">-                     <replaceable>expr</replaceable> is true (otherwise <replaceable>macroiffalse</replaceable></span><br><span style="color: hsl(0, 100%, 40%);">-                      if provided)</para></span><br><span style="color: hsl(0, 100%, 40%);">-                       <para>Arguments and return values as in application Macro()</para></span><br><span style="color: hsl(0, 100%, 40%);">-                  <xi:include xpointer="xpointer(/docs/application[@name='Macro']/description/warning[2])" /></span><br><span style="color: hsl(0, 100%, 40%);">-             </description></span><br><span style="color: hsl(0, 100%, 40%);">-            <see-also></span><br><span style="color: hsl(0, 100%, 40%);">-                        <ref type="application">GotoIf</ref></span><br><span style="color: hsl(0, 100%, 40%);">-                      <ref type="application">GosubIf</ref></span><br><span style="color: hsl(0, 100%, 40%);">-                     <ref type="function">IF</ref></span><br><span style="color: hsl(0, 100%, 40%);">-             </see-also></span><br><span style="color: hsl(0, 100%, 40%);">-       </application></span><br><span style="color: hsl(0, 100%, 40%);">-    <application name="MacroExclusive" language="en_US"></span><br><span style="color: hsl(0, 100%, 40%);">-          <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-                        Exclusive Macro Implementation.</span><br><span style="color: hsl(0, 100%, 40%);">-         </synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-               <syntax></span><br><span style="color: hsl(0, 100%, 40%);">-                  <parameter name="name" required="true"></span><br><span style="color: hsl(0, 100%, 40%);">-                               <para>The name of the macro</para></span><br><span style="color: hsl(0, 100%, 40%);">-                  </parameter></span><br><span style="color: hsl(0, 100%, 40%);">-                      <parameter name="arg1" /></span><br><span style="color: hsl(0, 100%, 40%);">-                       <parameter name="arg2" multiple="true" /></span><br><span style="color: hsl(0, 100%, 40%);">-             </syntax></span><br><span style="color: hsl(0, 100%, 40%);">-         <description></span><br><span style="color: hsl(0, 100%, 40%);">-                     <para>Executes macro defined in the context macro-<replaceable>name</replaceable>.</span><br><span style="color: hsl(0, 100%, 40%);">-                    Only one call at a time may run the macro. (we'll wait if another call is busy</span><br><span style="color: hsl(0, 100%, 40%);">-                      executing in the Macro)</para></span><br><span style="color: hsl(0, 100%, 40%);">-                    <para>Arguments and return values as in application Macro()</para></span><br><span style="color: hsl(0, 100%, 40%);">-                  <xi:include xpointer="xpointer(/docs/application[@name='Macro']/description/warning[2])" /></span><br><span style="color: hsl(0, 100%, 40%);">-             </description></span><br><span style="color: hsl(0, 100%, 40%);">-            <see-also></span><br><span style="color: hsl(0, 100%, 40%);">-                        <ref type="application">Macro</ref></span><br><span style="color: hsl(0, 100%, 40%);">-               </see-also></span><br><span style="color: hsl(0, 100%, 40%);">-       </application></span><br><span style="color: hsl(0, 100%, 40%);">-    <application name="MacroExit" language="en_US"></span><br><span style="color: hsl(0, 100%, 40%);">-               <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-                        Exit from Macro.</span><br><span style="color: hsl(0, 100%, 40%);">-                </synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-               <syntax /></span><br><span style="color: hsl(0, 100%, 40%);">-                <description></span><br><span style="color: hsl(0, 100%, 40%);">-                     <para>Causes the currently running macro to exit as if it had</span><br><span style="color: hsl(0, 100%, 40%);">-                     ended normally by running out of priorities to execute.</span><br><span style="color: hsl(0, 100%, 40%);">-                 If used outside a macro, will likely cause unexpected behavior.</para></span><br><span style="color: hsl(0, 100%, 40%);">-            </description></span><br><span style="color: hsl(0, 100%, 40%);">-            <see-also></span><br><span style="color: hsl(0, 100%, 40%);">-                        <ref type="application">Macro</ref></span><br><span style="color: hsl(0, 100%, 40%);">-               </see-also></span><br><span style="color: hsl(0, 100%, 40%);">-       </application></span><br><span style="color: hsl(0, 100%, 40%);">- ***/</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#define MAX_ARGS 80</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/* special result value used to force macro exit */</span><br><span style="color: hsl(0, 100%, 40%);">-#define MACRO_EXIT_RESULT 1024</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static char *app = "Macro";</span><br><span style="color: hsl(0, 100%, 40%);">-static char *if_app = "MacroIf";</span><br><span style="color: hsl(0, 100%, 40%);">-static char *exclusive_app = "MacroExclusive";</span><br><span style="color: hsl(0, 100%, 40%);">-static char *exit_app = "MacroExit";</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static void macro_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static const struct ast_datastore_info macro_ds_info = {</span><br><span style="color: hsl(0, 100%, 40%);">-      .type = "MACRO",</span><br><span style="color: hsl(0, 100%, 40%);">-      .chan_fixup = macro_fixup,</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static void macro_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-    int i;</span><br><span style="color: hsl(0, 100%, 40%);">-  char varname[10];</span><br><span style="color: hsl(0, 100%, 40%);">-       pbx_builtin_setvar_helper(new_chan, "MACRO_DEPTH", "0");</span><br><span style="color: hsl(0, 100%, 40%);">-    pbx_builtin_setvar_helper(new_chan, "MACRO_CONTEXT", NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-   pbx_builtin_setvar_helper(new_chan, "MACRO_EXTEN", NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-     pbx_builtin_setvar_helper(new_chan, "MACRO_PRIORITY", NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-  pbx_builtin_setvar_helper(new_chan, "MACRO_OFFSET", NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-    for (i = 1; i < 100; i++) {</span><br><span style="color: hsl(0, 100%, 40%);">-          snprintf(varname, sizeof(varname), "ARG%d", i);</span><br><span style="color: hsl(0, 100%, 40%);">-               while (pbx_builtin_getvar_helper(new_chan, varname)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  /* Kill all levels of arguments */</span><br><span style="color: hsl(0, 100%, 40%);">-                      pbx_builtin_setvar_helper(new_chan, varname, NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-             }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static struct ast_exten *find_matching_priority(struct ast_context *c, const char *exten,</span><br><span style="color: hsl(0, 100%, 40%);">-     int priority, const char *callerid, int iter, int *had_error)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-  struct ast_exten *e;</span><br><span style="color: hsl(0, 100%, 40%);">-    struct ast_context *c2;</span><br><span style="color: hsl(0, 100%, 40%);">- int idx;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        if (iter >= AST_PBX_MAX_STACK) {</span><br><span style="color: hsl(0, 100%, 40%);">-             if (!(*had_error)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    *had_error = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-                 ast_log(LOG_ERROR, "Potential infinite loop detected, will not recurse further.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-          }</span><br><span style="color: hsl(0, 100%, 40%);">-               return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       for (e=ast_walk_context_extensions(c, NULL); e; e=ast_walk_context_extensions(c, e)) {</span><br><span style="color: hsl(0, 100%, 40%);">-          if (ast_extension_match(ast_get_extension_name(e), exten)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    int needmatch = ast_get_extension_matchcid(e);</span><br><span style="color: hsl(0, 100%, 40%);">-                  if ((needmatch && ast_extension_match(ast_get_extension_cidmatch(e), callerid)) ||</span><br><span style="color: hsl(0, 100%, 40%);">-                              (!needmatch)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                         /* This is the matching extension we want */</span><br><span style="color: hsl(0, 100%, 40%);">-                            struct ast_exten *p;</span><br><span style="color: hsl(0, 100%, 40%);">-                            for (p=ast_walk_extension_priorities(e, NULL); p; p=ast_walk_extension_priorities(e, p)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                      if (priority != ast_get_extension_priority(p))</span><br><span style="color: hsl(0, 100%, 40%);">-                                          continue;</span><br><span style="color: hsl(0, 100%, 40%);">-                                       return p;</span><br><span style="color: hsl(0, 100%, 40%);">-                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* No match; run through includes */</span><br><span style="color: hsl(0, 100%, 40%);">-    for (idx = 0; idx < ast_context_includes_count(c); idx++) {</span><br><span style="color: hsl(0, 100%, 40%);">-          const struct ast_include *i = ast_context_includes_get(c, idx);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-         for (c2=ast_walk_contexts(NULL); c2; c2=ast_walk_contexts(c2)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                        if (!strcmp(ast_get_context_name(c2), ast_get_include_name(i))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                               e = find_matching_priority(c2, exten, priority, callerid, iter + 1, had_error);</span><br><span style="color: hsl(0, 100%, 40%);">-                         if (e)</span><br><span style="color: hsl(0, 100%, 40%);">-                                  return e;</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-       return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- const char *s;</span><br><span style="color: hsl(0, 100%, 40%);">-  char *tmp;</span><br><span style="color: hsl(0, 100%, 40%);">-      char *cur, *rest;</span><br><span style="color: hsl(0, 100%, 40%);">-       char *macro;</span><br><span style="color: hsl(0, 100%, 40%);">-    char fullmacro[80];</span><br><span style="color: hsl(0, 100%, 40%);">-     char varname[80];</span><br><span style="color: hsl(0, 100%, 40%);">-       char runningapp[80], runningdata[1024];</span><br><span style="color: hsl(0, 100%, 40%);">- char *oldargs[MAX_ARGS + 1] = { NULL, };</span><br><span style="color: hsl(0, 100%, 40%);">-        int argc, x;</span><br><span style="color: hsl(0, 100%, 40%);">-    int res=0;</span><br><span style="color: hsl(0, 100%, 40%);">-      char oldexten[256]="";</span><br><span style="color: hsl(0, 100%, 40%);">-        int oldpriority, gosub_level = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-       char pc[80], depthc[12];</span><br><span style="color: hsl(0, 100%, 40%);">-        char oldcontext[AST_MAX_CONTEXT] = "";</span><br><span style="color: hsl(0, 100%, 40%);">-        const char *inhangupc;</span><br><span style="color: hsl(0, 100%, 40%);">-  int offset, depth = 0, maxdepth = 7;</span><br><span style="color: hsl(0, 100%, 40%);">-    int setmacrocontext=0;</span><br><span style="color: hsl(0, 100%, 40%);">-  int autoloopflag, inhangup = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_str *tmp_subst = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-       const char *my_macro_exten = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-      char *save_macro_exten;</span><br><span style="color: hsl(0, 100%, 40%);">- char *save_macro_context;</span><br><span style="color: hsl(0, 100%, 40%);">-       char *save_macro_priority;</span><br><span style="color: hsl(0, 100%, 40%);">-      char *save_macro_offset;</span><br><span style="color: hsl(0, 100%, 40%);">-        int save_in_subroutine;</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_datastore *macro_store = ast_channel_datastore_find(chan, &macro_ds_info, NULL);</span><br><span style="color: hsl(0, 100%, 40%);">- int had_infinite_include_error = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-     static int deprecation_notice = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      if (ast_strlen_zero(data)) {</span><br><span style="color: hsl(0, 100%, 40%);">-            ast_log(LOG_WARNING, "Macro() requires arguments. See \"core show application macro\" for help.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (!deprecation_notice) {</span><br><span style="color: hsl(0, 100%, 40%);">-              deprecation_notice = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_log(LOG_WARNING, "Macro() is deprecated and will be removed from a future version of Asterisk.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_log(LOG_WARNING, "Dialplan should be updated to use Gosub instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-   }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       do {</span><br><span style="color: hsl(0, 100%, 40%);">-            if (macro_store) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      break;</span><br><span style="color: hsl(0, 100%, 40%);">-          }</span><br><span style="color: hsl(0, 100%, 40%);">-               if (!(macro_store = ast_datastore_alloc(&macro_ds_info, NULL))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   ast_log(LOG_WARNING, "Unable to allocate new datastore.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                  break;</span><br><span style="color: hsl(0, 100%, 40%);">-          }</span><br><span style="color: hsl(0, 100%, 40%);">-               /* Just the existence of this datastore is enough. */</span><br><span style="color: hsl(0, 100%, 40%);">-           macro_store->inheritance = DATASTORE_INHERIT_FOREVER;</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_channel_datastore_add(chan, macro_store);</span><br><span style="color: hsl(0, 100%, 40%);">-   } while (0);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    /* does the user want a deeper rabbit hole? */</span><br><span style="color: hsl(0, 100%, 40%);">-  ast_channel_lock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- if ((s = pbx_builtin_getvar_helper(chan, "MACRO_RECURSION"))) {</span><br><span style="color: hsl(0, 100%, 40%);">-               sscanf(s, "%30d", &maxdepth);</span><br><span style="color: hsl(0, 100%, 40%);">-     }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Count how many levels deep the rabbit hole goes */</span><br><span style="color: hsl(0, 100%, 40%);">-   if ((s = pbx_builtin_getvar_helper(chan, "MACRO_DEPTH"))) {</span><br><span style="color: hsl(0, 100%, 40%);">-           sscanf(s, "%30d", &depth);</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Used for detecting whether to return when a Macro is called from another Macro after hangup */</span><br><span style="color: hsl(0, 100%, 40%);">-       if (strcmp(ast_channel_exten(chan), "h") == 0)</span><br><span style="color: hsl(0, 100%, 40%);">-                pbx_builtin_setvar_helper(chan, "MACRO_IN_HANGUP", "1");</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    if ((inhangupc = pbx_builtin_getvar_helper(chan, "MACRO_IN_HANGUP"))) {</span><br><span style="color: hsl(0, 100%, 40%);">-               sscanf(inhangupc, "%30d", &inhangup);</span><br><span style="color: hsl(0, 100%, 40%);">-     }</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_channel_unlock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (depth >= maxdepth) {</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_log(LOG_ERROR, "Macro():  possible infinite loop detected.  Returning early.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-         return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-       snprintf(depthc, sizeof(depthc), "%d", depth + 1);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    tmp = ast_strdupa(data);</span><br><span style="color: hsl(0, 100%, 40%);">-        rest = tmp;</span><br><span style="color: hsl(0, 100%, 40%);">-     macro = strsep(&rest, ",");</span><br><span style="color: hsl(0, 100%, 40%);">-       if (ast_strlen_zero(macro)) {</span><br><span style="color: hsl(0, 100%, 40%);">-           ast_log(LOG_WARNING, "Invalid macro name specified\n");</span><br><span style="color: hsl(0, 100%, 40%);">-               return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       snprintf(fullmacro, sizeof(fullmacro), "macro-%s", macro);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    /* first search for the macro */</span><br><span style="color: hsl(0, 100%, 40%);">-        if (!ast_context_find(fullmacro)) {</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_log(LOG_WARNING, "No such context '%s' for macro '%s'. Was called by %s@%s\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                    fullmacro, macro, ast_channel_exten(chan), ast_channel_context(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-          return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* now search for the right extension */</span><br><span style="color: hsl(0, 100%, 40%);">-        if (ast_exists_extension(chan, fullmacro, "s", 1,</span><br><span style="color: hsl(0, 100%, 40%);">-             S_COR(ast_channel_caller(chan)->id.number.valid,</span><br><span style="color: hsl(0, 100%, 40%);">-                     ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span style="color: hsl(0, 100%, 40%);">-           /* We have a normal macro */</span><br><span style="color: hsl(0, 100%, 40%);">-            my_macro_exten = "s";</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (ast_exists_extension(chan, fullmacro, "~~s~~", 1,</span><br><span style="color: hsl(0, 100%, 40%);">-          S_COR(ast_channel_caller(chan)->id.number.valid,</span><br><span style="color: hsl(0, 100%, 40%);">-                     ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span style="color: hsl(0, 100%, 40%);">-           /* We have an AEL generated macro */</span><br><span style="color: hsl(0, 100%, 40%);">-            my_macro_exten = "~~s~~";</span><br><span style="color: hsl(0, 100%, 40%);">-     }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* do we have a valid exten? */</span><br><span style="color: hsl(0, 100%, 40%);">- if (!my_macro_exten) {</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_log(LOG_WARNING,</span><br><span style="color: hsl(0, 100%, 40%);">-                    "Context '%s' for macro '%s' lacks 's' extension, priority 1\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                      fullmacro, macro);</span><br><span style="color: hsl(0, 100%, 40%);">-              return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* If we are to run the macro exclusively, take the mutex */</span><br><span style="color: hsl(0, 100%, 40%);">-    if (exclusive) {</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_debug(1, "Locking macrolock for '%s'\n", fullmacro);</span><br><span style="color: hsl(0, 100%, 40%);">-              ast_autoservice_start(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-            if (ast_context_lockmacro(fullmacro)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 ast_log(LOG_WARNING, "Failed to lock macro '%s' as in-use\n", fullmacro);</span><br><span style="color: hsl(0, 100%, 40%);">-                     ast_autoservice_stop(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-                     return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_autoservice_stop(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-     }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (!(tmp_subst = ast_str_create(16))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Save old info */</span><br><span style="color: hsl(0, 100%, 40%);">-     ast_channel_lock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- oldpriority = ast_channel_priority(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_copy_string(oldexten, ast_channel_exten(chan), sizeof(oldexten));</span><br><span style="color: hsl(0, 100%, 40%);">-   ast_copy_string(oldcontext, ast_channel_context(chan), sizeof(oldcontext));</span><br><span style="color: hsl(0, 100%, 40%);">-     if (ast_strlen_zero(ast_channel_macrocontext(chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_channel_macrocontext_set(chan, ast_channel_context(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_channel_macroexten_set(chan, ast_channel_exten(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-              ast_channel_macropriority_set(chan, ast_channel_priority(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-                setmacrocontext=1;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-       argc = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Save old macro variables */</span><br><span style="color: hsl(0, 100%, 40%);">-  save_macro_exten = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_EXTEN"));</span><br><span style="color: hsl(0, 100%, 40%);">-        pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", oldexten);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     save_macro_context = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_CONTEXT"));</span><br><span style="color: hsl(0, 100%, 40%);">-    pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", oldcontext);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- save_macro_priority = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_PRIORITY"));</span><br><span style="color: hsl(0, 100%, 40%);">-  snprintf(pc, sizeof(pc), "%d", oldpriority);</span><br><span style="color: hsl(0, 100%, 40%);">-  pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", pc);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        save_macro_offset = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"));</span><br><span style="color: hsl(0, 100%, 40%);">-      pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       save_in_subroutine = ast_test_flag(ast_channel_flags(chan), AST_FLAG_SUBROUTINE_EXEC);</span><br><span style="color: hsl(0, 100%, 40%);">-  ast_set_flag(ast_channel_flags(chan), AST_FLAG_SUBROUTINE_EXEC);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        /* Setup environment for new run */</span><br><span style="color: hsl(0, 100%, 40%);">-     ast_channel_exten_set(chan, my_macro_exten);</span><br><span style="color: hsl(0, 100%, 40%);">-    ast_channel_context_set(chan, fullmacro);</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_channel_priority_set(chan, 1);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      while((cur = strsep(&rest, ",")) && (argc < MAX_ARGS)) {</span><br><span style="color: hsl(0, 100%, 40%);">-               const char *argp;</span><br><span style="color: hsl(0, 100%, 40%);">-               /* Save copy of old arguments if we're overwriting some, otherwise</span><br><span style="color: hsl(0, 100%, 40%);">-          let them pass through to the other macro */</span><br><span style="color: hsl(0, 100%, 40%);">-             snprintf(varname, sizeof(varname), "ARG%d", argc);</span><br><span style="color: hsl(0, 100%, 40%);">-            if ((argp = pbx_builtin_getvar_helper(chan, varname))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                        oldargs[argc] = ast_strdup(argp);</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-               pbx_builtin_setvar_helper(chan, varname, cur);</span><br><span style="color: hsl(0, 100%, 40%);">-          argc++;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-       autoloopflag = ast_test_flag(ast_channel_flags(chan), AST_FLAG_IN_AUTOLOOP);</span><br><span style="color: hsl(0, 100%, 40%);">-    ast_set_flag(ast_channel_flags(chan), AST_FLAG_IN_AUTOLOOP);</span><br><span style="color: hsl(0, 100%, 40%);">-    ast_channel_unlock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       while (ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan),</span><br><span style="color: hsl(0, 100%, 40%);">-               S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span style="color: hsl(0, 100%, 40%);">-               struct ast_context *c;</span><br><span style="color: hsl(0, 100%, 40%);">-          struct ast_exten *e;</span><br><span style="color: hsl(0, 100%, 40%);">-            int foundx;</span><br><span style="color: hsl(0, 100%, 40%);">-             runningapp[0] = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">-           runningdata[0] = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-          /* What application will execute? */</span><br><span style="color: hsl(0, 100%, 40%);">-            if (ast_rdlock_contexts()) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    ast_log(LOG_WARNING, "Failed to lock contexts list\n");</span><br><span style="color: hsl(0, 100%, 40%);">-               } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                        for (c = ast_walk_contexts(NULL), e = NULL; c; c = ast_walk_contexts(c)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                              if (!strcmp(ast_get_context_name(c), ast_channel_context(chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                      if (ast_rdlock_context(c)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                            ast_log(LOG_WARNING, "Unable to lock context?\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                                    } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                e = find_matching_priority(c, ast_channel_exten(chan), ast_channel_priority(chan),</span><br><span style="color: hsl(0, 100%, 40%);">-                                                      S_COR(ast_channel_caller(chan)->id.number.valid,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                     ast_channel_caller(chan)->id.number.str, NULL),</span><br><span style="color: hsl(0, 100%, 40%);">-                                                      0, &had_infinite_include_error);</span><br><span style="color: hsl(0, 100%, 40%);">-                                            if (e) { /* This will only be undefined for pbx_realtime, which is majorly broken. */</span><br><span style="color: hsl(0, 100%, 40%);">-                                                   ast_copy_string(runningapp, ast_get_extension_app(e), sizeof(runningapp));</span><br><span style="color: hsl(0, 100%, 40%);">-                                                      ast_copy_string(runningdata, ast_get_extension_app_data(e), sizeof(runningdata));</span><br><span style="color: hsl(0, 100%, 40%);">-                                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                                               ast_unlock_context(c);</span><br><span style="color: hsl(0, 100%, 40%);">-                                  }</span><br><span style="color: hsl(0, 100%, 40%);">-                                       break;</span><br><span style="color: hsl(0, 100%, 40%);">-                          }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_unlock_contexts();</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-          /* Reset the macro depth, if it was changed in the last iteration */</span><br><span style="color: hsl(0, 100%, 40%);">-            pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-               res = ast_spawn_extension(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan),</span><br><span style="color: hsl(0, 100%, 40%);">-                 S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL),</span><br><span style="color: hsl(0, 100%, 40%);">-                  &foundx, 1);</span><br><span style="color: hsl(0, 100%, 40%);">-                if (res) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      /* Something bad happened, or a hangup has been requested. */</span><br><span style="color: hsl(0, 100%, 40%);">-                   if (((res >= '0') && (res <= '9')) || ((res >= 'A') && (res <= 'F')) ||</span><br><span style="color: hsl(0, 100%, 40%);">-                     (res == '*') || (res == '#')) {</span><br><span style="color: hsl(0, 100%, 40%);">-                         /* Just return result as to the previous application as if it had been dialed */</span><br><span style="color: hsl(0, 100%, 40%);">-                                ast_debug(1, "Oooh, got something to jump out with ('%c')!\n", res);</span><br><span style="color: hsl(0, 100%, 40%);">-                          break;</span><br><span style="color: hsl(0, 100%, 40%);">-                  }</span><br><span style="color: hsl(0, 100%, 40%);">-                       switch(res) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   case MACRO_EXIT_RESULT:</span><br><span style="color: hsl(0, 100%, 40%);">-                         res = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-                                goto out;</span><br><span style="color: hsl(0, 100%, 40%);">-                       default:</span><br><span style="color: hsl(0, 100%, 40%);">-                                ast_debug(2, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), ast_channel_name(chan), macro);</span><br><span style="color: hsl(0, 100%, 40%);">-                            ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), ast_channel_name(chan), macro);</span><br><span style="color: hsl(0, 100%, 40%);">-                           goto out;</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_debug(1, "Executed application: %s\n", runningapp);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-               if (!strcasecmp(runningapp, "GOSUB")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                       gosub_level++;</span><br><span style="color: hsl(0, 100%, 40%);">-                  ast_debug(1, "Incrementing gosub_level\n");</span><br><span style="color: hsl(0, 100%, 40%);">-           } else if (!strcasecmp(runningapp, "GOSUBIF")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      char *cond, *app_arg;</span><br><span style="color: hsl(0, 100%, 40%);">-                   char *app2;</span><br><span style="color: hsl(0, 100%, 40%);">-                     ast_str_substitute_variables(&tmp_subst, 0, chan, runningdata);</span><br><span style="color: hsl(0, 100%, 40%);">-                     app2 = ast_str_buffer(tmp_subst);</span><br><span style="color: hsl(0, 100%, 40%);">-                       cond = strsep(&app2, "?");</span><br><span style="color: hsl(0, 100%, 40%);">-                        app_arg = strsep(&app2, ":");</span><br><span style="color: hsl(0, 100%, 40%);">-                     if (pbx_checkcondition(cond)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                         if (!ast_strlen_zero(app_arg)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                        gosub_level++;</span><br><span style="color: hsl(0, 100%, 40%);">-                                  ast_debug(1, "Incrementing gosub_level\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                           }</span><br><span style="color: hsl(0, 100%, 40%);">-                       } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                                if (!ast_strlen_zero(app2)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                   gosub_level++;</span><br><span style="color: hsl(0, 100%, 40%);">-                                  ast_debug(1, "Incrementing gosub_level\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                           }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               } else if (!strcasecmp(runningapp, "RETURN")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                       gosub_level--;</span><br><span style="color: hsl(0, 100%, 40%);">-                  ast_debug(1, "Decrementing gosub_level\n");</span><br><span style="color: hsl(0, 100%, 40%);">-           } else if (!strcasecmp(runningapp, "STACKPOP")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     gosub_level--;</span><br><span style="color: hsl(0, 100%, 40%);">-                  ast_debug(1, "Decrementing gosub_level\n");</span><br><span style="color: hsl(0, 100%, 40%);">-           } else if (!strncasecmp(runningapp, "EXEC", 4)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     /* Must evaluate args to find actual app */</span><br><span style="color: hsl(0, 100%, 40%);">-                     char *tmp2, *tmp3 = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-                       ast_str_substitute_variables(&tmp_subst, 0, chan, runningdata);</span><br><span style="color: hsl(0, 100%, 40%);">-                     tmp2 = ast_str_buffer(tmp_subst);</span><br><span style="color: hsl(0, 100%, 40%);">-                       if (!strcasecmp(runningapp, "EXECIF")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                              if ((tmp3 = strchr(tmp2, '|'))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                       *tmp3++ = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">-                         }</span><br><span style="color: hsl(0, 100%, 40%);">-                               if (!pbx_checkcondition(tmp2)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                        tmp3 = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-                            }</span><br><span style="color: hsl(0, 100%, 40%);">-                       } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                                tmp3 = tmp2;</span><br><span style="color: hsl(0, 100%, 40%);">-                    }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                       if (tmp3) {</span><br><span style="color: hsl(0, 100%, 40%);">-                             ast_debug(1, "Last app: %s\n", tmp3);</span><br><span style="color: hsl(0, 100%, 40%);">-                 }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                       if (tmp3 && !strncasecmp(tmp3, "GOSUB", 5)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                         gosub_level++;</span><br><span style="color: hsl(0, 100%, 40%);">-                          ast_debug(1, "Incrementing gosub_level\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                   } else if (tmp3 && !strncasecmp(tmp3, "RETURN", 6)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                         gosub_level--;</span><br><span style="color: hsl(0, 100%, 40%);">-                          ast_debug(1, "Decrementing gosub_level\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                   } else if (tmp3 && !strncasecmp(tmp3, "STACKPOP", 8)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                               gosub_level--;</span><br><span style="color: hsl(0, 100%, 40%);">-                          ast_debug(1, "Decrementing gosub_level\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                   }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-               if (gosub_level == 0 && strcasecmp(ast_channel_context(chan), fullmacro)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     ast_verb(2, "Channel '%s' jumping out of macro '%s'\n", ast_channel_name(chan), macro);</span><br><span style="color: hsl(0, 100%, 40%);">-                       break;</span><br><span style="color: hsl(0, 100%, 40%);">-          }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-               /* don't stop executing extensions when we're in "h" */</span><br><span style="color: hsl(0, 100%, 40%);">-               if (ast_check_hangup(chan) && !inhangup) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      ast_debug(1, "Extension %s, macroexten %s, priority %d returned normally even though call was hung up\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                             ast_channel_exten(chan),</span><br><span style="color: hsl(0, 100%, 40%);">-                                ast_channel_macroexten(chan),</span><br><span style="color: hsl(0, 100%, 40%);">-                           ast_channel_priority(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-                    goto out;</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_channel_priority_set(chan, ast_channel_priority(chan) + 1);</span><br><span style="color: hsl(0, 100%, 40%);">-         }</span><br><span style="color: hsl(0, 100%, 40%);">-       out:</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    /* Don't let the channel change now. */</span><br><span style="color: hsl(0, 100%, 40%);">-     ast_channel_lock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- /* Reset the depth back to what it was when the routine was entered (like if we called Macro recursively) */</span><br><span style="color: hsl(0, 100%, 40%);">-    snprintf(depthc, sizeof(depthc), "%d", depth);</span><br><span style="color: hsl(0, 100%, 40%);">-        pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_set2_flag(ast_channel_flags(chan), autoloopflag, AST_FLAG_IN_AUTOLOOP);</span><br><span style="color: hsl(0, 100%, 40%);">-     ast_set2_flag(ast_channel_flags(chan), save_in_subroutine, AST_FLAG_SUBROUTINE_EXEC);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   for (x = 1; x < argc; x++) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 /* Restore old arguments and delete ours */</span><br><span style="color: hsl(0, 100%, 40%);">-             snprintf(varname, sizeof(varname), "ARG%d", x);</span><br><span style="color: hsl(0, 100%, 40%);">-               pbx_builtin_setvar_helper(chan, varname, oldargs[x]);</span><br><span style="color: hsl(0, 100%, 40%);">-           ast_free(oldargs[x]);</span><br><span style="color: hsl(0, 100%, 40%);">-   }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Restore macro variables */</span><br><span style="color: hsl(0, 100%, 40%);">-   pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);</span><br><span style="color: hsl(0, 100%, 40%);">-     pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);</span><br><span style="color: hsl(0, 100%, 40%);">- pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_free(save_macro_exten);</span><br><span style="color: hsl(0, 100%, 40%);">-     ast_free(save_macro_context);</span><br><span style="color: hsl(0, 100%, 40%);">-   ast_free(save_macro_priority);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-  if (setmacrocontext) {</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_channel_macrocontext_set(chan, "");</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_channel_macroexten_set(chan, "");</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_channel_macropriority_set(chan, 0);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (!strcasecmp(ast_channel_context(chan), fullmacro)</span><br><span style="color: hsl(0, 100%, 40%);">-           && !(ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_ASYNCGOTO)) {</span><br><span style="color: hsl(0, 100%, 40%);">-              const char *offsets;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-            /* If we're leaving the macro normally, restore original information */</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_channel_priority_set(chan, oldpriority);</span><br><span style="color: hsl(0, 100%, 40%);">-            ast_channel_context_set(chan, oldcontext);</span><br><span style="color: hsl(0, 100%, 40%);">-              ast_channel_exten_set(chan, oldexten);</span><br><span style="color: hsl(0, 100%, 40%);">-          if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    /* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue</span><br><span style="color: hsl(0, 100%, 40%);">-                  normally if there is any problem */</span><br><span style="color: hsl(0, 100%, 40%);">-                     if (sscanf(offsets, "%30d", &offset) == 1) {</span><br><span style="color: hsl(0, 100%, 40%);">-                              if (ast_exists_extension(chan, ast_channel_context(chan), ast_channel_exten(chan),</span><br><span style="color: hsl(0, 100%, 40%);">-                                      ast_channel_priority(chan) + offset + 1,</span><br><span style="color: hsl(0, 100%, 40%);">-                                        S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                       ast_channel_priority_set(chan, ast_channel_priority(chan) + offset);</span><br><span style="color: hsl(0, 100%, 40%);">-                            }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);</span><br><span style="color: hsl(0, 100%, 40%);">-   ast_free(save_macro_offset);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    /* Unlock the macro */</span><br><span style="color: hsl(0, 100%, 40%);">-  if (exclusive) {</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_debug(1, "Unlocking macrolock for '%s'\n", fullmacro);</span><br><span style="color: hsl(0, 100%, 40%);">-            if (ast_context_unlockmacro(fullmacro)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                       ast_log(LOG_ERROR, "Failed to unlock macro '%s' - that isn't good\n", fullmacro);</span><br><span style="color: hsl(0, 100%, 40%);">-                 res = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-                }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_channel_unlock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_free(tmp_subst);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    return res;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int macro_exec(struct ast_channel *chan, const char *data)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-  return _macro_exec(chan, data, 0);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int macroexclusive_exec(struct ast_channel *chan, const char *data)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-  return _macro_exec(chan, data, 1);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int macroif_exec(struct ast_channel *chan, const char *data)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- char *expr = NULL, *label_a = NULL, *label_b = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-    int res = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    expr = ast_strdupa(data);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if ((label_a = strchr(expr, '?'))) {</span><br><span style="color: hsl(0, 100%, 40%);">-            *label_a = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">-                label_a++;</span><br><span style="color: hsl(0, 100%, 40%);">-              if ((label_b = strchr(label_a, ':'))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 *label_b = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">-                        label_b++;</span><br><span style="color: hsl(0, 100%, 40%);">-              }</span><br><span style="color: hsl(0, 100%, 40%);">-               if (pbx_checkcondition(expr))</span><br><span style="color: hsl(0, 100%, 40%);">-                   res = macro_exec(chan, label_a);</span><br><span style="color: hsl(0, 100%, 40%);">-                else if (label_b)</span><br><span style="color: hsl(0, 100%, 40%);">-                       res = macro_exec(chan, label_b);</span><br><span style="color: hsl(0, 100%, 40%);">-        } else</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_log(LOG_WARNING, "Invalid Syntax.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    return res;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int macro_exit_exec(struct ast_channel *chan, const char *data)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-     return MACRO_EXIT_RESULT;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int unload_module(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-       int res;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        res = ast_unregister_application(if_app);</span><br><span style="color: hsl(0, 100%, 40%);">-       res |= ast_unregister_application(exit_app);</span><br><span style="color: hsl(0, 100%, 40%);">-    res |= ast_unregister_application(app);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_unregister_application(exclusive_app);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       return res;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int load_module(void)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-       int res;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        res = ast_register_application_xml(exit_app, macro_exit_exec);</span><br><span style="color: hsl(0, 100%, 40%);">-  res |= ast_register_application_xml(if_app, macroif_exec);</span><br><span style="color: hsl(0, 100%, 40%);">-      res |= ast_register_application_xml(exclusive_app, macroexclusive_exec);</span><br><span style="color: hsl(0, 100%, 40%);">-        res |= ast_register_application_xml(app, macro_exec);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   return res;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Extension Macros");</span><br><span>diff --git a/apps/app_meetme.c b/apps/app_meetme.c</span><br><span>index 8b5bd40..812b817 100644</span><br><span>--- a/apps/app_meetme.c</span><br><span>+++ b/apps/app_meetme.c</span><br><span>@@ -3596,8 +3596,6 @@</span><br><span>            ast_channel_lock(chan);</span><br><span>              if ((tmpvar = pbx_builtin_getvar_helper(chan, "MEETME_EXIT_CONTEXT"))) {</span><br><span>                   ast_copy_string(exitcontext, tmpvar, sizeof(exitcontext));</span><br><span style="color: hsl(0, 100%, 40%);">-              } else if (!ast_strlen_zero(ast_channel_macrocontext(chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  ast_copy_string(exitcontext, ast_channel_macrocontext(chan), sizeof(exitcontext));</span><br><span>           } else {</span><br><span>                     ast_copy_string(exitcontext, ast_channel_context(chan), sizeof(exitcontext));</span><br><span>                }</span><br><span>diff --git a/apps/app_minivm.c b/apps/app_minivm.c</span><br><span>index 69370ef..876285a 100644</span><br><span>--- a/apps/app_minivm.c</span><br><span>+++ b/apps/app_minivm.c</span><br><span>@@ -1878,11 +1878,10 @@</span><br><span>                         S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL),</span><br><span>                       "Unknown");</span><br><span>                snprintf(logbuf, sizeof(logbuf),</span><br><span style="color: hsl(0, 100%, 40%);">-                        /* "Mailbox:domain:macrocontext:exten:priority:callerchan:callerid:origdate:origtime:duration:durationstatus:accountcode" */</span><br><span style="color: hsl(0, 100%, 40%);">-                  "%s:%s:%s:%s:%d:%s:%s:%s:%s:%d:%s:%s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                    /* "Mailbox:domain:exten:priority:callerchan:callerid:origdate:origtime:duration:durationstatus:accountcode" */</span><br><span style="color: hsl(120, 100%, 40%);">+                     "%s:%s:%s:%d:%s:%s:%s:%s:%d:%s:%s\n",</span><br><span>                      username,</span><br><span>                    ast_channel_context(chan),</span><br><span style="color: hsl(0, 100%, 40%);">-                      ast_channel_macrocontext(chan),</span><br><span>                      ast_channel_exten(chan),</span><br><span>                     ast_channel_priority(chan),</span><br><span>                  ast_channel_name(chan),</span><br><span>@@ -2140,8 +2139,6 @@</span><br><span>      struct ast_flags flags = { 0 };</span><br><span>      char *opts[OPT_ARG_ARRAY_SIZE];</span><br><span>      int res = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-    int ausemacro = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-      int ousemacro = 0;</span><br><span>   int ouseexten = 0;</span><br><span>   char tmp[PATH_MAX];</span><br><span>  char dest[PATH_MAX];</span><br><span>@@ -2212,7 +2209,7 @@</span><br><span>         }</span><br><span>    ast_debug(2, "Preparing to play message ...\n");</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  /* Check current or macro-calling context for special extensions */</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Check current context for special extensions */</span><br><span>   if (ast_test_flag(vmu, MVM_OPERATOR)) {</span><br><span>              if (!ast_strlen_zero(vmu->exit)) {</span><br><span>                        if (ast_exists_extension(chan, vmu->exit, "o", 1,</span><br><span>@@ -2225,12 +2222,6 @@</span><br><span>                      strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);</span><br><span>                         ouseexten = 1;</span><br><span>               }</span><br><span style="color: hsl(0, 100%, 40%);">-               else if (!ast_strlen_zero(ast_channel_macrocontext(chan))</span><br><span style="color: hsl(0, 100%, 40%);">-                       && ast_exists_extension(chan, ast_channel_macrocontext(chan), "o", 1,</span><br><span style="color: hsl(0, 100%, 40%);">-                         S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                       strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);</span><br><span style="color: hsl(0, 100%, 40%);">-                    ousemacro = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-          }</span><br><span>    }</span><br><span> </span><br><span>        if (!ast_strlen_zero(vmu->exit)) {</span><br><span>@@ -2241,11 +2232,6 @@</span><br><span>       } else if (ast_exists_extension(chan, ast_channel_context(chan), "a", 1,</span><br><span>           S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span>            strncat(ecodes, "*", sizeof(ecodes) -  strlen(ecodes) - 1);</span><br><span style="color: hsl(0, 100%, 40%);">-   } else if (!ast_strlen_zero(ast_channel_macrocontext(chan))</span><br><span style="color: hsl(0, 100%, 40%);">-             && ast_exists_extension(chan, ast_channel_macrocontext(chan), "a", 1,</span><br><span style="color: hsl(0, 100%, 40%);">-                 S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span style="color: hsl(0, 100%, 40%);">-               strncat(ecodes, "*", sizeof(ecodes) -  strlen(ecodes) - 1);</span><br><span style="color: hsl(0, 100%, 40%);">-           ausemacro = 1;</span><br><span>       }</span><br><span> </span><br><span>        res = 0;        /* Reset */</span><br><span>@@ -2286,19 +2272,15 @@</span><br><span>                ast_channel_exten_set(chan, "a");</span><br><span>          if (!ast_strlen_zero(vmu->exit)) {</span><br><span>                        ast_channel_context_set(chan, vmu->exit);</span><br><span style="color: hsl(0, 100%, 40%);">-            } else if (ausemacro && !ast_strlen_zero(ast_channel_macrocontext(chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     ast_channel_context_set(chan, ast_channel_macrocontext(chan));</span><br><span>               }</span><br><span>            ast_channel_priority_set(chan, 0);</span><br><span>           pbx_builtin_setvar_helper(chan, "MVM_GREET_STATUS", "USEREXIT");</span><br><span>                 res = 0;</span><br><span>     } else if (res == '0') { /* Check for a '0' here */</span><br><span style="color: hsl(0, 100%, 40%);">-             if(ouseexten || ousemacro) {</span><br><span style="color: hsl(120, 100%, 40%);">+          if(ouseexten) {</span><br><span>                      ast_channel_exten_set(chan, "o");</span><br><span>                  if (!ast_strlen_zero(vmu->exit)) {</span><br><span>                                ast_channel_context_set(chan, vmu->exit);</span><br><span style="color: hsl(0, 100%, 40%);">-                    } else if (ousemacro && !ast_strlen_zero(ast_channel_macrocontext(chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                             ast_channel_context_set(chan, ast_channel_macrocontext(chan));</span><br><span>                       }</span><br><span>                    ast_play_and_wait(chan, "transfer");</span><br><span>                       ast_channel_priority_set(chan, 0);</span><br><span>diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c</span><br><span>index 1592c40..3ce1a76 100644</span><br><span>--- a/apps/app_mixmonitor.c</span><br><span>+++ b/apps/app_mixmonitor.c</span><br><span>@@ -389,7 +389,6 @@</span><br><span>    /* the below string fields describe data used for creating voicemails from the recording */</span><br><span>  AST_DECLARE_STRING_FIELDS(</span><br><span>           AST_STRING_FIELD(call_context);</span><br><span style="color: hsl(0, 100%, 40%);">-         AST_STRING_FIELD(call_macrocontext);</span><br><span>                 AST_STRING_FIELD(call_extension);</span><br><span>            AST_STRING_FIELD(call_callerchan);</span><br><span>           AST_STRING_FIELD(call_callerid);</span><br><span>@@ -660,7 +659,6 @@</span><br><span>       ast_string_field_set(&recording_data, recording_file, filename);</span><br><span>         ast_string_field_set(&recording_data, recording_ext, ext);</span><br><span>       ast_string_field_set(&recording_data, call_context, mixmonitor->call_context);</span><br><span style="color: hsl(0, 100%, 40%);">-   ast_string_field_set(&recording_data, call_macrocontext, mixmonitor->call_macrocontext);</span><br><span>      ast_string_field_set(&recording_data, call_extension, mixmonitor->call_extension);</span><br><span>    ast_string_field_set(&recording_data, call_callerchan, mixmonitor->call_callerchan);</span><br><span>  ast_string_field_set(&recording_data, call_callerid, mixmonitor->call_callerid);</span><br><span>@@ -1075,7 +1073,6 @@</span><br><span>              }</span><br><span> </span><br><span>                ast_string_field_set(mixmonitor, call_context, ast_channel_context(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-              ast_string_field_set(mixmonitor, call_macrocontext, ast_channel_macrocontext(chan));</span><br><span>                 ast_string_field_set(mixmonitor, call_extension, ast_channel_exten(chan));</span><br><span>           ast_string_field_set(mixmonitor, call_callerchan, ast_channel_name(chan));</span><br><span>           ast_string_field_set(mixmonitor, call_callerid, callerid);</span><br><span>diff --git a/apps/app_queue.c b/apps/app_queue.c</span><br><span>index 288c0ff..4b6b72b 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -177,7 +177,7 @@</span><br><span>                                                the current extension and <emphasis>start</emphasis> execution at that location.</para></span><br><span>                                            <para>NOTE: Any channel variables you want the called channel to inherit from the caller channel must be</span><br><span>                                               prefixed with one or two underbars ('_').</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                          <para>NOTE: Using this option from a Macro() or GoSub() might not make sense as there would be no return points.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                           <para>NOTE: Using this option from a GoSub() might not make sense as there would be no return points.</para></span><br><span>                                     </option></span><br><span>                                      <option name="h"></span><br><span>                                            <para>Allow <emphasis>callee</emphasis> to hang up by pressing <literal>*</literal>.</para></span><br><span>@@ -259,10 +259,6 @@</span><br><span>                               <para>Will setup an AGI script to be executed on the calling party's channel once they are</span><br><span>                                 connected to a queue member.</para></span><br><span>                    </parameter></span><br><span style="color: hsl(0, 100%, 40%);">-                      <parameter name="macro"></span><br><span style="color: hsl(0, 100%, 40%);">-                                <para>Will run a macro on the called party's channel (the queue member) once the parties are connected.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                          <para>NOTE: Macros are deprecated, GoSub should be used instead.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                     </parameter></span><br><span>                   <parameter name="gosub"></span><br><span>                             <para>Will run a gosub on the called party's channel (the queue member)</span><br><span>                            once the parties are connected.  The subroutine execution starts in the</span><br><span>@@ -1800,8 +1796,6 @@</span><br><span>              AST_STRING_FIELD(announce);</span><br><span>          /*! Exit context */</span><br><span>          AST_STRING_FIELD(context);</span><br><span style="color: hsl(0, 100%, 40%);">-              /*! Macro to run upon member connection */</span><br><span style="color: hsl(0, 100%, 40%);">-              AST_STRING_FIELD(membermacro);</span><br><span>               /*! Gosub to run upon member connection */</span><br><span>           AST_STRING_FIELD(membergosub);</span><br><span>               /*! Default rule to use if none specified in call to Queue() */</span><br><span>@@ -3345,8 +3339,6 @@</span><br><span>              q->setqueueentryvar = ast_true(val);</span><br><span>      } else if (!strcasecmp(param, "monitor-format")) {</span><br><span>                 ast_copy_string(q->monfmt, val, sizeof(q->monfmt));</span><br><span style="color: hsl(0, 100%, 40%);">-       } else if (!strcasecmp(param, "membermacro")) {</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_string_field_set(q, membermacro, val);</span><br><span>   } else if (!strcasecmp(param, "membergosub")) {</span><br><span>            ast_string_field_set(q, membergosub, val);</span><br><span>   } else if (!strcasecmp(param, "queue-youarenext")) {</span><br><span>@@ -4687,7 +4679,6 @@</span><br><span>       int status;</span><br><span>  char tech[256];</span><br><span>      char *location;</span><br><span style="color: hsl(0, 100%, 40%);">- const char *macrocontext, *macroexten;</span><br><span>       struct ast_format_cap *nativeformats;</span><br><span>        RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);</span><br><span> </span><br><span>@@ -4748,8 +4739,8 @@</span><br><span>                         ast_channel_set_caller_event(tmp->chan, &caller, NULL);</span><br><span>               } else if (!ast_strlen_zero(ast_channel_dialed(qe->chan)->number.str)) {</span><br><span>                       ast_set_callerid(tmp->chan, ast_channel_dialed(qe->chan)->number.str, NULL, NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-             } else if (!ast_strlen_zero(S_OR(ast_channel_macroexten(qe->chan), ast_channel_exten(qe->chan)))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                       ast_set_callerid(tmp->chan, S_OR(ast_channel_macroexten(qe->chan), ast_channel_exten(qe->chan)), NULL, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+                } else if (!ast_strlen_zero(ast_channel_exten(qe->chan))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        ast_set_callerid(tmp->chan, ast_channel_exten(qe->chan), NULL, NULL);</span><br><span>          }</span><br><span>            tmp->dial_callerid_absent = 1;</span><br><span>    }</span><br><span>@@ -4769,14 +4760,8 @@</span><br><span>   ast_channel_adsicpe_set(tmp->chan, ast_channel_adsicpe(qe->chan));</span><br><span> </span><br><span>         /* Inherit context and extension */</span><br><span style="color: hsl(0, 100%, 40%);">-     macrocontext = pbx_builtin_getvar_helper(qe->chan, "MACRO_CONTEXT");</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_channel_dialcontext_set(tmp->chan, ast_strlen_zero(macrocontext) ? ast_channel_context(qe->chan) : macrocontext);</span><br><span style="color: hsl(0, 100%, 40%);">-     macroexten = pbx_builtin_getvar_helper(qe->chan, "MACRO_EXTEN");</span><br><span style="color: hsl(0, 100%, 40%);">-   if (!ast_strlen_zero(macroexten)) {</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_channel_exten_set(tmp->chan, macroexten);</span><br><span style="color: hsl(0, 100%, 40%);">-        } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_channel_exten_set(tmp->chan, ast_channel_exten(qe->chan));</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(120, 100%, 40%);">+     ast_channel_dialcontext_set(tmp->chan, ast_channel_context(qe->chan));</span><br><span style="color: hsl(120, 100%, 40%);">+  ast_channel_exten_set(tmp->chan, ast_channel_exten(qe->chan));</span><br><span> </span><br><span>     /* Save the original channel name to detect call pickup masquerading in. */</span><br><span>  tmp->orig_chan_name = ast_strdup(ast_channel_name(tmp->chan));</span><br><span>@@ -5120,8 +5105,7 @@</span><br><span>         ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(peer));</span><br><span>        ast_channel_unlock(peer);</span><br><span>    connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;</span><br><span style="color: hsl(0, 100%, 40%);">-      if (ast_channel_connected_line_sub(peer, chan, &connected_caller, 0)</span><br><span style="color: hsl(0, 100%, 40%);">-                && ast_channel_connected_line_macro(peer, chan, &connected_caller, is_caller, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+       if (ast_channel_connected_line_sub(peer, chan, &connected_caller, 0)) {</span><br><span>          ast_channel_update_connected_line(chan, &connected_caller, NULL);</span><br><span>        }</span><br><span>    ast_party_connected_line_free(&connected_caller);</span><br><span>@@ -5241,8 +5225,7 @@</span><br><span>                                                update_connected_line_from_peer(in, o->chan, 1);</span><br><span>                                  } else if (!o->block_connected_update) {</span><br><span>                                          if (o->pending_connected_update) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                   if (ast_channel_connected_line_sub(o->chan, in, &o->connected, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                          ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                       if (ast_channel_connected_line_sub(o->chan, in, &o->connected, 0)) {</span><br><span>                                                               ast_channel_update_connected_line(in, &o->connected, NULL);</span><br><span>                                                   }</span><br><span>                                            } else if (!o->dial_callerid_absent) {</span><br><span>@@ -5352,7 +5335,7 @@</span><br><span>                                                    ast_party_number_init(&ast_channel_redirecting(o->chan)->from.number);</span><br><span>                                                     ast_channel_redirecting(o->chan)->from.number.valid = 1;</span><br><span>                                                       ast_channel_redirecting(o->chan)->from.number.str =</span><br><span style="color: hsl(0, 100%, 40%);">-                                                               ast_strdup(S_OR(ast_channel_macroexten(in), ast_channel_exten(in)));</span><br><span style="color: hsl(120, 100%, 40%);">+                                                          ast_strdup(ast_channel_exten(in));</span><br><span>                                           }</span><br><span> </span><br><span>                                                ast_channel_dialed(o->chan)->transit_network_select = ast_channel_dialed(in)->transit_network_select;</span><br><span>@@ -5371,17 +5354,13 @@</span><br><span>                                                      * Redirecting updates to the caller make sense only on single</span><br><span>                                                        * call at a time strategies.</span><br><span>                                                         *</span><br><span style="color: hsl(0, 100%, 40%);">-                                                       * We must unlock o->chan before calling</span><br><span style="color: hsl(0, 100%, 40%);">-                                                      * ast_channel_redirecting_macro, because we put o->chan into</span><br><span style="color: hsl(0, 100%, 40%);">-                                                         * autoservice there.  That is pretty much a guaranteed</span><br><span style="color: hsl(0, 100%, 40%);">-                                                  * deadlock.  This is why the handling of o->chan's lock may</span><br><span style="color: hsl(0, 100%, 40%);">-                                                      * seem a bit unusual here.</span><br><span style="color: hsl(120, 100%, 40%);">+                                                    * Need to re-evaluate if calling unlock is still required as we no longer</span><br><span style="color: hsl(120, 100%, 40%);">+                                                     * use macro.</span><br><span>                                                         */</span><br><span>                                                  ast_party_redirecting_init(&redirecting);</span><br><span>                                                        ast_party_redirecting_copy(&redirecting, ast_channel_redirecting(o->chan));</span><br><span>                                                   ast_channel_unlock(o->chan);</span><br><span style="color: hsl(0, 100%, 40%);">-                                                 if (ast_channel_redirecting_sub(o->chan, in, &redirecting, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                         ast_channel_redirecting_macro(o->chan, in, &redirecting, 1, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                      if (ast_channel_redirecting_sub(o->chan, in, &redirecting, 0)) {</span><br><span>                                                              ast_channel_update_redirecting(in, &redirecting, NULL);</span><br><span>                                                  }</span><br><span>                                                    ast_party_redirecting_free(&redirecting);</span><br><span>@@ -5430,8 +5409,7 @@</span><br><span>                                                                        update_connected_line_from_peer(in, o->chan, 1);</span><br><span>                                                          } else if (!o->block_connected_update) {</span><br><span>                                                                  if (o->pending_connected_update) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                           if (ast_channel_connected_line_sub(o->chan, in, &o->connected, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                                  ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                               if (ast_channel_connected_line_sub(o->chan, in, &o->connected, 0)) {</span><br><span>                                                                                       ast_channel_update_connected_line(in, &o->connected, NULL);</span><br><span>                                                                           }</span><br><span>                                                                    } else if (!o->dial_callerid_absent) {</span><br><span>@@ -5523,8 +5501,7 @@</span><br><span>                                                     */</span><br><span>                                                  o->dial_callerid_absent = 1;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-                                                     if (ast_channel_connected_line_sub(o->chan, in, f, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                             ast_channel_connected_line_macro(o->chan, in, f, 1, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                  if (ast_channel_connected_line_sub(o->chan, in, f, 1)) {</span><br><span>                                                          ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);</span><br><span>                                                    }</span><br><span>                                                    break;</span><br><span>@@ -5554,8 +5531,7 @@</span><br><span>                                                       }</span><br><span>                                                    ast_verb(3, "%s redirecting info has changed, passing it to %s\n",</span><br><span>                                                                 ochan_name, inchan_name);</span><br><span style="color: hsl(0, 100%, 40%);">-                                                       if (ast_channel_redirecting_sub(o->chan, in, f, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                ast_channel_redirecting_macro(o->chan, in, f, 1, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                     if (ast_channel_redirecting_sub(o->chan, in, f, 1)) {</span><br><span>                                                             ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);</span><br><span>                                                       }</span><br><span>                                                    break;</span><br><span>@@ -5636,8 +5612,7 @@</span><br><span>                                                       ast_verb(3, "Connected line update to %s prevented.\n", ast_channel_name(o->chan));</span><br><span>                                                     break;</span><br><span>                                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                                               if (ast_channel_connected_line_sub(in, o->chan, f, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                     ast_channel_connected_line_macro(in, o->chan, f, 0, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                          if (ast_channel_connected_line_sub(in, o->chan, f, 1)) {</span><br><span>                                                  ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);</span><br><span>                                                }</span><br><span>                                            break;</span><br><span>@@ -5646,8 +5621,7 @@</span><br><span>                                                       ast_verb(3, "Redirecting update to %s prevented.\n", ast_channel_name(o->chan));</span><br><span>                                                        break;</span><br><span>                                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                                               if (ast_channel_redirecting_sub(in, o->chan, f, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                                        ast_channel_redirecting_macro(in, o->chan, f, 0, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                             if (ast_channel_redirecting_sub(in, o->chan, f, 1)) {</span><br><span>                                                     ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);</span><br><span>                                                }</span><br><span>                                            break;</span><br><span>@@ -6921,11 +6895,10 @@</span><br><span>  * \param[in,out] tries the number of times we have tried calling queue members</span><br><span>  * \param[out] noption set if the call to Queue() has the 'n' option set.</span><br><span>  * \param[in] agi the agi passed as the fifth parameter to the Queue() application</span><br><span style="color: hsl(0, 100%, 40%);">- * \param[in] macro the macro passed as the sixth parameter to the Queue() application</span><br><span>  * \param[in] gosub the gosub passed as the seventh parameter to the Queue() application</span><br><span>  * \param[in] ringing 1 if the 'r' option is set, otherwise 0</span><br><span>  */</span><br><span style="color: hsl(0, 100%, 40%);">-static int try_calling(struct queue_ent *qe, struct ast_flags opts, char **opt_args, char *announceoverride, const char *url, int *tries, int *noption, const char *agi, const char *macro, const char *gosub, int ringing)</span><br><span style="color: hsl(120, 100%, 40%);">+static int try_calling(struct queue_ent *qe, struct ast_flags opts, char **opt_args, char *announceoverride, const char *url, int *tries, int *noption, const char *agi, const char *gosub, int ringing)</span><br><span> {</span><br><span>   struct member *cur;</span><br><span>  struct callattempt *outgoing = NULL; /* the list of calls we are building */</span><br><span>@@ -6947,7 +6920,6 @@</span><br><span>         struct ast_bridge_config bridge_config;</span><br><span>      char nondataquality = 1;</span><br><span>     char *agiexec = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-   char *macroexec = NULL;</span><br><span>      char *gosubexec = NULL;</span><br><span>      const char *monitorfilename;</span><br><span>         char tmpid[256];</span><br><span>@@ -7314,21 +7286,6 @@</span><br><span>                    ast_channel_sendurl(peer, url);</span><br><span>              }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-           /* run a macro for this connection if defined. The macro simply returns, no action is taken on the result */</span><br><span style="color: hsl(0, 100%, 40%);">-            /* use macro from dialplan if passed as a option, otherwise use the default queue macro */</span><br><span style="color: hsl(0, 100%, 40%);">-              if (!ast_strlen_zero(macro)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  macroexec = ast_strdupa(macro);</span><br><span style="color: hsl(0, 100%, 40%);">-         } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                        if (qe->parent->membermacro) {</span><br><span style="color: hsl(0, 100%, 40%);">-                            macroexec = ast_strdupa(qe->parent->membermacro);</span><br><span style="color: hsl(0, 100%, 40%);">-                 }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-               if (!ast_strlen_zero(macroexec)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      ast_debug(1, "app_queue: macro=%s.\n", macroexec);</span><br><span style="color: hsl(0, 100%, 40%);">-                    ast_app_exec_macro(qe->chan, peer, macroexec);</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>            /* run a gosub for this connection if defined. The gosub simply returns, no action is taken on the result */</span><br><span>                 /* use gosub from dialplan if passed as a option, otherwise use the default queue gosub */</span><br><span>           if (!ast_strlen_zero(gosub)) {</span><br><span>@@ -8463,7 +8420,6 @@</span><br><span>               AST_APP_ARG(announceoverride);</span><br><span>               AST_APP_ARG(queuetimeoutstr);</span><br><span>                AST_APP_ARG(agi);</span><br><span style="color: hsl(0, 100%, 40%);">-               AST_APP_ARG(macro);</span><br><span>          AST_APP_ARG(gosub);</span><br><span>          AST_APP_ARG(rule);</span><br><span>           AST_APP_ARG(position);</span><br><span>@@ -8475,7 +8431,7 @@</span><br><span>       int max_forwards;</span><br><span> </span><br><span>        if (ast_strlen_zero(data)) {</span><br><span style="color: hsl(0, 100%, 40%);">-            ast_log(LOG_WARNING, "Queue requires an argument: queuename[,options[,URL[,announceoverride[,timeout[,agi[,macro[,gosub[,rule[,position]]]]]]]]]\n");</span><br><span style="color: hsl(120, 100%, 40%);">+               ast_log(LOG_WARNING, "Queue requires an argument: queuename[,options[,URL[,announceoverride[,timeout[,agi[,gosub[,rule[,position]]]]]]]]\n");</span><br><span>              return -1;</span><br><span>   }</span><br><span> </span><br><span>@@ -8491,14 +8447,13 @@</span><br><span>      parse = ast_strdupa(data);</span><br><span>   AST_STANDARD_APP_ARGS(args, parse);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(1, "queue: %s, options: %s, url: %s, announce: %s, timeout: %s, agi: %s, macro: %s, gosub: %s, rule: %s, position: %s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(1, "queue: %s, options: %s, url: %s, announce: %s, timeout: %s, agi: %s, gosub: %s, rule: %s, position: %s\n",</span><br><span>           args.queuename,</span><br><span>              S_OR(args.options, ""),</span><br><span>            S_OR(args.url, ""),</span><br><span>                S_OR(args.announceoverride, ""),</span><br><span>           S_OR(args.queuetimeoutstr, ""),</span><br><span>            S_OR(args.agi, ""),</span><br><span style="color: hsl(0, 100%, 40%);">-           S_OR(args.macro, ""),</span><br><span>              S_OR(args.gosub, ""),</span><br><span>              S_OR(args.rule, ""),</span><br><span>               S_OR(args.position, ""));</span><br><span>@@ -8719,7 +8674,7 @@</span><br><span>          }</span><br><span> </span><br><span>                /* Try calling all queue members for 'timeout' seconds */</span><br><span style="color: hsl(0, 100%, 40%);">-               res = try_calling(&qe, opts, opt_args, args.announceoverride, args.url, &tries, &noption, args.agi, args.macro, args.gosub, ringing);</span><br><span style="color: hsl(120, 100%, 40%);">+             res = try_calling(&qe, opts, opt_args, args.announceoverride, args.url, &tries, &noption, args.agi, args.gosub, ringing);</span><br><span>                if (res) {</span><br><span>                   goto stop;</span><br><span>           }</span><br><span>diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c</span><br><span>index 510e15d..3ae9ac8 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -4224,7 +4224,7 @@</span><br><span> </span><br><span>   snprintf(msgnums, sizeof(msgnums), "%d", smsg);</span><br><span>    snprintf(msgnumd, sizeof(msgnumd), "%d", dmsg);</span><br><span style="color: hsl(0, 100%, 40%);">-       snprintf(sql, sizeof(sql), "INSERT INTO %s (dir, msgnum, msg_id, context, macrocontext, callerid, origtime, duration, recording, flag, mailboxuser, mailboxcontext) SELECT ?,?,?,context,macrocontext,callerid,origtime,duration,recording,flag,?,? FROM %s WHERE dir=? AND msgnum=?", odbc_table, odbc_table);</span><br><span style="color: hsl(120, 100%, 40%);">+     snprintf(sql, sizeof(sql), "INSERT INTO %s (dir, msgnum, msg_id, context, callerid, origtime, duration, recording, flag, mailboxuser, mailboxcontext) SELECT ?,?,?,context,callerid,origtime,duration,recording,flag,?,? FROM %s WHERE dir=? AND msgnum=?", odbc_table, odbc_table);</span><br><span>       stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);</span><br><span>         if (!stmt)</span><br><span>           ast_log(AST_LOG_WARNING, "SQL Execute error!\n[%s] (You probably don't have MySQL 4.1 or later installed)\n\n", sql);</span><br><span>@@ -4243,7 +4243,6 @@</span><br><span>  SQLLEN datalen;</span><br><span>      SQLLEN indlen;</span><br><span>       const char *context;</span><br><span style="color: hsl(0, 100%, 40%);">-    const char *macrocontext;</span><br><span>    const char *callerid;</span><br><span>        const char *origtime;</span><br><span>        const char *duration;</span><br><span>@@ -4270,7 +4269,6 @@</span><br><span>        SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->msgnums), 0, (void *) data->msgnums, 0, NULL);</span><br><span>   SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY, data->datalen, 0, (void *) data->data, data->datalen, &data->indlen);</span><br><span>    SQLBindParameter(stmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->context), 0, (void *) data->context, 0, NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-      SQLBindParameter(stmt, 5, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->macrocontext), 0, (void *) data->macrocontext, 0, NULL);</span><br><span>         SQLBindParameter(stmt, 6, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->callerid), 0, (void *) data->callerid, 0, NULL);</span><br><span>         SQLBindParameter(stmt, 7, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->origtime), 0, (void *) data->origtime, 0, NULL);</span><br><span>         SQLBindParameter(stmt, 8, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(data->duration), 0, (void *) data->duration, 0, NULL);</span><br><span>@@ -4320,7 +4318,7 @@</span><br><span>         struct ast_config *cfg = NULL;</span><br><span>       struct odbc_obj *obj;</span><br><span>        struct insert_data idata = { .sql = sql, .msgnums = msgnums, .dir = dir, .mailboxuser = mailboxuser, .mailboxcontext = mailboxcontext,</span><br><span style="color: hsl(0, 100%, 40%);">-          .context = "", .macrocontext = "", .callerid = "", .origtime = "", .duration = "", .category = "", .flag = "", .msg_id = "" };</span><br><span style="color: hsl(120, 100%, 40%);">+                .context = "", .callerid = "", .origtime = "", .duration = "", .category = "", .flag = "", .msg_id = "" };</span><br><span>     struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };</span><br><span> </span><br><span>         delete_file(dir, msgnum);</span><br><span>@@ -4356,9 +4354,6 @@</span><br><span>                    if (!(idata.context = ast_variable_retrieve(cfg, "message", "context"))) {</span><br><span>                               idata.context = "";</span><br><span>                        }</span><br><span style="color: hsl(0, 100%, 40%);">-                       if (!(idata.macrocontext = ast_variable_retrieve(cfg, "message", "macrocontext"))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                idata.macrocontext = "";</span><br><span style="color: hsl(0, 100%, 40%);">-                      }</span><br><span>                    if (!(idata.callerid = ast_variable_retrieve(cfg, "message", "callerid"))) {</span><br><span>                             idata.callerid = "";</span><br><span>                       }</span><br><span>@@ -4394,9 +4389,9 @@</span><br><span>            idata.datalen = idata.indlen = fdlen;</span><br><span> </span><br><span>            if (!ast_strlen_zero(idata.category))</span><br><span style="color: hsl(0, 100%, 40%);">-                   snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id,category) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);</span><br><span style="color: hsl(120, 100%, 40%);">+                 snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id,category) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);</span><br><span>               else</span><br><span style="color: hsl(0, 100%, 40%);">-                    snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);</span><br><span style="color: hsl(120, 100%, 40%);">+                    snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?)", odbc_table);</span><br><span> </span><br><span>              if (ast_strlen_zero(idata.origtime)) {</span><br><span>                       idata.origtime = "0";</span><br><span>@@ -4680,7 +4675,7 @@</span><br><span> {</span><br><span>         char frompath2[PATH_MAX], topath2[PATH_MAX];</span><br><span>         struct ast_variable *tmp, *var = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-  const char *origmailbox = "", *context = "", *macrocontext = "", *exten = "";</span><br><span style="color: hsl(120, 100%, 40%);">+ const char *origmailbox = "", *context = "", *exten = "";</span><br><span>      const char *priority = "", *callerchan = "", *callerid = "", *origdate = "";</span><br><span>         const char *origtime = "", *category = "", *duration = "";</span><br><span> </span><br><span>@@ -4696,8 +4691,6 @@</span><br><span>                                 origmailbox = tmp->value;</span><br><span>                         } else if (!strcasecmp(tmp->name, "context")) {</span><br><span>                                 context = tmp->value;</span><br><span style="color: hsl(0, 100%, 40%);">-                        } else if (!strcasecmp(tmp->name, "macrocontext")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                               macrocontext = tmp->value;</span><br><span>                        } else if (!strcasecmp(tmp->name, "exten")) {</span><br><span>                           exten = tmp->value;</span><br><span>                       } else if (!strcasecmp(tmp->name, "priority")) {</span><br><span>@@ -4716,7 +4709,7 @@</span><br><span>                                duration = tmp->value;</span><br><span>                    }</span><br><span>            }</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_store_realtime("voicemail_data", "filename", topath, "origmailbox", origmailbox, "context", context, "macrocontext", macrocontext, "exten", exten, "priority", priority, "callerchan", callerchan, "callerid", callerid, "origdate", origdate, "origtime", origtime, "category", category, "duration", duration, SENTINEL);</span><br><span style="color: hsl(120, 100%, 40%);">+             ast_store_realtime("voicemail_data", "filename", topath, "origmailbox", origmailbox, "context", context, "exten", exten, "priority", priority, "callerchan", callerchan, "callerid", callerid, "origdate", origdate, "origtime", origtime, "category", category, "duration", duration, SENTINEL);</span><br><span>    }</span><br><span>    copy(frompath2, topath2);</span><br><span>    ast_variables_destroy(var);</span><br><span>@@ -6267,7 +6260,6 @@</span><br><span>                  "[message]\n"</span><br><span>                      "origmailbox=%s\n"</span><br><span>                         "context=%s\n"</span><br><span style="color: hsl(0, 100%, 40%);">-                        "macrocontext=%s\n"</span><br><span>                        "exten=%s\n"</span><br><span>                       "rdnis=Unknown\n"</span><br><span>                  "priority=%d\n"</span><br><span>@@ -6282,7 +6274,6 @@</span><br><span> </span><br><span>                        recdata->mailbox,</span><br><span>                         S_OR(recdata->call_context, ""),</span><br><span style="color: hsl(0, 100%, 40%);">-                   S_OR(recdata->call_macrocontext, ""),</span><br><span>                   S_OR(recdata->call_extension, ""),</span><br><span>                      recdata->call_priority,</span><br><span>                   S_OR(recdata->call_callerchan, "Unknown"),</span><br><span>@@ -6423,7 +6414,6 @@</span><br><span>                      ast_store_realtime("voicemail_data",</span><br><span>                               "origmailbox", recdata->mailbox,</span><br><span>                                "context", S_OR(recdata->context, ""),</span><br><span style="color: hsl(0, 100%, 40%);">-                           "macrocontext", S_OR(recdata->call_macrocontext, ""),</span><br><span>                                 "exten", S_OR(recdata->call_extension, ""),</span><br><span>                           "priority", recdata->call_priority,</span><br><span>                             "callerchan", S_OR(recdata->call_callerchan, "Unknown"),</span><br><span>@@ -6471,8 +6461,6 @@</span><br><span>      int msgnum;</span><br><span>  int duration = 0;</span><br><span>    int sound_duration = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- int ausemacro = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-      int ousemacro = 0;</span><br><span>   int ouseexten = 0;</span><br><span>   int greeting_only = 0;</span><br><span>       char tmpdur[16];</span><br><span>@@ -6583,7 +6571,7 @@</span><br><span>     }</span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- /* Check current or macro-calling context for special extensions */</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Check current context for special extensions */</span><br><span>   if (ast_test_flag(vmu, VM_OPERATOR)) {</span><br><span>               if (!ast_strlen_zero(vmu->exit)) {</span><br><span>                        if (ast_exists_extension(chan, vmu->exit, "o", 1,</span><br><span>@@ -6595,11 +6583,6 @@</span><br><span>                      S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span>                    strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);</span><br><span>                         ouseexten = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-          } else if (!ast_strlen_zero(ast_channel_macrocontext(chan))</span><br><span style="color: hsl(0, 100%, 40%);">-                     && ast_exists_extension(chan, ast_channel_macrocontext(chan), "o", 1,</span><br><span style="color: hsl(0, 100%, 40%);">-                         S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                       strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);</span><br><span style="color: hsl(0, 100%, 40%);">-                    ousemacro = 1;</span><br><span>               }</span><br><span>    }</span><br><span> </span><br><span>@@ -6611,11 +6594,6 @@</span><br><span>       } else if (ast_exists_extension(chan, ast_channel_context(chan), "a", 1,</span><br><span>           S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span>            strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1);</span><br><span style="color: hsl(0, 100%, 40%);">-    } else if (!ast_strlen_zero(ast_channel_macrocontext(chan))</span><br><span style="color: hsl(0, 100%, 40%);">-             && ast_exists_extension(chan, ast_channel_macrocontext(chan), "a", 1,</span><br><span style="color: hsl(0, 100%, 40%);">-                 S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span style="color: hsl(0, 100%, 40%);">-               strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1);</span><br><span style="color: hsl(0, 100%, 40%);">-            ausemacro = 1;</span><br><span>       }</span><br><span> </span><br><span>        if (ast_test_flag(options, OPT_DTMFEXIT)) {</span><br><span>@@ -6686,8 +6664,6 @@</span><br><span>          ast_channel_exten_set(chan, "a");</span><br><span>          if (!ast_strlen_zero(vmu->exit)) {</span><br><span>                        ast_channel_context_set(chan, vmu->exit);</span><br><span style="color: hsl(0, 100%, 40%);">-            } else if (ausemacro && !ast_strlen_zero(ast_channel_macrocontext(chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     ast_channel_context_set(chan, ast_channel_macrocontext(chan));</span><br><span>               }</span><br><span>            ast_channel_priority_set(chan, 0);</span><br><span>           free_user(vmu);</span><br><span>@@ -6699,12 +6675,10 @@</span><br><span>    /* Check for a '0' here */</span><br><span>   if (ast_test_flag(vmu, VM_OPERATOR) && res == '0') {</span><br><span>         transfer:</span><br><span style="color: hsl(0, 100%, 40%);">-               if (ouseexten || ousemacro) {</span><br><span style="color: hsl(120, 100%, 40%);">+         if (ouseexten) {</span><br><span>                     ast_channel_exten_set(chan, "o");</span><br><span>                  if (!ast_strlen_zero(vmu->exit)) {</span><br><span>                                ast_channel_context_set(chan, vmu->exit);</span><br><span style="color: hsl(0, 100%, 40%);">-                    } else if (ousemacro && !ast_strlen_zero(ast_channel_macrocontext(chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                             ast_channel_context_set(chan, ast_channel_macrocontext(chan));</span><br><span>                       }</span><br><span>                    ast_play_and_wait(chan, "transfer");</span><br><span>                       ast_channel_priority_set(chan, 0);</span><br><span>@@ -6828,7 +6802,6 @@</span><br><span>                   ast_store_realtime("voicemail_data",</span><br><span>                               "origmailbox", ext,</span><br><span>                                "context", ast_channel_context(chan),</span><br><span style="color: hsl(0, 100%, 40%);">-                         "macrocontext", ast_channel_macrocontext(chan),</span><br><span>                            "exten", ast_channel_exten(chan),</span><br><span>                          "priority", priority,</span><br><span>                              "callerchan", ast_channel_name(chan),</span><br><span>@@ -6856,7 +6829,6 @@</span><br><span>                              "[message]\n"</span><br><span>                              "origmailbox=%s\n"</span><br><span>                                 "context=%s\n"</span><br><span style="color: hsl(0, 100%, 40%);">-                                "macrocontext=%s\n"</span><br><span>                                "exten=%s\n"</span><br><span>                               "rdnis=%s\n"</span><br><span>                               "priority=%d\n"</span><br><span>@@ -6868,7 +6840,6 @@</span><br><span>                            "msg_id=%s\n",</span><br><span>                             ext,</span><br><span>                                 ast_channel_context(chan),</span><br><span style="color: hsl(0, 100%, 40%);">-                              ast_channel_macrocontext(chan),</span><br><span>                              ast_channel_exten(chan),</span><br><span>                             S_COR(ast_channel_redirecting(chan)->from.number.valid,</span><br><span>                                   ast_channel_redirecting(chan)->from.number.str, "unknown"),</span><br><span>@@ -8824,8 +8795,6 @@</span><br><span>     category = ast_variable_retrieve(msg_cfg, "message", "category");</span><br><span> </span><br><span>    context = ast_variable_retrieve(msg_cfg, "message", "context");</span><br><span style="color: hsl(0, 100%, 40%);">-     if (!strncasecmp("macro", context, 5)) /* Macro names in contexts are useless for our needs */</span><br><span style="color: hsl(0, 100%, 40%);">-                context = ast_variable_retrieve(msg_cfg, "message", "macrocontext");</span><br><span>     if (!res) {</span><br><span>          res = play_message_category(chan, category);</span><br><span>         }</span><br><span>@@ -15259,8 +15228,6 @@</span><br><span>  cid = ast_strdupa(ast_variable_retrieve(msg_cfg, "message", "callerid"));</span><br><span> </span><br><span>    context = ast_variable_retrieve(msg_cfg, "message", "context");</span><br><span style="color: hsl(0, 100%, 40%);">-     if (!strncasecmp("macro", context, 5)) /* Macro names in contexts are useless for our needs */</span><br><span style="color: hsl(0, 100%, 40%);">-                context = ast_variable_retrieve(msg_cfg, "message", "macrocontext");</span><br><span>     switch (option) {</span><br><span>    case 3: /* Play message envelope */</span><br><span>          if (!res) {</span><br><span>diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c</span><br><span>index 5607eb0..cfddb3a7 100644</span><br><span>--- a/channels/chan_dahdi.c</span><br><span>+++ b/channels/chan_dahdi.c</span><br><span>@@ -1777,7 +1777,7 @@</span><br><span>                                        ast_debug(1, "Disabling FAX tone detection on %s after tone received\n", ast_channel_name(ast));</span><br><span>                           }</span><br><span>                            if (strcmp(ast_channel_exten(ast), "fax")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                  const char *target_context = S_OR(ast_channel_macrocontext(ast), ast_channel_context(ast));</span><br><span style="color: hsl(120, 100%, 40%);">+                                   const char *target_context = ast_channel_context(ast);</span><br><span> </span><br><span>                                   /*</span><br><span>                                    * We need to unlock 'ast' here because ast_exists_extension has the</span><br><span>@@ -7433,7 +7433,7 @@</span><br><span>                                         ast_debug(1, "Disabling FAX tone detection on %s after tone received\n", ast_channel_name(ast));</span><br><span>                           }</span><br><span>                            if (strcmp(ast_channel_exten(ast), "fax")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                  const char *target_context = S_OR(ast_channel_macrocontext(ast), ast_channel_context(ast));</span><br><span style="color: hsl(120, 100%, 40%);">+                                   const char *target_context = ast_channel_context(ast);</span><br><span> </span><br><span>                                   /*</span><br><span>                                    * We need to unlock 'ast' here because ast_exists_extension has the</span><br><span>diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c</span><br><span>index 3e8abd2..3aade82 100644</span><br><span>--- a/channels/chan_pjsip.c</span><br><span>+++ b/channels/chan_pjsip.c</span><br><span>@@ -776,7 +776,7 @@</span><br><span>          return f;</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   target_context = S_OR(ast_channel_macrocontext(ast), ast_channel_context(ast));</span><br><span style="color: hsl(120, 100%, 40%);">+       target_context =  ast_channel_context(ast);</span><br><span> </span><br><span>      /*</span><br><span>    * We need to unlock the channel here because ast_exists_extension has the</span><br><span>diff --git a/channels/chan_sip.c b/channels/chan_sip.c</span><br><span>index bf03c5f..ba3cd11 100644</span><br><span>--- a/channels/chan_sip.c</span><br><span>+++ b/channels/chan_sip.c</span><br><span>@@ -8765,7 +8765,7 @@</span><br><span>  /* If we detect a CNG tone and fax detection is enabled then send us off to the fax extension */</span><br><span>     if (faxdetected && ast_test_flag(&p->flags[1], SIP_PAGE2_FAX_DETECT_CNG)) {</span><br><span>           if (strcmp(ast_channel_exten(ast), "fax")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  const char *target_context = S_OR(ast_channel_macrocontext(ast), ast_channel_context(ast));</span><br><span style="color: hsl(120, 100%, 40%);">+                   const char *target_context = ast_channel_context(ast);</span><br><span>                       /*</span><br><span>                    * We need to unlock 'ast' here because</span><br><span>                       * ast_exists_extension has the potential to start and</span><br><span>@@ -11184,7 +11184,7 @@</span><br><span>                             if (ast_test_flag(&p->flags[1], SIP_PAGE2_FAX_DETECT_T38)) {</span><br><span>                                  ast_channel_lock(p->owner);</span><br><span>                                       if (strcmp(ast_channel_exten(p->owner), "fax")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                          const char *target_context = S_OR(ast_channel_macrocontext(p->owner), ast_channel_context(p->owner));</span><br><span style="color: hsl(120, 100%, 40%);">+                                           const char *target_context = ast_channel_context(p->owner);</span><br><span>                                               ast_channel_unlock(p->owner);</span><br><span>                                             if (ast_exists_extension(p->owner, target_context, "fax", 1,</span><br><span>                                                    S_COR(ast_channel_caller(p->owner)->id.number.valid, ast_channel_caller(p->owner)->id.number.str, NULL))) {</span><br><span>@@ -19023,9 +19023,6 @@</span><br><span>    if (transferer->owner) {</span><br><span>          /* By default, use the context in the channel sending the REFER */</span><br><span>           transfer_context = pbx_builtin_getvar_helper(transferer->owner, "TRANSFER_CONTEXT");</span><br><span style="color: hsl(0, 100%, 40%);">-               if (ast_strlen_zero(transfer_context)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                        transfer_context = ast_channel_macrocontext(transferer->owner);</span><br><span style="color: hsl(0, 100%, 40%);">-              }</span><br><span>    }</span><br><span>    if (ast_strlen_zero(transfer_context)) {</span><br><span>             transfer_context = S_OR(transferer->context, sip_cfg.default_context);</span><br><span>@@ -19087,9 +19084,6 @@</span><br><span>  if (p->owner) {</span><br><span>           /* By default, use the context in the channel sending the REFER */</span><br><span>           transfer_context = pbx_builtin_getvar_helper(p->owner, "TRANSFER_CONTEXT");</span><br><span style="color: hsl(0, 100%, 40%);">-                if (ast_strlen_zero(transfer_context)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                        transfer_context = ast_channel_macrocontext(p->owner);</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span>    }</span><br><span>    if (ast_strlen_zero(transfer_context)) {</span><br><span>             transfer_context = S_OR(p->context, sip_cfg.default_context);</span><br><span>diff --git a/doc/UPGRADE-staging/app_macro_removal.txt b/doc/UPGRADE-staging/app_macro_removal.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..af8a0c0</span><br><span>--- /dev/null</span><br><span>+++ b/doc/UPGRADE-staging/app_macro_removal.txt</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_macro</span><br><span style="color: hsl(120, 100%, 40%);">+Master-Only: True</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+This module was deprecated in Asterisk 16</span><br><span style="color: hsl(120, 100%, 40%);">+and is now being removed in accordance with</span><br><span style="color: hsl(120, 100%, 40%);">+the Asterisk Module Deprecation policy.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/funcs/func_callcompletion.c b/funcs/func_callcompletion.c</span><br><span>index 37ba38c..16fe930 100644</span><br><span>--- a/funcs/func_callcompletion.c</span><br><span>+++ b/funcs/func_callcompletion.c</span><br><span>@@ -49,7 +49,6 @@</span><br><span>                                   <enum name="cc_recall_timer" /></span><br><span>                                      <enum name="cc_max_agents" /></span><br><span>                                        <enum name="cc_max_monitors" /></span><br><span style="color: hsl(0, 100%, 40%);">-                                 <enum name="cc_callback_macro" /></span><br><span>                                    <enum name="cc_agent_dialstring" /></span><br><span>                          </enumlist></span><br><span>                    </parameter></span><br><span>diff --git a/include/asterisk/app.h b/include/asterisk/app.h</span><br><span>index 19f7a3f..e65ead8 100644</span><br><span>--- a/include/asterisk/app.h</span><br><span>+++ b/include/asterisk/app.h</span><br><span>@@ -95,9 +95,7 @@</span><br><span>          AST_STRING_FIELD(folder);</span><br><span>            AST_STRING_FIELD(recording_file);</span><br><span>            AST_STRING_FIELD(recording_ext);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>             AST_STRING_FIELD(call_context);</span><br><span style="color: hsl(0, 100%, 40%);">-         AST_STRING_FIELD(call_macrocontext);</span><br><span>                 AST_STRING_FIELD(call_extension);</span><br><span>            AST_STRING_FIELD(call_callerchan);</span><br><span>           AST_STRING_FIELD(call_callerid);</span><br><span>@@ -162,50 +160,6 @@</span><br><span> int ast_app_getdata_full(struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout, int audiofd, int ctrlfd);</span><br><span> </span><br><span> /*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Run a macro on a channel, placing an optional second channel into autoservice.</span><br><span style="color: hsl(0, 100%, 40%);">- * \since 11.0</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \details</span><br><span style="color: hsl(0, 100%, 40%);">- * This is a shorthand method that makes it very easy to run a</span><br><span style="color: hsl(0, 100%, 40%);">- * macro on any given channel.  It is perfectly reasonable to</span><br><span style="color: hsl(0, 100%, 40%);">- * supply a NULL autoservice_chan here in case there is no</span><br><span style="color: hsl(0, 100%, 40%);">- * channel to place into autoservice.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \note Absolutely _NO_ channel locks should be held before calling this function.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \param autoservice_chan A channel to place into autoservice while the macro is run</span><br><span style="color: hsl(0, 100%, 40%);">- * \param macro_chan Channel to execute macro on.</span><br><span style="color: hsl(0, 100%, 40%);">- * \param macro_args Macro application argument string.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval 0 success</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval -1 on error</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_app_exec_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const char *macro_args);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \since 1.8</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Run a macro on a channel, placing an optional second channel into autoservice.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \details</span><br><span style="color: hsl(0, 100%, 40%);">- * This is a shorthand method that makes it very easy to run a</span><br><span style="color: hsl(0, 100%, 40%);">- * macro on any given channel.  It is perfectly reasonable to</span><br><span style="color: hsl(0, 100%, 40%);">- * supply a NULL autoservice_chan here in case there is no</span><br><span style="color: hsl(0, 100%, 40%);">- * channel to place into autoservice.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \note Absolutely _NO_ channel locks should be held before calling this function.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \param autoservice_chan A channel to place into autoservice while the macro is run</span><br><span style="color: hsl(0, 100%, 40%);">- * \param macro_chan Channel to execute macro on.</span><br><span style="color: hsl(0, 100%, 40%);">- * \param macro_name The name of the macro to run.</span><br><span style="color: hsl(0, 100%, 40%);">- * \param macro_args The arguments to pass to the macro.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval 0 success</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval -1 on error</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_app_run_macro(struct ast_channel *autoservice_chan,</span><br><span style="color: hsl(0, 100%, 40%);">-      struct ast_channel *macro_chan, const char *macro_name, const char *macro_args);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*!</span><br><span>  * \brief Stack applications callback functions.</span><br><span>  */</span><br><span> struct ast_app_stack_funcs {</span><br><span>diff --git a/include/asterisk/ccss.h b/include/asterisk/ccss.h</span><br><span>index 3817818..2e5e72e 100644</span><br><span>--- a/include/asterisk/ccss.h</span><br><span>+++ b/include/asterisk/ccss.h</span><br><span>@@ -363,22 +363,6 @@</span><br><span> void ast_set_cc_max_monitors(struct ast_cc_config_params *config, unsigned int value);</span><br><span> </span><br><span> /*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \since 1.8</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Get the name of the callback_macro</span><br><span style="color: hsl(0, 100%, 40%);">- * \param config The configuration to retrieve the callback_macro from</span><br><span style="color: hsl(0, 100%, 40%);">- * \return The callback_macro name</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-const char *ast_get_cc_callback_macro(struct ast_cc_config_params *config);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \since 1.8</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Set the callback_macro name</span><br><span style="color: hsl(0, 100%, 40%);">- * \param config The configuration to set the callback_macro on</span><br><span style="color: hsl(0, 100%, 40%);">- * \param value The new callback macro we want to change to</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-void ast_set_cc_callback_macro(struct ast_cc_config_params *config, const char * const value);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*!</span><br><span>  * \since 11</span><br><span>  * \brief Get the name of the callback subroutine</span><br><span>  * \param config The configuration to retrieve the callback_sub from</span><br><span>diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h</span><br><span>index e5613df..683973f 100644</span><br><span>--- a/include/asterisk/channel.h</span><br><span>+++ b/include/asterisk/channel.h</span><br><span>@@ -3848,37 +3848,6 @@</span><br><span> void ast_channel_queue_redirecting_update(struct ast_channel *chan, const struct ast_party_redirecting *redirecting, const struct ast_set_party_redirecting *update);</span><br><span> </span><br><span> /*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \since 1.8</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Run a connected line interception macro and update a channel's connected line</span><br><span style="color: hsl(0, 100%, 40%);">- * information</span><br><span style="color: hsl(0, 100%, 40%);">- * \deprecated You should use the ast_channel_connected_line_sub() function instead.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Whenever we want to update a channel's connected line information, we may need to run</span><br><span style="color: hsl(0, 100%, 40%);">- * a macro so that an administrator can manipulate the information before sending it</span><br><span style="color: hsl(0, 100%, 40%);">- * out. This function both runs the macro and sends the update to the channel.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \param autoservice_chan Channel to place into autoservice while the macro is running.</span><br><span style="color: hsl(0, 100%, 40%);">- * It is perfectly safe for this to be NULL</span><br><span style="color: hsl(0, 100%, 40%);">- * \param macro_chan The channel to run the macro on. Also the channel from which we</span><br><span style="color: hsl(0, 100%, 40%);">- * determine which macro we need to run.</span><br><span style="color: hsl(0, 100%, 40%);">- * \param connected_info Either an ast_party_connected_line or ast_frame pointer of type</span><br><span style="color: hsl(0, 100%, 40%);">- * AST_CONTROL_CONNECTED_LINE</span><br><span style="color: hsl(0, 100%, 40%);">- * \param is_caller If true, then run CONNECTED_LINE_CALLER_SEND_MACRO with arguments from</span><br><span style="color: hsl(0, 100%, 40%);">- * CONNECTED_LINE_CALLER_SEND_MACRO_ARGS, otherwise run CONNECTED_LINE_CALLEE_SEND_MACRO</span><br><span style="color: hsl(0, 100%, 40%);">- * with arguments from CONNECTED_LINE_CALLEE_SEND_MACRO_ARGS</span><br><span style="color: hsl(0, 100%, 40%);">- * \param frame If true, then connected_info is an ast_frame pointer, otherwise it is an</span><br><span style="color: hsl(0, 100%, 40%);">- * ast_party_connected_line pointer.</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval 0 Success</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval -1 Either the macro does not exist, or there was an error while attempting to</span><br><span style="color: hsl(0, 100%, 40%);">- * run the macro</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \todo Have multiple return codes based on the MACRO_RESULT</span><br><span style="color: hsl(0, 100%, 40%);">- * \todo Make constants so that caller and frame can be more expressive than just '1' and</span><br><span style="color: hsl(0, 100%, 40%);">- * '0'</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-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);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*!</span><br><span>  * \since 11</span><br><span>  * \brief Run a connected line interception subroutine and update a channel's connected line</span><br><span>  * information</span><br><span>@@ -3903,38 +3872,6 @@</span><br><span> int ast_channel_connected_line_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const void *connected_info, int frame);</span><br><span> </span><br><span> /*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \since 1.8</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Run a redirecting interception macro and update a channel's redirecting information</span><br><span style="color: hsl(0, 100%, 40%);">- * \deprecated You should use the ast_channel_redirecting_sub() function instead.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \details</span><br><span style="color: hsl(0, 100%, 40%);">- * Whenever we want to update a channel's redirecting information, we may need to run</span><br><span style="color: hsl(0, 100%, 40%);">- * a macro so that an administrator can manipulate the information before sending it</span><br><span style="color: hsl(0, 100%, 40%);">- * out. This function both runs the macro and sends the update to the channel.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \param autoservice_chan Channel to place into autoservice while the macro is running.</span><br><span style="color: hsl(0, 100%, 40%);">- * It is perfectly safe for this to be NULL</span><br><span style="color: hsl(0, 100%, 40%);">- * \param macro_chan The channel to run the macro on. Also the channel from which we</span><br><span style="color: hsl(0, 100%, 40%);">- * determine which macro we need to run.</span><br><span style="color: hsl(0, 100%, 40%);">- * \param redirecting_info Either an ast_party_redirecting or ast_frame pointer of type</span><br><span style="color: hsl(0, 100%, 40%);">- * AST_CONTROL_REDIRECTING</span><br><span style="color: hsl(0, 100%, 40%);">- * \param is_caller If true, then run REDIRECTING_CALLER_SEND_MACRO with arguments from</span><br><span style="color: hsl(0, 100%, 40%);">- * REDIRECTING_CALLER_SEND_MACRO_ARGS, otherwise run REDIRECTING_CALLEE_SEND_MACRO with</span><br><span style="color: hsl(0, 100%, 40%);">- * arguments from REDIRECTING_CALLEE_SEND_MACRO_ARGS</span><br><span style="color: hsl(0, 100%, 40%);">- * \param is_frame If true, then redirecting_info is an ast_frame pointer, otherwise it is an</span><br><span style="color: hsl(0, 100%, 40%);">- * ast_party_redirecting pointer.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval 0 Success</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval -1 Either the macro does not exist, or there was an error while attempting to</span><br><span style="color: hsl(0, 100%, 40%);">- * run the macro</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \todo Have multiple return codes based on the MACRO_RESULT</span><br><span style="color: hsl(0, 100%, 40%);">- * \todo Make constants so that caller and frame can be more expressive than just '1' and</span><br><span style="color: hsl(0, 100%, 40%);">- * '0'</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-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);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*!</span><br><span>  * \since 11</span><br><span>  * \brief Run a redirecting interception subroutine and update a channel's redirecting information</span><br><span>  *</span><br><span>@@ -4168,10 +4105,6 @@</span><br><span> const char *ast_channel_lastexten(const struct ast_channel *chan);</span><br><span> const char *ast_channel_exten(const struct ast_channel *chan);</span><br><span> void ast_channel_exten_set(struct ast_channel *chan, const char *value);</span><br><span style="color: hsl(0, 100%, 40%);">-const char *ast_channel_macrocontext(const struct ast_channel *chan);</span><br><span style="color: hsl(0, 100%, 40%);">-void ast_channel_macrocontext_set(struct ast_channel *chan, const char *value);</span><br><span style="color: hsl(0, 100%, 40%);">-const char *ast_channel_macroexten(const struct ast_channel *chan);</span><br><span style="color: hsl(0, 100%, 40%);">-void ast_channel_macroexten_set(struct ast_channel *chan, const char *value);</span><br><span> </span><br><span> char ast_channel_dtmf_digit_to_emulate(const struct ast_channel *chan);</span><br><span> void ast_channel_dtmf_digit_to_emulate_set(struct ast_channel *chan, char value);</span><br><span>@@ -4191,8 +4124,6 @@</span><br><span> void ast_channel_fdno_set(struct ast_channel *chan, int value);</span><br><span> int ast_channel_hangupcause(const struct ast_channel *chan);</span><br><span> void ast_channel_hangupcause_set(struct ast_channel *chan, int value);</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_channel_macropriority(const struct ast_channel *chan);</span><br><span style="color: hsl(0, 100%, 40%);">-void ast_channel_macropriority_set(struct ast_channel *chan, int value);</span><br><span> int ast_channel_priority(const struct ast_channel *chan);</span><br><span> void ast_channel_priority_set(struct ast_channel *chan, int value);</span><br><span> int ast_channel_rings(const struct ast_channel *chan);</span><br><span>diff --git a/include/asterisk/extconf.h b/include/asterisk/extconf.h</span><br><span>index 043d245..f714f1f 100644</span><br><span>--- a/include/asterisk/extconf.h</span><br><span>+++ b/include/asterisk/extconf.h</span><br><span>@@ -157,7 +157,6 @@</span><br><span>   struct ast_ignorepat *ignorepats;       /*!< Patterns for which to continue playing dialtone */</span><br><span>   const char *registrar;                  /*!< Registrar */</span><br><span>         AST_LIST_HEAD_NOLOCK(, ast_sw) alts;    /*!< Alternative switches */</span><br><span style="color: hsl(0, 100%, 40%);">- ast_mutex_t macrolock;                  /*!< A lock to implement "exclusive" macros - held whilst a call is executing in the macro */</span><br><span>   char name[0];                           /*!< Name of the context */</span><br><span> };</span><br><span> </span><br><span>diff --git a/include/asterisk/options.h b/include/asterisk/options.h</span><br><span>index 570100b..0a0d8ba 100644</span><br><span>--- a/include/asterisk/options.h</span><br><span>+++ b/include/asterisk/options.h</span><br><span>@@ -114,8 +114,6 @@</span><br><span> #define ast_opt_no_color         ast_test_flag(&ast_options, AST_OPT_FLAG_NO_COLOR)</span><br><span> #define ast_fully_booted              ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)</span><br><span> #define ast_opt_transcode_via_slin        ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN)</span><br><span style="color: hsl(0, 100%, 40%);">-/*! Invoke the stdexten using the legacy macro method. */</span><br><span style="color: hsl(0, 100%, 40%);">-#define ast_opt_stdexten_macro         ast_test_flag(&ast_options, AST_OPT_FLAG_STDEXTEN_MACRO)</span><br><span> #define ast_opt_dump_core               ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE)</span><br><span> #define ast_opt_cache_record_files   ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES)</span><br><span> #define ast_opt_cache_media_frames  ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_MEDIA_FRAMES)</span><br><span>diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h</span><br><span>index 593b186..b7a5428 100644</span><br><span>--- a/include/asterisk/pbx.h</span><br><span>+++ b/include/asterisk/pbx.h</span><br><span>@@ -1124,30 +1124,6 @@</span><br><span> int ast_unlock_context(struct ast_context *con);</span><br><span> </span><br><span> /*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief locks the macrolock in the given context</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \param macrocontext name of the macro-context to lock</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Locks the given macro-context to ensure only one thread (call) can execute it at a time</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval 0 on success</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval -1 on failure</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_context_lockmacro(const char *macrocontext);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Unlocks the macrolock in the given context</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \param macrocontext name of the macro-context to unlock</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Unlocks the given macro-context so that another thread (call) can execute it</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval 0 on success</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval -1 on failure</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_context_unlockmacro(const char *macrocontext);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*!</span><br><span>  * \brief Set the channel to next execute the specified dialplan location.</span><br><span>  * \see ast_async_parseable_goto, ast_async_goto_if_exists</span><br><span>  *</span><br><span>diff --git a/main/app.c b/main/app.c</span><br><span>index a99157b..5f5590a 100644</span><br><span>--- a/main/app.c</span><br><span>+++ b/main/app.c</span><br><span>@@ -267,76 +267,6 @@</span><br><span>         return res;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-int ast_app_exec_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const char *macro_args)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-       struct ast_app *macro_app;</span><br><span style="color: hsl(0, 100%, 40%);">-      int res;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        macro_app = pbx_findapp("Macro");</span><br><span style="color: hsl(0, 100%, 40%);">-     if (!macro_app) {</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_log(LOG_WARNING,</span><br><span style="color: hsl(0, 100%, 40%);">-                    "Cannot run 'Macro(%s)'.  The application is not available.\n", macro_args);</span><br><span style="color: hsl(0, 100%, 40%);">-          return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-       if (autoservice_chan) {</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_autoservice_start(autoservice_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_debug(4, "%s Original location: %s,%s,%d\n", ast_channel_name(macro_chan),</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_channel_context(macro_chan), ast_channel_exten(macro_chan),</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_channel_priority(macro_chan));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      res = pbx_exec(macro_chan, macro_app, macro_args);</span><br><span style="color: hsl(0, 100%, 40%);">-      ast_debug(4, "Macro exited with status %d\n", res);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   /*</span><br><span style="color: hsl(0, 100%, 40%);">-       * Assume anything negative from Macro is an error.</span><br><span style="color: hsl(0, 100%, 40%);">-      * Anything else is success.</span><br><span style="color: hsl(0, 100%, 40%);">-     */</span><br><span style="color: hsl(0, 100%, 40%);">-     if (res < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-               res = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-       } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                res = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_debug(4, "%s Ending location: %s,%s,%d\n", ast_channel_name(macro_chan),</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_channel_context(macro_chan), ast_channel_exten(macro_chan),</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_channel_priority(macro_chan));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      if (autoservice_chan) {</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_autoservice_stop(autoservice_chan);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (ast_check_hangup_locked(macro_chan)) {</span><br><span style="color: hsl(0, 100%, 40%);">-              ast_queue_hangup(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-   }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       return res;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_app_run_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const char *macro_name, const char *macro_args)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-        int res;</span><br><span style="color: hsl(0, 100%, 40%);">-        char *args_str;</span><br><span style="color: hsl(0, 100%, 40%);">- size_t args_len;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        if (ast_strlen_zero(macro_args)) {</span><br><span style="color: hsl(0, 100%, 40%);">-              return ast_app_exec_macro(autoservice_chan, macro_chan, macro_name);</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Create the Macro application argument string. */</span><br><span style="color: hsl(0, 100%, 40%);">-     args_len = strlen(macro_name) + strlen(macro_args) + 2;</span><br><span style="color: hsl(0, 100%, 40%);">- args_str = ast_malloc(args_len);</span><br><span style="color: hsl(0, 100%, 40%);">-        if (!args_str) {</span><br><span style="color: hsl(0, 100%, 40%);">-                return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-       snprintf(args_str, args_len, "%s,%s", macro_name, macro_args);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        res = ast_app_exec_macro(autoservice_chan, macro_chan, args_str);</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_free(args_str);</span><br><span style="color: hsl(0, 100%, 40%);">-     return res;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> /* BUGBUG this is not thread safe. */</span><br><span> static const struct ast_app_stack_funcs *app_stack_callbacks;</span><br><span> </span><br><span>diff --git a/main/bridge_basic.c b/main/bridge_basic.c</span><br><span>index c291fb2..9f83f7d 100644</span><br><span>--- a/main/bridge_basic.c</span><br><span>+++ b/main/bridge_basic.c</span><br><span>@@ -1386,10 +1386,6 @@</span><br><span>         if (!ast_strlen_zero(context)) {</span><br><span>             return context;</span><br><span>      }</span><br><span style="color: hsl(0, 100%, 40%);">-       context = ast_channel_macrocontext(transferer);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!ast_strlen_zero(context)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                return context;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span>    context = ast_channel_context(transferer);</span><br><span>   if (!ast_strlen_zero(context)) {</span><br><span>             return context;</span><br><span>diff --git a/main/bridge_channel.c b/main/bridge_channel.c</span><br><span>index a0334b8..7f00050 100644</span><br><span>--- a/main/bridge_channel.c</span><br><span>+++ b/main/bridge_channel.c</span><br><span>@@ -1175,8 +1175,6 @@</span><br><span> </span><br><span>         if (!strcasecmp("Gosub", app_name)) {</span><br><span>              ast_app_exec_sub(NULL, chan, app_args, 0);</span><br><span style="color: hsl(0, 100%, 40%);">-      } else if (!strcasecmp("Macro", app_name)) {</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_app_exec_macro(NULL, chan, app_args);</span><br><span>    } else {</span><br><span>             res = ast_pbx_exec_application(chan, app_name, app_args);</span><br><span>    }</span><br><span>@@ -2263,21 +2261,16 @@</span><br><span> {</span><br><span>     struct ast_channel *chan;</span><br><span>    struct ast_option_header *aoh;</span><br><span style="color: hsl(0, 100%, 40%);">-  int is_caller;</span><br><span> </span><br><span>   chan = bridge_channel->chan;</span><br><span>      switch (fr->subclass.integer) {</span><br><span>   case AST_CONTROL_REDIRECTING:</span><br><span style="color: hsl(0, 100%, 40%);">-           is_caller = !ast_test_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING);</span><br><span style="color: hsl(0, 100%, 40%);">-         if (ast_channel_redirecting_sub(NULL, chan, fr, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                   ast_channel_redirecting_macro(NULL, chan, fr, is_caller, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                if (ast_channel_redirecting_sub(NULL, chan, fr, 1)) {</span><br><span>                        ast_indicate_data(chan, fr->subclass.integer, fr->data.ptr, fr->datalen);</span><br><span>           }</span><br><span>            break;</span><br><span>       case AST_CONTROL_CONNECTED_LINE:</span><br><span style="color: hsl(0, 100%, 40%);">-                is_caller = !ast_test_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING);</span><br><span style="color: hsl(0, 100%, 40%);">-         if (ast_channel_connected_line_sub(NULL, chan, fr, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                        ast_channel_connected_line_macro(NULL, chan, fr, is_caller, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+             if (ast_channel_connected_line_sub(NULL, chan, fr, 1)) {</span><br><span>                     ast_indicate_data(chan, fr->subclass.integer, fr->data.ptr, fr->datalen);</span><br><span>           }</span><br><span>            break;</span><br><span>diff --git a/main/ccss.c b/main/ccss.c</span><br><span>index 7d320c1..bbd4ca3 100644</span><br><span>--- a/main/ccss.c</span><br><span>+++ b/main/ccss.c</span><br><span>@@ -167,7 +167,6 @@</span><br><span>        unsigned int cc_recall_timer;</span><br><span>        unsigned int cc_max_agents;</span><br><span>  unsigned int cc_max_monitors;</span><br><span style="color: hsl(0, 100%, 40%);">-   char cc_callback_macro[AST_MAX_EXTENSION];</span><br><span>   char cc_callback_sub[AST_MAX_EXTENSION];</span><br><span>     char cc_agent_dialstring[AST_MAX_EXTENSION];</span><br><span> };</span><br><span>@@ -669,7 +668,6 @@</span><br><span>     .cc_recall_timer = CC_RECALL_TIMER_DEFAULT,</span><br><span>  .cc_max_agents = CC_MAX_AGENTS_DEFAULT,</span><br><span>      .cc_max_monitors = CC_MAX_MONITORS_DEFAULT,</span><br><span style="color: hsl(0, 100%, 40%);">-     .cc_callback_macro = "",</span><br><span>   .cc_callback_sub = "",</span><br><span>     .cc_agent_dialstring = "",</span><br><span> };</span><br><span>@@ -762,9 +760,7 @@</span><br><span> {</span><br><span>        const char *value = NULL;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if (!strcasecmp(name, "cc_callback_macro")) {</span><br><span style="color: hsl(0, 100%, 40%);">-         value = ast_get_cc_callback_macro(params);</span><br><span style="color: hsl(0, 100%, 40%);">-      } else if (!strcasecmp(name, "cc_callback_sub")) {</span><br><span style="color: hsl(120, 100%, 40%);">+  if (!strcasecmp(name, "cc_callback_sub")) {</span><br><span>                value = ast_get_cc_callback_sub(params);</span><br><span>     } else if (!strcasecmp(name, "cc_agent_policy")) {</span><br><span>                 value = agent_policy_to_str(ast_get_cc_agent_policy(params));</span><br><span>@@ -812,9 +808,6 @@</span><br><span>          return ast_set_cc_monitor_policy(params, str_to_monitor_policy(value));</span><br><span>      } else if (!strcasecmp(name, "cc_agent_dialstring")) {</span><br><span>             ast_set_cc_agent_dialstring(params, value);</span><br><span style="color: hsl(0, 100%, 40%);">-     } else if (!strcasecmp(name, "cc_callback_macro")) {</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_set_cc_callback_macro(params, value);</span><br><span style="color: hsl(0, 100%, 40%);">-               return 0;</span><br><span>    } else if (!strcasecmp(name, "cc_callback_sub")) {</span><br><span>                 ast_set_cc_callback_sub(params, value);</span><br><span>              return 0;</span><br><span>@@ -853,7 +846,6 @@</span><br><span>                              !strcasecmp(name, "ccbs_available_timer") ||</span><br><span>                               !strcasecmp(name, "cc_max_agents") ||</span><br><span>                              !strcasecmp(name, "cc_max_monitors") ||</span><br><span style="color: hsl(0, 100%, 40%);">-                               !strcasecmp(name, "cc_callback_macro") ||</span><br><span>                          !strcasecmp(name, "cc_callback_sub") ||</span><br><span>                            !strcasecmp(name, "cc_agent_dialstring") ||</span><br><span>                                !strcasecmp(name, "cc_recall_timer"));</span><br><span>@@ -992,26 +984,11 @@</span><br><span>     config->cc_max_monitors = value;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-const char *ast_get_cc_callback_macro(struct ast_cc_config_params *config)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- return config->cc_callback_macro;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> const char *ast_get_cc_callback_sub(struct ast_cc_config_params *config)</span><br><span> {</span><br><span>       return config->cc_callback_sub;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-void ast_set_cc_callback_macro(struct ast_cc_config_params *config, const char * const value)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_log(LOG_WARNING, "Usage of cc_callback_macro is deprecated.  Please use cc_callback_sub instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-     if (ast_strlen_zero(value)) {</span><br><span style="color: hsl(0, 100%, 40%);">-           config->cc_callback_macro[0] = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_copy_string(config->cc_callback_macro, value, sizeof(config->cc_callback_macro));</span><br><span style="color: hsl(0, 100%, 40%);">-     }</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> void ast_set_cc_callback_sub(struct ast_cc_config_params *config, const char * const value)</span><br><span> {</span><br><span>       if (ast_strlen_zero(value)) {</span><br><span>@@ -2156,7 +2133,7 @@</span><br><span>                return -1;</span><br><span>   }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if (!(monitor = cc_extension_monitor_init(S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)), S_OR(ast_channel_macrocontext(chan), ast_channel_context(chan)), 0))) {</span><br><span style="color: hsl(120, 100%, 40%);">+        if (!(monitor = cc_extension_monitor_init(ast_channel_exten(chan), ast_channel_context(chan), 0))) {</span><br><span>                 ast_free(interfaces);</span><br><span>                return -1;</span><br><span>   }</span><br><span>@@ -2465,8 +2442,9 @@</span><br><span>    }</span><br><span> </span><br><span>        /* Situation 2 has occurred */</span><br><span style="color: hsl(0, 100%, 40%);">-  if (!(monitor = cc_extension_monitor_init(S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)),</span><br><span style="color: hsl(0, 100%, 40%);">-                  S_OR(ast_channel_macrocontext(chan), ast_channel_context(chan)), interfaces->dial_parent_id))) {</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!(monitor = cc_extension_monitor_init(ast_channel_exten(chan),</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                                    ast_channel_context(chan),</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                                    interfaces->dial_parent_id))) {</span><br><span>           return -1;</span><br><span>   }</span><br><span>    monitor->core_id = interfaces->core_id;</span><br><span>@@ -2681,8 +2659,8 @@</span><br><span>        if (ast_channel_caller(chan)->id.name.valid && ast_channel_caller(chan)->id.name.str) {</span><br><span>                ast_copy_string(generic_pvt->cid_name, ast_channel_caller(chan)->id.name.str, sizeof(generic_pvt->cid_name));</span><br><span>       }</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_copy_string(generic_pvt->exten, S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)), sizeof(generic_pvt->exten));</span><br><span style="color: hsl(0, 100%, 40%);">-     ast_copy_string(generic_pvt->context, S_OR(ast_channel_macrocontext(chan), ast_channel_context(chan)), sizeof(generic_pvt->context));</span><br><span style="color: hsl(120, 100%, 40%);">+   ast_copy_string(generic_pvt->exten, ast_channel_exten(chan), sizeof(generic_pvt->exten));</span><br><span style="color: hsl(120, 100%, 40%);">+       ast_copy_string(generic_pvt->context, ast_channel_context(chan), sizeof(generic_pvt->context));</span><br><span>        agent->private_data = generic_pvt;</span><br><span>        ast_set_flag(agent, AST_CC_AGENT_SKIP_OFFER);</span><br><span>        return 0;</span><br><span>@@ -2822,7 +2800,6 @@</span><br><span>    char *target;</span><br><span>        int reason;</span><br><span>  struct ast_channel *chan;</span><br><span style="color: hsl(0, 100%, 40%);">-       const char *callback_macro = ast_get_cc_callback_macro(agent->cc_params);</span><br><span>         const char *callback_sub = ast_get_cc_callback_sub(agent->cc_params);</span><br><span>     unsigned int recall_timer = ast_get_cc_recall_timer(agent->cc_params) * 1000;</span><br><span>     struct ast_format_cap *tmp_cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);</span><br><span>@@ -2863,16 +2840,6 @@</span><br><span>         pbx_builtin_setvar_helper(chan, "CC_EXTEN", generic_pvt->exten);</span><br><span>        pbx_builtin_setvar_helper(chan, "CC_CONTEXT", generic_pvt->context);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if (!ast_strlen_zero(callback_macro)) {</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_log_dynamic_level(cc_logger_level, "Core %u: There's a callback macro configured for agent %s\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                             agent->core_id, agent->device_name);</span><br><span style="color: hsl(0, 100%, 40%);">-              if (ast_app_exec_macro(NULL, chan, callback_macro)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   ast_cc_failed(agent->core_id, "Callback macro to %s failed. Maybe a hangup?", agent->device_name);</span><br><span style="color: hsl(0, 100%, 40%);">-                      ast_hangup(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-                       return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-            }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    if (!ast_strlen_zero(callback_sub)) {</span><br><span>                ast_log_dynamic_level(cc_logger_level, "Core %u: There's a callback subroutine configured for agent %s\n",</span><br><span>                             agent->core_id, agent->device_name);</span><br><span>diff --git a/main/channel.c b/main/channel.c</span><br><span>index 8fa4509..7c2acd7 100644</span><br><span>--- a/main/channel.c</span><br><span>+++ b/main/channel.c</span><br><span>@@ -1310,9 +1310,9 @@</span><br><span>      }</span><br><span> </span><br><span>        ast_channel_lock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- if (strcasecmp(ast_channel_context(chan), context) && strcasecmp(ast_channel_macrocontext(chan), context)) {</span><br><span style="color: hsl(120, 100%, 40%);">+  if (strcasecmp(ast_channel_context(chan), context)) {</span><br><span>                ret = 0; /* Context match failed, continue */</span><br><span style="color: hsl(0, 100%, 40%);">-   } else if (strcasecmp(ast_channel_exten(chan), exten) && strcasecmp(ast_channel_macroexten(chan), exten)) {</span><br><span style="color: hsl(120, 100%, 40%);">+   } else if (strcasecmp(ast_channel_exten(chan), exten)) {</span><br><span>             ret = 0; /* Extension match failed, continue */</span><br><span>      }</span><br><span>    ast_channel_unlock(chan);</span><br><span>@@ -3841,8 +3841,7 @@</span><br><span>                                            break;</span><br><span>                                       }</span><br><span>                                    ast_channel_unlock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-                                       if (ast_channel_connected_line_sub(NULL, chan, &connected, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                                            ast_channel_connected_line_macro(NULL, chan, &connected, 1, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                 if (ast_channel_connected_line_sub(NULL, chan, &connected, 0)) {</span><br><span>                                                 ast_indicate_data(chan, AST_CONTROL_CONNECTED_LINE,</span><br><span>                                                  read_action_payload->payload,</span><br><span>                                                     read_action_payload->payload_size);</span><br><span>@@ -5957,8 +5956,7 @@</span><br><span>               ast_channel_lock(orig);</span><br><span>              ast_party_redirecting_copy(&redirecting, ast_channel_redirecting(orig));</span><br><span>                 ast_channel_unlock(orig);</span><br><span style="color: hsl(0, 100%, 40%);">-               if (ast_channel_redirecting_sub(orig, parent, &redirecting, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                   ast_channel_redirecting_macro(orig, parent, &redirecting, 1, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                if (ast_channel_redirecting_sub(orig, parent, &redirecting, 0)) {</span><br><span>                        ast_channel_update_redirecting(parent, &redirecting, NULL);</span><br><span>              }</span><br><span>            ast_party_redirecting_free(&redirecting);</span><br><span>@@ -10417,110 +10415,6 @@</span><br><span>    return ast_threadstorage_get_ptr(&in_intercept_routine) ? 1 : 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-int ast_channel_connected_line_macro(struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const void *connected_info, int is_caller, int is_frame)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-       static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-     const char *macro;</span><br><span style="color: hsl(0, 100%, 40%);">-      const char *macro_args;</span><br><span style="color: hsl(0, 100%, 40%);">- int retval;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     ast_channel_lock(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-   macro = pbx_builtin_getvar_helper(macro_chan, is_caller</span><br><span style="color: hsl(0, 100%, 40%);">-         ? "CONNECTED_LINE_CALLER_SEND_MACRO" : "CONNECTED_LINE_CALLEE_SEND_MACRO");</span><br><span style="color: hsl(0, 100%, 40%);">- macro = ast_strdupa(S_OR(macro, ""));</span><br><span style="color: hsl(0, 100%, 40%);">- macro_args = pbx_builtin_getvar_helper(macro_chan, is_caller</span><br><span style="color: hsl(0, 100%, 40%);">-            ? "CONNECTED_LINE_CALLER_SEND_MACRO_ARGS" : "CONNECTED_LINE_CALLEE_SEND_MACRO_ARGS");</span><br><span style="color: hsl(0, 100%, 40%);">-       macro_args = ast_strdupa(S_OR(macro_args, ""));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (ast_strlen_zero(macro)) {</span><br><span style="color: hsl(0, 100%, 40%);">-           ast_channel_unlock(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-         return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (!deprecation_warning) {</span><br><span style="color: hsl(0, 100%, 40%);">-             deprecation_warning = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_log(LOG_WARNING, "Usage of CONNECTED_LINE_CALLE[ER]_SEND_MACRO is deprecated.  Please use CONNECTED_LINE_SEND_SUB instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-   }</span><br><span style="color: hsl(0, 100%, 40%);">-       if (is_frame) {</span><br><span style="color: hsl(0, 100%, 40%);">-         const struct ast_frame *frame = connected_info;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_connected_line_parse_data(frame->data.ptr, frame->datalen, ast_channel_connected(macro_chan));</span><br><span style="color: hsl(0, 100%, 40%);">-        } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                const struct ast_party_connected_line *connected = connected_info;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-              ast_party_connected_line_copy(ast_channel_connected(macro_chan), connected);</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_channel_unlock(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- channel_set_intercept_mode(1);</span><br><span style="color: hsl(0, 100%, 40%);">-  retval = ast_app_run_macro(autoservice_chan, macro_chan, macro, macro_args);</span><br><span style="color: hsl(0, 100%, 40%);">-    channel_set_intercept_mode(0);</span><br><span style="color: hsl(0, 100%, 40%);">-  if (!retval) {</span><br><span style="color: hsl(0, 100%, 40%);">-          struct ast_party_connected_line saved_connected;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_party_connected_line_init(&saved_connected);</span><br><span style="color: hsl(0, 100%, 40%);">-            ast_channel_lock(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-           ast_party_connected_line_copy(&saved_connected, ast_channel_connected(macro_chan));</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_channel_unlock(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_channel_update_connected_line(macro_chan, &saved_connected, NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-              ast_party_connected_line_free(&saved_connected);</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       return retval;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-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)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-      static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-     const char *macro;</span><br><span style="color: hsl(0, 100%, 40%);">-      const char *macro_args;</span><br><span style="color: hsl(0, 100%, 40%);">- int retval;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     ast_channel_lock(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-   macro = pbx_builtin_getvar_helper(macro_chan, is_caller</span><br><span style="color: hsl(0, 100%, 40%);">-         ? "REDIRECTING_CALLER_SEND_MACRO" : "REDIRECTING_CALLEE_SEND_MACRO");</span><br><span style="color: hsl(0, 100%, 40%);">-       macro = ast_strdupa(S_OR(macro, ""));</span><br><span style="color: hsl(0, 100%, 40%);">- macro_args = pbx_builtin_getvar_helper(macro_chan, is_caller</span><br><span style="color: hsl(0, 100%, 40%);">-            ? "REDIRECTING_CALLER_SEND_MACRO_ARGS" : "REDIRECTING_CALLEE_SEND_MACRO_ARGS");</span><br><span style="color: hsl(0, 100%, 40%);">-     macro_args = ast_strdupa(S_OR(macro_args, ""));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (ast_strlen_zero(macro)) {</span><br><span style="color: hsl(0, 100%, 40%);">-           ast_channel_unlock(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-         return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (!deprecation_warning) {</span><br><span style="color: hsl(0, 100%, 40%);">-             deprecation_warning = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_log(LOG_WARNING, "Usage of REDIRECTING_CALLE[ER]_SEND_MACRO is deprecated.  Please use REDIRECTING_SEND_SUB instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-       if (is_frame) {</span><br><span style="color: hsl(0, 100%, 40%);">-         const struct ast_frame *frame = redirecting_info;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_redirecting_parse_data(frame->data.ptr, frame->datalen, ast_channel_redirecting(macro_chan));</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                const struct ast_party_redirecting *redirecting = redirecting_info;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_party_redirecting_copy(ast_channel_redirecting(macro_chan), redirecting);</span><br><span style="color: hsl(0, 100%, 40%);">-   }</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_channel_unlock(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- channel_set_intercept_mode(1);</span><br><span style="color: hsl(0, 100%, 40%);">-  retval = ast_app_run_macro(autoservice_chan, macro_chan, macro, macro_args);</span><br><span style="color: hsl(0, 100%, 40%);">-    channel_set_intercept_mode(0);</span><br><span style="color: hsl(0, 100%, 40%);">-  if (!retval) {</span><br><span style="color: hsl(0, 100%, 40%);">-          struct ast_party_redirecting saved_redirecting;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_party_redirecting_init(&saved_redirecting);</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_channel_lock(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-           ast_party_redirecting_copy(&saved_redirecting, ast_channel_redirecting(macro_chan));</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_channel_unlock(macro_chan);</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_channel_update_redirecting(macro_chan, &saved_redirecting, NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_party_redirecting_free(&saved_redirecting);</span><br><span style="color: hsl(0, 100%, 40%);">-     }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       return retval;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> int ast_channel_connected_line_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const void *connected_info, int is_frame)</span><br><span> {</span><br><span>     const char *sub;</span><br><span>diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c</span><br><span>index bc0fb4c..2a33001 100644</span><br><span>--- a/main/channel_internal_api.c</span><br><span>+++ b/main/channel_internal_api.c</span><br><span>@@ -178,7 +178,6 @@</span><br><span>      enum ast_channel_state state;                   /*!< State of line -- Don't write directly, use ast_setstate() */</span><br><span>     int rings;                                      /*!< Number of rings so far */</span><br><span>    int priority;                                   /*!< Dialplan: Current extension priority */</span><br><span style="color: hsl(0, 100%, 40%);">- int macropriority;                              /*!< Macro: Current non-macro priority. See app_macro.c */</span><br><span>        int amaflags;                                   /*!< Set BEFORE PBX is started to determine AMA flags */</span><br><span>  enum ast_channel_adsicpe adsicpe;               /*!< Whether or not ADSI is detected on CPE */</span><br><span>    unsigned int fin;                               /*!< Frames in counters. The high bit is a debug mask, so</span><br><span>@@ -208,8 +207,6 @@</span><br><span>   char exten[AST_MAX_EXTENSION];                  /*!< Dialplan: Current extension number */</span><br><span>        char lastcontext[AST_MAX_CONTEXT];              /*!< Dialplan: Previous extension context */</span><br><span>      char lastexten[AST_MAX_EXTENSION];              /*!< Dialplan: Previous extension number */</span><br><span style="color: hsl(0, 100%, 40%);">-  char macrocontext[AST_MAX_CONTEXT];             /*!< Macro: Current non-macro context. See app_macro.c */</span><br><span style="color: hsl(0, 100%, 40%);">-    char macroexten[AST_MAX_EXTENSION];             /*!< Macro: Current non-macro extension. See app_macro.c */</span><br><span>       char unbridged;                                                 /*!< non-zero if the bridge core needs to re-evaluate the current</span><br><span>                                                                                          bridging technology which is in use by this channel's bridge. */</span><br><span>        char is_t38_active;                                             /*!< non-zero if T.38 is active on this channel. */</span><br><span>@@ -377,22 +374,6 @@</span><br><span>        ast_copy_string(chan->exten, value, sizeof(chan->exten));</span><br><span>      ast_channel_snapshot_invalidate_segment(chan, AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">-const char *ast_channel_macrocontext(const struct ast_channel *chan)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-      return chan->macrocontext;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-void ast_channel_macrocontext_set(struct ast_channel *chan, const char *value)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-   ast_copy_string(chan->macrocontext, value, sizeof(chan->macrocontext));</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-const char *ast_channel_macroexten(const struct ast_channel *chan)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-       return chan->macroexten;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-void ast_channel_macroexten_set(struct ast_channel *chan, const char *value)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_copy_string(chan->macroexten, value, sizeof(chan->macroexten));</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span> </span><br><span> char ast_channel_dtmf_digit_to_emulate(const struct ast_channel *chan)</span><br><span> {</span><br><span>@@ -451,14 +432,6 @@</span><br><span>         chan->hangupcause = value;</span><br><span>        ast_channel_snapshot_invalidate_segment(chan, AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_channel_macropriority(const struct ast_channel *chan)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-       return chan->macropriority;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-void ast_channel_macropriority_set(struct ast_channel *chan, int value)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- chan->macropriority = value;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span> int ast_channel_priority(const struct ast_channel *chan)</span><br><span> {</span><br><span>    return chan->priority;</span><br><span>diff --git a/main/dial.c b/main/dial.c</span><br><span>index 3906bd0..83372e78 100644</span><br><span>--- a/main/dial.c</span><br><span>+++ b/main/dial.c</span><br><span>@@ -654,8 +654,7 @@</span><br><span>                            break;</span><br><span>                       }</span><br><span>                    ast_verb(3, "%s connected line has changed, passing it to %s\n", ast_channel_name(channel->owner), ast_channel_name(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-                        if (ast_channel_connected_line_sub(channel->owner, chan, fr, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                           ast_channel_connected_line_macro(channel->owner, chan, fr, 1, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        if (ast_channel_connected_line_sub(channel->owner, chan, fr, 1)) {</span><br><span>                                ast_indicate_data(chan, AST_CONTROL_CONNECTED_LINE, fr->data.ptr, fr->datalen);</span><br><span>                        }</span><br><span>                    break;</span><br><span>@@ -664,8 +663,7 @@</span><br><span>                                 break;</span><br><span>                       }</span><br><span>                    ast_verb(3, "%s redirecting info has changed, passing it to %s\n", ast_channel_name(channel->owner), ast_channel_name(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-                      if (ast_channel_redirecting_sub(channel->owner, chan, fr, 1) &&</span><br><span style="color: hsl(0, 100%, 40%);">-                              ast_channel_redirecting_macro(channel->owner, chan, fr, 1, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   if (ast_channel_redirecting_sub(channel->owner, chan, fr, 1)) {</span><br><span>                           ast_indicate_data(chan, AST_CONTROL_REDIRECTING, fr->data.ptr, fr->datalen);</span><br><span>                   }</span><br><span>                    break;</span><br><span>diff --git a/main/features.c b/main/features.c</span><br><span>index 39d8aab..a22df94 100644</span><br><span>--- a/main/features.c</span><br><span>+++ b/main/features.c</span><br><span>@@ -372,9 +372,8 @@</span><br><span>        ast_log(LOG_NOTICE, "CHAN: name: %s;  appl: %s; data: %s; contxt: %s;  exten: %s; pri: %d;\n",</span><br><span>             ast_channel_name(chan), ast_channel_appl(chan), ast_channel_data(chan),</span><br><span>              ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan));</span><br><span style="color: hsl(0, 100%, 40%);">-        ast_log(LOG_NOTICE, "CHAN: acctcode: %s;  dialcontext: %s; amaflags: %x; maccontxt: %s;  macexten: %s; macpri: %d;\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_channel_accountcode(chan), ast_channel_dialcontext(chan), ast_channel_amaflags(chan),</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_channel_macrocontext(chan), ast_channel_macroexten(chan), ast_channel_macropriority(chan));</span><br><span style="color: hsl(120, 100%, 40%);">+       ast_log(LOG_NOTICE, "CHAN: acctcode: %s;  dialcontext: %s; amaflags: %x;\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                ast_channel_accountcode(chan), ast_channel_dialcontext(chan), ast_channel_amaflags(chan));</span><br><span>   ast_log(LOG_NOTICE, "CHAN: masq: %p;  masqr: %p; uniqueID: %s; linkedID:%s\n",</span><br><span>             ast_channel_masq(chan), ast_channel_masqr(chan),</span><br><span>             ast_channel_uniqueid(chan), ast_channel_linkedid(chan));</span><br><span>diff --git a/main/pbx.c b/main/pbx.c</span><br><span>index c655f1b..2eeb09d 100644</span><br><span>--- a/main/pbx.c</span><br><span>+++ b/main/pbx.c</span><br><span>@@ -295,7 +295,6 @@</span><br><span>  struct ast_sws alts;              /*!< Alternative switches */</span><br><span>    int refcount;                     /*!< each module that would have created this context should inc/dec this as appropriate */</span><br><span>     int autohints;                    /*!< Whether autohints support is enabled or not */</span><br><span style="color: hsl(0, 100%, 40%);">-        ast_mutex_t macrolock;            /*!< A lock to implement "exclusive" macros - held whilst a call is executing in the macro */</span><br><span> </span><br><span>     /*!</span><br><span>   * Buffer to hold the name & registrar character data.</span><br><span>@@ -5149,49 +5148,6 @@</span><br><span>  return found ? 0 : -1;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \note This function locks contexts list by &conlist, searches for the right context</span><br><span style="color: hsl(0, 100%, 40%);">- * structure, and locks the macrolock mutex in that context.</span><br><span style="color: hsl(0, 100%, 40%);">- * macrolock is used to limit a macro to be executed by one call at a time.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_context_lockmacro(const char *macrocontext)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-      struct ast_context *c;</span><br><span style="color: hsl(0, 100%, 40%);">-  int ret = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   c = find_context_locked(macrocontext);</span><br><span style="color: hsl(0, 100%, 40%);">-  if (c) {</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_unlock_contexts();</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-          /* if we found context, lock macrolock */</span><br><span style="color: hsl(0, 100%, 40%);">-               ret = ast_mutex_lock(&c->macrolock);</span><br><span style="color: hsl(0, 100%, 40%);">-     }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       return ret;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \note This function locks contexts list by &conlist, searches for the right context</span><br><span style="color: hsl(0, 100%, 40%);">- * structure, and unlocks the macrolock mutex in that context.</span><br><span style="color: hsl(0, 100%, 40%);">- * macrolock is used to limit a macro to be executed by one call at a time.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_context_unlockmacro(const char *macrocontext)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-     struct ast_context *c;</span><br><span style="color: hsl(0, 100%, 40%);">-  int ret = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   c = find_context_locked(macrocontext);</span><br><span style="color: hsl(0, 100%, 40%);">-  if (c) {</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_unlock_contexts();</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-          /* if we found context, unlock macrolock */</span><br><span style="color: hsl(0, 100%, 40%);">-             ret = ast_mutex_unlock(&c->macrolock);</span><br><span style="color: hsl(0, 100%, 40%);">-   }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       return ret;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> /*</span><br><span>  * Help for CLI commands ...</span><br><span>  */</span><br><span>@@ -6234,7 +6190,6 @@</span><br><span> </span><br><span>        if ((tmp = ast_calloc(1, length))) {</span><br><span>                 ast_rwlock_init(&tmp->lock);</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_mutex_init(&tmp->macrolock);</span><br><span>              tmp->name = memcpy(&tmp->data[0], name, name_bytes);</span><br><span>               tmp->registrar = memcpy(&tmp->data[name_bytes + 1], registrar, registrar_bytes);</span><br><span>           tmp->root = NULL;</span><br><span>@@ -8094,7 +8049,6 @@</span><br><span>         }</span><br><span>    tmp->root = NULL;</span><br><span>         ast_rwlock_destroy(&tmp->lock);</span><br><span style="color: hsl(0, 100%, 40%);">-  ast_mutex_destroy(&tmp->macrolock);</span><br><span>   ast_free(tmp);</span><br><span> }</span><br><span> </span><br><span>diff --git a/main/pickup.c b/main/pickup.c</span><br><span>index 1db3672..02dbc80 100644</span><br><span>--- a/main/pickup.c</span><br><span>+++ b/main/pickup.c</span><br><span>@@ -328,8 +328,7 @@</span><br><span>       ast_party_id_reset(&connected_caller.priv);</span><br><span> </span><br><span>  connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;</span><br><span style="color: hsl(0, 100%, 40%);">-      if (ast_channel_connected_line_sub(NULL, chan, &connected_caller, 0) &&</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_channel_connected_line_macro(NULL, chan, &connected_caller, 0, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+  if (ast_channel_connected_line_sub(NULL, chan, &connected_caller, 0)) {</span><br><span>          ast_channel_update_connected_line(chan, &connected_caller, NULL);</span><br><span>        }</span><br><span>    ast_party_connected_line_free(&connected_caller);</span><br><span>diff --git a/menuselect/example_menuselect-tree b/menuselect/example_menuselect-tree</span><br><span>index 66f00eb..eb94b8f 100644</span><br><span>--- a/menuselect/example_menuselect-tree</span><br><span>+++ b/menuselect/example_menuselect-tree</span><br><span>@@ -64,8 +64,6 @@</span><br><span>               </member></span><br><span>              <member name="app_lookupcidname" displayname="Look up CallerID Name from local database" remove_on_change="apps/app_lookupcidname.o apps/app_lookupcidname.so"></span><br><span>          </member></span><br><span style="color: hsl(0, 100%, 40%);">-         <member name="app_macro" displayname="Extension Macros" remove_on_change="apps/app_macro.o apps/app_macro.so"></span><br><span style="color: hsl(0, 100%, 40%);">-              </member></span><br><span>              <member name="app_meetme" displayname="MeetMe conference bridge" remove_on_change="apps/app_meetme.o apps/app_meetme.so"></span><br><span>        <depend>zaptel</depend></span><br><span>          </member></span><br><span>diff --git a/menuselect/test/menuselect-tree b/menuselect/test/menuselect-tree</span><br><span>index d36212b..babdc17 100644</span><br><span>--- a/menuselect/test/menuselect-tree</span><br><span>+++ b/menuselect/test/menuselect-tree</span><br><span>@@ -72,8 +72,6 @@</span><br><span>         <depend>jack</depend></span><br><span>    <depend name="resample">libresample</depend></span><br><span> </member></span><br><span style="color: hsl(0, 100%, 40%);">-<member name="app_macro" displayname="Extension Macros" remove_on_change="apps/app_macro.o apps/app_macro.so"></span><br><span style="color: hsl(0, 100%, 40%);">-</member></span><br><span> <member name="app_meetme" displayname="MeetMe conference bridge" remove_on_change="apps/app_meetme.o apps/app_meetme.so"></span><br><span>      <depend>dahdi</depend></span><br><span> </member></span><br><span>diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c</span><br><span>index 648d751..cacd9cd 100644</span><br><span>--- a/pbx/pbx_config.c</span><br><span>+++ b/pbx/pbx_config.c</span><br><span>@@ -2057,14 +2057,8 @@</span><br><span>                  ast_add_extension2(con, 0, cat, -1, NULL, NULL, iface, NULL, NULL, registrar, NULL, 0);</span><br><span>                      /* If voicemail, use "stdexten" else use plain old dial */</span><br><span>                         if (hasvoicemail) {</span><br><span style="color: hsl(0, 100%, 40%);">-                             if (ast_opt_stdexten_macro) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                   /* Use legacy stdexten macro method. */</span><br><span style="color: hsl(0, 100%, 40%);">-                                 snprintf(tmp, sizeof(tmp), "stdexten,%s,${HINT}", cat);</span><br><span style="color: hsl(0, 100%, 40%);">-                                       ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Macro", ast_strdup(tmp), ast_free_ptr, registrar, NULL, 0);</span><br><span style="color: hsl(0, 100%, 40%);">-                           } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                                        snprintf(tmp, sizeof(tmp), "%s,stdexten(${HINT})", cat);</span><br><span style="color: hsl(0, 100%, 40%);">-                                      ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Gosub", ast_strdup(tmp), ast_free_ptr, registrar, NULL, 0);</span><br><span style="color: hsl(0, 100%, 40%);">-                           }</span><br><span style="color: hsl(120, 100%, 40%);">+                             snprintf(tmp, sizeof(tmp), "%s,stdexten(${HINT})", cat);</span><br><span style="color: hsl(120, 100%, 40%);">+                            ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Gosub", ast_strdup(tmp), ast_free_ptr, registrar, NULL, 0);</span><br><span>                        } else {</span><br><span>                             ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Dial", ast_strdup("${HINT}"), ast_free_ptr, registrar, NULL, 0);</span><br><span>                         }</span><br><span>diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c</span><br><span>index 9c0f2fa..58b82a4 100644</span><br><span>--- a/pbx/pbx_dundi.c</span><br><span>+++ b/pbx/pbx_dundi.c</span><br><span>@@ -4786,29 +4786,9 @@</span><br><span>  int res;</span><br><span>     int x;</span><br><span>       int found = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-  if (!strncasecmp(context, "macro-", 6)) {</span><br><span style="color: hsl(0, 100%, 40%);">-             if (!chan) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    ast_log(LOG_NOTICE, "Can't use macro mode without a channel!\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                 return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-              }</span><br><span style="color: hsl(0, 100%, 40%);">-               /* If done as a macro, use macro extension */</span><br><span style="color: hsl(0, 100%, 40%);">-           if (!strcasecmp(exten, "s")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                        exten = pbx_builtin_getvar_helper(chan, "ARG1");</span><br><span style="color: hsl(0, 100%, 40%);">-                      if (ast_strlen_zero(exten))</span><br><span style="color: hsl(0, 100%, 40%);">-                             exten = ast_channel_macroexten(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-                   if (ast_strlen_zero(exten))</span><br><span style="color: hsl(0, 100%, 40%);">-                             exten = ast_channel_exten(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-                        if (ast_strlen_zero(exten)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                           ast_log(LOG_WARNING, "Called in Macro mode with no ARG1 or MACRO_EXTEN?\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                          return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-                      }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-               if (ast_strlen_zero(data))</span><br><span style="color: hsl(0, 100%, 40%);">-                      data = "e164";</span><br><span style="color: hsl(0, 100%, 40%);">-        } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                if (ast_strlen_zero(data))</span><br><span style="color: hsl(0, 100%, 40%);">-                      data = context;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+     if (ast_strlen_zero(data))</span><br><span style="color: hsl(120, 100%, 40%);">+            data = context;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>    res = dundi_lookup(results, MAX_RESULTS, chan, data, exten, 0);</span><br><span>      for (x=0;x<res;x++) {</span><br><span>             if (ast_test_flag(results + x, flag))</span><br><span>@@ -4838,29 +4818,9 @@</span><br><span>       const char *dundiargs;</span><br><span>       struct ast_app *dial;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-       if (!strncasecmp(context, "macro-", 6)) {</span><br><span style="color: hsl(0, 100%, 40%);">-             if (!chan) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    ast_log(LOG_NOTICE, "Can't use macro mode without a channel!\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                 return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-              }</span><br><span style="color: hsl(0, 100%, 40%);">-               /* If done as a macro, use macro extension */</span><br><span style="color: hsl(0, 100%, 40%);">-           if (!strcasecmp(exten, "s")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                        exten = pbx_builtin_getvar_helper(chan, "ARG1");</span><br><span style="color: hsl(0, 100%, 40%);">-                      if (ast_strlen_zero(exten))</span><br><span style="color: hsl(0, 100%, 40%);">-                             exten = ast_channel_macroexten(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-                   if (ast_strlen_zero(exten))</span><br><span style="color: hsl(0, 100%, 40%);">-                             exten = ast_channel_exten(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-                        if (ast_strlen_zero(exten)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                           ast_log(LOG_WARNING, "Called in Macro mode with no ARG1 or MACRO_EXTEN?\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                          return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-                      }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-               if (ast_strlen_zero(data))</span><br><span style="color: hsl(0, 100%, 40%);">-                      data = "e164";</span><br><span style="color: hsl(0, 100%, 40%);">-        } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                if (ast_strlen_zero(data))</span><br><span style="color: hsl(0, 100%, 40%);">-                      data = context;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+     if (ast_strlen_zero(data))</span><br><span style="color: hsl(120, 100%, 40%);">+            data = context;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>    res = dundi_lookup(results, MAX_RESULTS, chan, data, exten, 0);</span><br><span>      if (res > 0) {</span><br><span>            sort_results(results, res);</span><br><span>diff --git a/res/res_fax.c b/res/res_fax.c</span><br><span>index 18d7ab8..79abd8b 100644</span><br><span>--- a/res/res_fax.c</span><br><span>+++ b/res/res_fax.c</span><br><span>@@ -3848,7 +3848,7 @@</span><br><span>                 switch (result) {</span><br><span>            case 'f':</span><br><span>            case 't':</span><br><span style="color: hsl(0, 100%, 40%);">-                       target_context = S_OR(ast_channel_macrocontext(chan), ast_channel_context(chan));</span><br><span style="color: hsl(120, 100%, 40%);">+                     target_context = ast_channel_context(chan);</span><br><span> </span><br><span>                      ast_channel_unlock(chan);</span><br><span>                    ast_frfree(f);</span><br><span>diff --git a/res/snmp/agent.c b/res/snmp/agent.c</span><br><span>index 1a28004..abd0326 100644</span><br><span>--- a/res/snmp/agent.c</span><br><span>+++ b/res/snmp/agent.c</span><br><span>@@ -142,9 +142,6 @@</span><br><span> #define                    ASTCHANAPP                              10</span><br><span> #define                   ASTCHANDATA                             11</span><br><span> #define                   ASTCHANCONTEXT                  12</span><br><span style="color: hsl(0, 100%, 40%);">-#define                       ASTCHANMACROCONTEXT             13</span><br><span style="color: hsl(0, 100%, 40%);">-#define                       ASTCHANMACROEXTEN               14</span><br><span style="color: hsl(0, 100%, 40%);">-#define                       ASTCHANMACROPRI                 15</span><br><span> #define                   ASTCHANEXTEN                    16</span><br><span> #define                   ASTCHANPRI                              17</span><br><span> #define                   ASTCHANACCOUNTCODE              18</span><br><span>@@ -355,20 +352,6 @@</span><br><span>            *var_len = strlen(string_ret);</span><br><span>               ret = (u_char *)string_ret;</span><br><span>          break;</span><br><span style="color: hsl(0, 100%, 40%);">-  case ASTCHANMACROCONTEXT:</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_copy_string(string_ret, ast_channel_macrocontext(chan), sizeof(string_ret));</span><br><span style="color: hsl(0, 100%, 40%);">-                *var_len = strlen(string_ret);</span><br><span style="color: hsl(0, 100%, 40%);">-          ret = (u_char *)string_ret;</span><br><span style="color: hsl(0, 100%, 40%);">-             break;</span><br><span style="color: hsl(0, 100%, 40%);">-  case ASTCHANMACROEXTEN:</span><br><span style="color: hsl(0, 100%, 40%);">-         ast_copy_string(string_ret, ast_channel_macroexten(chan), sizeof(string_ret));</span><br><span style="color: hsl(0, 100%, 40%);">-          *var_len = strlen(string_ret);</span><br><span style="color: hsl(0, 100%, 40%);">-          ret = (u_char *)string_ret;</span><br><span style="color: hsl(0, 100%, 40%);">-             break;</span><br><span style="color: hsl(0, 100%, 40%);">-  case ASTCHANMACROPRI:</span><br><span style="color: hsl(0, 100%, 40%);">-           long_ret = ast_channel_macropriority(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-             ret = (u_char *)&long_ret;</span><br><span style="color: hsl(0, 100%, 40%);">-          break;</span><br><span>       case ASTCHANEXTEN:</span><br><span>           ast_copy_string(string_ret, ast_channel_exten(chan), sizeof(string_ret));</span><br><span>            *var_len = strlen(string_ret);</span><br><span>@@ -854,9 +837,6 @@</span><br><span>                 {ASTCHANAPP,             ASN_OCTET_STR, RONLY, ast_var_channels_table,      4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANAPP}},</span><br><span>          {ASTCHANDATA,            ASN_OCTET_STR, RONLY, ast_var_channels_table,      4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANDATA}},</span><br><span>                 {ASTCHANCONTEXT,         ASN_OCTET_STR, RONLY, ast_var_channels_table,      4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCONTEXT}},</span><br><span style="color: hsl(0, 100%, 40%);">-         {ASTCHANMACROCONTEXT,    ASN_OCTET_STR, RONLY, ast_var_channels_table,      4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANMACROCONTEXT}},</span><br><span style="color: hsl(0, 100%, 40%);">-            {ASTCHANMACROEXTEN,      ASN_OCTET_STR, RONLY, ast_var_channels_table,      4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANMACROEXTEN}},</span><br><span style="color: hsl(0, 100%, 40%);">-              {ASTCHANMACROPRI,        ASN_INTEGER,   RONLY, ast_var_channels_table,      4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANMACROPRI}},</span><br><span>             {ASTCHANEXTEN,           ASN_OCTET_STR, RONLY, ast_var_channels_table,      4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANEXTEN}},</span><br><span>                {ASTCHANPRI,             ASN_INTEGER,   RONLY, ast_var_channels_table,      4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANPRI}},</span><br><span>          {ASTCHANACCOUNTCODE,     ASN_OCTET_STR, RONLY, ast_var_channels_table,      4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANACCOUNTCODE}},</span><br><span>diff --git a/utils/extconf.c b/utils/extconf.c</span><br><span>index f5c639b..40c0fb0 100644</span><br><span>--- a/utils/extconf.c</span><br><span>+++ b/utils/extconf.c</span><br><span>@@ -2398,7 +2398,6 @@</span><br><span>         struct ast_ignorepat *ignorepats;       /*!< Patterns for which to continue playing dialtone */</span><br><span>   const char *registrar;                  /*!< Registrar */</span><br><span>         AST_LIST_HEAD_NOLOCK(, ast_sw) alts;    /*!< Alternative switches */</span><br><span style="color: hsl(0, 100%, 40%);">- ast_mutex_t macrolock;                  /*!< A lock to implement "exclusive" macros - held whilst a call is executing in the macro */</span><br><span>   char name[0];                           /*!< Name of the context */</span><br><span> };</span><br><span> </span><br><span>@@ -4728,7 +4727,6 @@</span><br><span>     }</span><br><span>    if ((tmp = ast_calloc(1, length))) {</span><br><span>                 ast_rwlock_init(&tmp->lock);</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_mutex_init(&tmp->macrolock);</span><br><span>              strcpy(tmp->name, name);</span><br><span>          tmp->root = NULL;</span><br><span>                 tmp->registrar = registrar;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19708">change 19708</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/19708"/><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-Change-Id: I830daab293117179b8d61bd4df0d971a1b3d07f6 </div>
<div style="display:none"> Gerrit-Change-Number: 19708 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>