<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 20, 2015 at 10:52 AM, Bastian Schern <span dir="ltr"><<a href="mailto:ml04@reventix.de" target="_blank">ml04@reventix.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Everybody,<br></blockquote><div>Howdy</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
in past times I used macros but since a while they are deprecated.<br>
So I replaced my macros with subroutines. In most cases this is really no problem.<br>
<br>
But in some rare cases I miss the macro channel variables (e.g. ${MACRO_CONTEXT}).<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Dialplan+Macros+Channel+Variables" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Dialplan+Macros+Channel+Variables</a><br>
<br>
Is there something similar for subroutines?<br></blockquote><div>Due to the nature of GoSub() vs. Macro() there is no built in channel variable which carries </div><div>that information with a GoSub(). Devs keep me honest here.</div><div><br></div><div>If the subroutine needs to know what part of dialplan the channel came from I recommend </div><div>sending the information as an ARG in the nested set of parenthesis when executing the </div><div>GoSub() application.</div><div><br></div><div>exten => _7XXX,1,GoSub(subDialer,begin,1(${CONTEXT}))</div><div><br></div><div><br></div><div>[subDialer]</div><div>exten => begin,1,Verbose(0, This subroutine was executed from the ${ARG1} context.)</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Kind regards<span><font color="#888888"><br>
Bastian<br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" rel="noreferrer" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><font face="courier new, monospace" color="#444444">Justin Hester</font></div><div><font face="courier new, monospace" color="#444444">Digium, Inc. · Technical Trainer</font></div><div><font face="courier new, monospace" color="#444444">445 Jan Davis Drive NW · Huntsville, AL 35806 · USA</font></div><div><font face="courier new, monospace" color="#444444">ph: +1 256 428 6238</font></div><div><font face="courier new, monospace" color="#444444">Check us out at: <a href="https://www.digium.com" target="_blank">https://www.digium.com</a> · <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></font></div></div></div></div></div>
</div></div>