[asterisk-users] AEL in 1.6 and Gosub
Steve Murphy
murf at parsetree.com
Tue Mar 16 18:40:59 CDT 2010
On Mon, Mar 15, 2010 at 12:47 PM, Klaus Darilion <
klaus.mailinglists at pernau.at> wrote:
>
>
> Am 15.03.2010 13:48, schrieb Kevin P. Fleming:
> > Klaus Darilion wrote:
> >> Hi!
> >>
> >> I just updated from 1.4 to 1.6.2.6 and Asterisk complains about my AEL
> >> dialplan:
> >>
> >> application call to Gosub affects flow of control, and needs to
> >> be re-written using AEL if, while, goto, etc. keywords instead
> >>
> >> What is the suggested replacement for an explicit Gosub() call? I use it
> >> like this:
> >>
> >> ...
> >> Gosub(blacklist,${exten},1);
> >> ...
> >>
> >> context blacklist {
> >> _+43900! => Hangup();
> >> _+43910! => Hangup();
> >> _+X. => return;
> >>
> >> }
>
How about:
....
&blacklist(${exten});
....
macro blacklist(the_exten)
{
switch(the_exten)
{
pattern +4390[01]: Hangup();
default: return;
}
}
You could use something like the above.
Basically, you are using the pattern matching capability to
end the call for certain extensions... so the above should
come close. If you really, really want to keep your gosub call,
then you can, you'll just have to ignore the warnings, iirc.
murf
>
> > In 1.6, AEL macro() is implemented using Gosub(), so you can use it as a
> > direct replacement. This is listed in the CHANGES file.
>
> Hi Kevin!
>
> I know that AEL macro does not use Macro() anymore, but Gosub(). But
> does that imply the other way round too?
>
> Using an AEL macro (which is implemented as Gosub) instead of a Gosub
> does not work as the target is a context, not a macro which is
> implemented as pseudo context with an 's' extension.
>
> I do not see a way to implement the above dialplan using an AEL macro.
> Do I miss something?
>
> regards
> Klaus
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
> http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
--
Steve Murphy
ParseTree Corp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100316/15a84733/attachment.htm
More information about the asterisk-users
mailing list