Re: [asterisk-users] clarification on gosub, macros and AEL

2019-10-16 Thread Julian Beach
Hello Joshua,

Wednesday, October 16, 2019, 10:39:27 AM, you wrote:

> The module is still present, it just isn't built by default. It
> requires explicit enabling using menuselect.

I was obviously too concerned about the rebuilding of wanpipe with a
new kernel version to notice anything about macros in menuselect! As I
said, it is not hard to convert from macro to gosub, once I had worked
out why my dialplan wasn't working.

-- 
Best regards,
 Julianmailto:jb_s...@trink.co.uk


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] clarification on gosub, macros and AEL

2019-10-16 Thread Joshua C. Colp
On Wed, Oct 16, 2019, at 6:28 AM, Julian Beach wrote:
> Hello Doug,
> 
> Tuesday, October 15, 2019, 5:07:45 PM, you wrote:
> 
> > Personally, I don't think MACROS are going anywhere any time soon,
> > so I have not bothered looking into a substitution.
> 
> Haven't they gone in Asterisk 16? I've just upgraded from Asterisk 13
> and had to do some hasty re-writing of my dialplan to convert the
> Macros into Gosubs because the Macros did not work (I had noticed the
> deprecation notice previously, but forgot about it). I didn't have
> many, so I did them by hand, but it would be easy to script.

The module is still present, it just isn't built by default. It requires 
explicit enabling using menuselect.

-- 
Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] clarification on gosub, macros and AEL

2019-10-16 Thread Julian Beach
Hello Doug,

Tuesday, October 15, 2019, 5:07:45 PM, you wrote:

> Personally, I don't think MACROS are going anywhere any time soon,
> so I have not bothered looking into a substitution.

Haven't they gone in Asterisk 16? I've just upgraded from Asterisk 13
and had to do some hasty re-writing of my dialplan to convert the
Macros into Gosubs because the Macros did not work (I had noticed the
deprecation notice previously, but forgot about it). I didn't have
many, so I did them by hand, but it would be easy to script.

Julian

-- 
Best regards,
 Julianmailto:jb_s...@trink.co.uk


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] clarification on gosub, macros and AEL

2019-10-15 Thread C.Maj
I think the WARNING on Gosub() calls from AEL could change to NOTICE; or
at least get more specific, such as "instead of calling Gosub()
directly, please try an AEL macro."

A new AEL keyword to eventually replace "macro", such as "subcontext",
might help clarify things, too.

But it should work fine even with the WARNING messages -- as long as you
are careful* -- because in modern AEL, these two lines make for
equivalent dial plan configuration:

  ();
  Gosub(some-macro,~~s~~,1);

I prefer the former because it is less to type. Although in some cases,
such as the Dial() application option "b", the ampersand prefix format
won't work, requiring the longer format with ~~s~~ if you want to enter
the macro at the default entry point:

  Dial(PJSIP/1234,,b(some-macro^~~s~~^1));

* However, auto-conversion of macro parameters to local custom variables
is (currently) only handled when entering the default entry point ~~s~~.
So the following AEL example will parse with one WARNING but the Dial()
might not be doing what you expect from just looking at the first line
of the macro definition:

macro mac-test( ext_ ) {
  catch BLEG {
NoOp(Oops ext_ is blank: ${ext_}. Use ARG1 instead: ${ARG1}.);
return;
  }
  NoOp(But ext_ is NOT blank at default entry point: ${ext_}.);
  return;
}

context ctx-start {
  _ => {
(${EXTEN}); // default entry, $ext_ will be same as $EXTEN
Gosub(mac-test,~~s~~,1(${EXTEN})); // ditto, with a WARNING
Dial(PJSIP/${EXTEN},2,b(mac-test^BLEG^1(${EXTEN}))); // ext_ blank
  }
}

...a corner case like that is why some level of concern should probably
still be raised in the logs on direct Gosub() calls from AEL -- but not
prohibited.


Kind Regards,

-- 
鸞 C. Maj, Technology Captain @ Penguin PBX Solutions
 USA Toll Free 1-833-PNGNPBX (1-833-764-6729)
酪 International & SMS Texting +1.720.32.42.72.9
 https://www.PenguinPBX.com/

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] clarification on gosub, macros and AEL

2019-10-15 Thread Eric Wieling

For all new dialplan, I recommend using Gosub.

From https://www.voip-info.org/asterisk-ael2/ :
This will complement the fact that Macros will be implemented with 
Gosub() calls instead of Macro() calls from now on, to avoid restricted 
memory issues. [I think this started in Asterisk 1.4)


On 10/15/19 12:07 PM, Doug Lytle wrote:

Nobody has any information or opinions on any of this?


Personally, I don't think MACROS are going anywhere any time soon, so I have 
not bothered looking into a substitution.

As for ael; I've never used it.

Doug



--
http://help.nyigc.net/

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] clarification on gosub, macros and AEL

2019-10-15 Thread Antony Stone
On Friday 11 October 2019 at 20:12:43, Brian J. Murrell wrote:

> I'm trying to clarify my understand of gosub, macros and AEL.

Sounds more like a question for the developers' list.


Antony.

-- 
I think broken pencils are pointless.

   Please reply to the list;
 please *don't* CC me.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] clarification on gosub, macros and AEL

2019-10-15 Thread Doug Lytle
>>> Nobody has any information or opinions on any of this?

Personally, I don't think MACROS are going anywhere any time soon, so I have 
not bothered looking into a substitution.

As for ael; I've never used it.

Doug

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] clarification on gosub, macros and AEL

2019-10-15 Thread Brian J. Murrell
On Fri, 2019-10-11 at 14:12 -0400, Brian J. Murrell wrote:
> I'm trying to clarify my understand of gosub, macros and AEL.
> 
> My understanding is that macros using the Macro() application, which
> is
> defined in extensions.conf by:
> 
> [macro-foo]
> ...
> 
> and called in extensions.conf with
> 
> exten => _9NXXNXX.,n,Macro(fastbusy)
> 
> is deprecated in favour of Gosub().  True so far?
> 
> But then there are "macro"s defined in extensions.ael:
> 
> macro foo() { ... }
> 
> and called in extensions.ael with:
> 
> (...)
> 
> These are not deprecated because they use Gosub() underneath and not
> Macro()?  Still good so far?
> 
> So if macros in extensions.ael are not deprecated because they just
> use
> Gosub() underneath them, when why, when I try to use Gosub() and
> contexts in extensions.ael directly do I get warnings like:
> 
> [Oct 11 13:50:55] WARNING[10343]: ael/pval.c:2526 check_pval_item:
> Warning: file /etc/asterisk/extensions.ael, line 552-552: application
> call to Gosub affects flow of control, and needs to be re-written
> using AEL if, while, goto, etc. keywords instead!
> 
> but not with these Gosub() implemented "macros"?

Nobody has any information or opinions on any of this?

Cheers,
b.



signature.asc
Description: This is a digitally signed message part
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] clarification on gosub, macros and AEL

2019-10-11 Thread Brian J. Murrell
I'm trying to clarify my understand of gosub, macros and AEL.

My understanding is that macros using the Macro() application, which is
defined in extensions.conf by:

[macro-foo]
...

and called in extensions.conf with

exten => _9NXXNXX.,n,Macro(fastbusy)

is deprecated in favour of Gosub().  True so far?

But then there are "macro"s defined in extensions.ael:

macro foo() { ... }

and called in extensions.ael with:

(...)

These are not deprecated because they use Gosub() underneath and not
Macro()?  Still good so far?

So if macros in extensions.ael are not deprecated because they just use
Gosub() underneath them, when why, when I try to use Gosub() and
contexts in extensions.ael directly do I get warnings like:

[Oct 11 13:50:55] WARNING[10343]: ael/pval.c:2526 check_pval_item: Warning: 
file /etc/asterisk/extensions.ael, line 552-552: application call to Gosub 
affects flow of control, and needs to be re-written using AEL if, while, goto, 
etc. keywords instead!

but not with these Gosub() implemented "macros"?

Cheers,
b.



signature.asc
Description: This is a digitally signed message part
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users