Re: [asterisk-users] AEL switch & case

2022-08-31 Thread Antony Stone
Replying to list this time...

On Wednesday 31 August 2022 at 12:47:13, aster...@phreaknet.org wrote:

> On 8/31/2022 6:32 AM, Antony Stone wrote:
> > Hi.
> > 
> > I think I've discovered a bug in either the implementation or the
> > documentation of the AEL switch command.
> > 
> > https://wiki.asterisk.org/wiki/display/AST/AEL+Conditionals gives an
> > example of using switch, and states at the bottom:
> > 
> > "Neither the switch nor case values are wrapped in $[ ]; they can be
> > constants, or ${var} type references only."
> > 
> > However, I've run into a problem, which can be demonstrated by the simple
> > context:
> > 
> > context SwitchTest {
> >s => {
> >  Set(FortyTwo=42);
> >  Set(SixByNine=54);
> >  switch(${SixByNine}) {
> >case 123:
> >  NoOp(123);
> >  break;
> >case ${FortyTwo}:
> >  NoOp(${FortyTwo});
> >  break;
> >  }
> >}
> > }

> > Am I misundertanding "they can be constants, or ${var} type references
> > only."?
> 
> I don't think this is a bug. ${FortyTwo} is not defined when the AEL
> dialplan is transpiled into dialplan. It only gets set at runtime.

Agreed, however that is surely a perfectly reasonable "${var} type reference"?

> This might work if you made FortyTwo a global variable, which would be
> available when this gets parsed.

Quite possibly, but I would expect switch() to work in the same way as 
multiple if() statements:

switch(${a}) {
  case ${b}: NoOp(${b} matches); break;
  case ${c}: NoOp(${c} matches); break;
// etc
}

should be equivalent to:

if(${a}=${b}) NoOp(${b} matches);
if(${a}=${c}) NoOp(${c} matches);
// etc

The latter works perfectly well, no matter when ${b} and ${c} are assigned 
their values.

I've adjusted my dialplan to use multiple if()s, but I still thik that either 
the implementation or the documentation of switch is incorrect.


Antony.

-- 
I bought a book on memory techniques, but I've forgotten where I put it.

   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] AEL keyword IfTime with variable on time range

2015-05-13 Thread Rafael dos Santos Saraiva
Solved!!


Set(time_01=06:00-12:00,*,*,*);
Set(time_02=12:00-18:00,*,*,*);
Set(time_03=18:00-06:00,*,*,*);

if(${IFTIME(${time_01}?1:0)} == 1) {
NoOp(Bom dia);
Playback(beep);
} else if(${IFTIME(${time_02}?1:0)} == 1) {
NoOp(Boa tarde);
Playback(beep);
} else if(${IFTIME(${time_03}?1:0)} == 1) {
NoOp(Boa noite);
Playback(beep);
}


Thank's



[image: Sua Foto] rafaels...@gmail.comRafael S. SaraivaPorto Alegre - RS
| Mobile:  (51) 8174-7956
http://br.linkedin.com/pub/rafael-saraiva/52/aab/230
https://plus.google.com/u/0/+RafaelSaraivaRS

2015-05-12 14:39 GMT-03:00 Rafael dos Santos Saraiva rafaels...@gmail.com:

 Sorry, I forget to tell I tried, but not works.

 *Context:*
 context ivr_temp2 {
 s = {
 Proceeding();
 str_time_01 = '06:00-12:00|*|*|*';  // Manhã
 ifTime (${str_time_01}) {
 Playback(ura/bom_dia);
 }
 }
 }

 The error is showed on ael reload.

 *Console errors:*
 rssr304*CLI ael reload
 Command 'ael reload' failed.
 [May 12 14:31:52] NOTICE[20773]: pbx_ael.c:164 pbx_load_module: Starting
 AEL load process.
 [May 12 14:31:52] ERROR[20773]: ael.y:840 ael_yyerror:  File:
 /etc/asterisk/extensions.ael, Line 315, Cols: 32-32: Error: syntax error,
 unexpected ')', expecting '|'
 [May 12 14:31:52] NOTICE[20773]: pbx_ael.c:177 pbx_load_module: AEL load
 process: parsed config file name '/etc/asterisk/extensions.ael'.
 [May 12 14:31:52] ERROR[20773]: pbx_ael.c:197 pbx_load_module: Sorry, but
 1 syntax errors and 0 semantic errors were detected. It doesn't make sense
 to compile.




 [image: Sua Foto] rafaels...@gmail.comRafael S. SaraivaPorto Alegre -
 RS | Mobile:  (51) 8174-7956
 http://br.linkedin.com/pub/rafael-saraiva/52/aab/230
 https://plus.google.com/u/0/+RafaelSaraivaRS

 2015-05-12 13:51 GMT-03:00 Tech Support aster...@voipbusiness.us:

 You should try it and find out if it works. If it does, let us know.

 Regards;

 John



 *From:* asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] *On Behalf Of *Rafael dos
 Santos Saraiva
 *Sent:* Tuesday, May 12, 2015 11:58 AM
 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* [asterisk-users] AEL keyword IfTime with variable on time
 range



 Hi



 It's possible using a variable in the iftime keyword argument?



 E.g:



 context text {

  s = {

   timerange = '06:00-12:00|*|*|*';

   ifTime(${timerange} {

Playback(ivr/goodbye);

   }

  }

 }





 thanks




 [image: Image removed by sender. Sua Foto] rafaels...@gmail.com

 *Rafael S. Saraiva*

 Porto Alegre - RS | Mobile: [image: Image removed by sender.] (51)
 8174-7956

 [image: Image removed by sender.]
 http://br.linkedin.com/pub/rafael-saraiva/52/aab/230 [image: Image
 removed by sender.] https://plus.google.com/u/0/+RafaelSaraivaRS



 --
 _
 -- 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



-- 
_
-- 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

Re: [asterisk-users] AEL keyword IfTime with variable on time range

2015-05-12 Thread Rafael dos Santos Saraiva
Sorry, I forget to tell I tried, but not works.

*Context:*
context ivr_temp2 {
s = {
Proceeding();
str_time_01 = '06:00-12:00|*|*|*';  // Manhã
ifTime (${str_time_01}) {
Playback(ura/bom_dia);
}
}
}

The error is showed on ael reload.

*Console errors:*
rssr304*CLI ael reload
Command 'ael reload' failed.
[May 12 14:31:52] NOTICE[20773]: pbx_ael.c:164 pbx_load_module: Starting
AEL load process.
[May 12 14:31:52] ERROR[20773]: ael.y:840 ael_yyerror:  File:
/etc/asterisk/extensions.ael, Line 315, Cols: 32-32: Error: syntax error,
unexpected ')', expecting '|'
[May 12 14:31:52] NOTICE[20773]: pbx_ael.c:177 pbx_load_module: AEL load
process: parsed config file name '/etc/asterisk/extensions.ael'.
[May 12 14:31:52] ERROR[20773]: pbx_ael.c:197 pbx_load_module: Sorry, but 1
syntax errors and 0 semantic errors were detected. It doesn't make sense to
compile.




[image: Sua Foto] rafaels...@gmail.comRafael S. SaraivaPorto Alegre - RS
| Mobile:  (51) 8174-7956
http://br.linkedin.com/pub/rafael-saraiva/52/aab/230
https://plus.google.com/u/0/+RafaelSaraivaRS

2015-05-12 13:51 GMT-03:00 Tech Support aster...@voipbusiness.us:

 You should try it and find out if it works. If it does, let us know.

 Regards;

 John



 *From:* asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] *On Behalf Of *Rafael dos Santos
 Saraiva
 *Sent:* Tuesday, May 12, 2015 11:58 AM
 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* [asterisk-users] AEL keyword IfTime with variable on time range



 Hi



 It's possible using a variable in the iftime keyword argument?



 E.g:



 context text {

  s = {

   timerange = '06:00-12:00|*|*|*';

   ifTime(${timerange} {

Playback(ivr/goodbye);

   }

  }

 }





 thanks




 [image: Image removed by sender. Sua Foto] rafaels...@gmail.com

 *Rafael S. Saraiva*

 Porto Alegre - RS | Mobile: [image: Image removed by sender.] (51)
 8174-7956

 [image: Image removed by sender.]
 http://br.linkedin.com/pub/rafael-saraiva/52/aab/230 [image: Image
 removed by sender.] https://plus.google.com/u/0/+RafaelSaraivaRS



 --
 _
 -- 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

-- 
_
-- 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

Re: [asterisk-users] AEL keyword IfTime with variable on time range

2015-05-12 Thread Tech Support
You should try it and find out if it works. If it does, let us know.

Regards;

John

 

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Rafael dos Santos 
Saraiva
Sent: Tuesday, May 12, 2015 11:58 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] AEL keyword IfTime with variable on time range

 

Hi

 

It's possible using a variable in the iftime keyword argument?

 

E.g:

 

context text {

 s = {

  timerange = '06:00-12:00|*|*|*';

  ifTime(${timerange} {

   Playback(ivr/goodbye);

  }

 }

}

 

 

thanks




 


 mailto:rafaels...@gmail.com Image removed by sender. Sua Foto

Rafael S. Saraiva


Porto Alegre - RS | Mobile: Image removed by sender. (51) 8174-7956


 http://br.linkedin.com/pub/rafael-saraiva/52/aab/230 Image removed by 
sender.  https://plus.google.com/u/0/+RafaelSaraivaRS Image removed by sender.

 

-- 
_
-- 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

Re: [asterisk-users] AEL Macro are evil :-)

2013-02-24 Thread Mitul Limbani
Hi,

You might want to use ${MACRO_EXTEN} variable inside to preserve exten
variable of the original dialplan exten variable.

Mitul
On Feb 24, 2013 4:04 PM, Leandro Dardini ldard...@gmail.com wrote:

 I just discover an hidden problem with AEL macro I want to have your
 feedback. If you use a macro to dial out, like dialout(${EXTEN}), the leg
 extension will became s and if it happens you transfer the call,
 that will be the callerid appearing on the other phone display.
 I am just rewriting all the dialplan getting rid of the macro and using
 gosub, even if asterisk is complaining about  application call to gosub
 affects flow of control, and needs to be re-written using AEL if, while,
 goto, etc. keywords instead!, but I am not seeing any other way...

 Leandro



 --
 _
 -- 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

--
_
-- 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

Re: [asterisk-users] AEL Macro are evil :-)

2013-02-24 Thread Vieri
This link may be a bit too old:
https://issues.asterisk.org/jira/browse/ASTERISK-9518
so maybe using MACRO_EXTEN won't work with macros in AEL.
Haven't tried that.

Vieri

--- On Sun, 2/24/13, Mitul Limbani mi...@enterux.in wrote:

Hi,
You might want to use ${MACRO_EXTEN} variable inside to preserve exten variable 
of the original dialplan exten variable.
Mitul
On Feb 24, 2013 4:04 PM, Leandro Dardini ldard...@gmail.com wrote:

I just discover an hidden problem with AEL macro I want to have your 
feedback. If you use a macro to dial out, like dialout(${EXTEN}), the leg 
extension will became s and if it happens you transfer the call, that 
will be the callerid appearing on the other phone display.

I am just rewriting all the dialplan getting rid of the macro and using gosub, 
even if asterisk is complaining about  application call to gosub affects flow 
of control, and needs to be re-written using AEL if, while, goto, etc. keywords 
instead!, but I am not seeing any other way...


Leandro



--

_

-- 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


-Inline Attachment Follows-

--
_
-- 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--
_
-- 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

Re: [asterisk-users] AEL Macro are evil :-)

2013-02-24 Thread Leandro Dardini
Knowing the exten variable of the original dialplan is not a problem. The
problem is just when the call is transferred via blind transfer. Asterisk
does a little magic with the callerid of the legs and using Macro, just
breaks it.

If Joe at ext 100 call Sally at ext 200 and then Joe transfers the call to
Bob at ext 300, then Bob will see the callerid 200 on his phone. That is
not true if the dial is made inside a Macro. In this way, Bob will see
s

The macro can be something as simple as:

macro dialpeer(number) {
   dial(SIP/number);
}

Leandro

2013/2/24 Mitul Limbani mi...@enterux.in

 Hi,

 You might want to use ${MACRO_EXTEN} variable inside to preserve exten
 variable of the original dialplan exten variable.

 Mitul
 On Feb 24, 2013 4:04 PM, Leandro Dardini ldard...@gmail.com wrote:

 I just discover an hidden problem with AEL macro I want to have your
 feedback. If you use a macro to dial out, like dialout(${EXTEN}), the leg
 extension will became s and if it happens you transfer the call,
 that will be the callerid appearing on the other phone display.
 I am just rewriting all the dialplan getting rid of the macro and using
 gosub, even if asterisk is complaining about  application call to gosub
 affects flow of control, and needs to be re-written using AEL if, while,
 goto, etc. keywords instead!, but I am not seeing any other way...

 Leandro



 --
 _
 -- 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


 --
 _
 -- 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

--
_
-- 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

Re: [asterisk-users] AEL x LUA

2011-12-13 Thread Matthew Nicholson
On Tue, 2011-12-13 at 16:00 -0200, Antonio Modesto wrote:
 Hello,
 
 I would like to receive some suggestions about dialplans written
 in lua, actually my dialplan is written in ael, but i'm having some
 problems with it. I noticed that asterisk just translates ael to the
 old extension language, does it do the same with lua?
 

No, it does not translate the lua file into dialplan. The lua code is
executed as is.

-- 
Matthew Nicholson
Digium, Inc. | Software Developer


--
_
-- 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


Re: [asterisk-users] ael context ~~s~~ in macros broke Dial() U() option in 1.6.2.17.2 and newer

2011-08-08 Thread Mark G Thomas
Hi,

This is still broken in 1.6.2.20. Please see below.

On Fri, May 06, 2011 at 04:27:42PM +, Watkins, Bradley wrote:
 From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
 boun...@lists.digium.com] On Behalf Of Mark G Thomas
 Sent: Friday, May 06, 2011 12:02 PM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: Re: [asterisk-users] ael context ~~s~~ in macros broke Dial() U()
 option in 1.6.2.17.2 and newer
 
 Hi,
 
 On Thu, May 05, 2011 at 05:30:04PM -0400, Paul Belanger wrote:
  On 11-05-05 05:14 PM, Mark G Thomas wrote:
  Hi,
  
  I think this must be a bug introduced with 1.6.2.17.something.
  
  When I upgrade from asterisk-1.6.2.16.1 to asterisk-1.6.2.17.2 or
  1.6.2.18, my AEL Dial() commands with the U options fail with the
 following error:
  
  [May  3 12:05:54] ERROR[6300] app_stack.c: Attempt to reach a non-
 existent
   destination for gosub: (Context:screen, Extension:s, Priority:1)
  
  You might want to have a look at:
  https://issues.asterisk.org/view.php?id=18910
 
 Thanks. This is it.
 
 If I'm reading this right, it describes the change which broke things for me,
 but no solution applicable to my Dial() command U flag, which is invoking my
 AEL GoSub (Macro). Switching the Dials back to the M flag doesn't fix it
 either.
 
 It sure seems to me this change to AEL has had unexpected consequences in
 terms of breaking things in dialplans.
 
 
 I was under the impression that this had been fixed, although perhaps it's 
 not yet in a release.  Is there a chance you try with the latest 1.6.2 branch 
 from SVN?
 
 - Brad

In AEL, Dial() with the U flag is still broken. 

Reverting to a pre-1.6.2.17.2 pval.c fixes the problem.

[Aug  8 13:36:01] ERROR[24608]: app_stack.c:402 gosub_exec: Attempt to reach a 
non-existent destination for gosub: (Context:screen, Extension:s, Priority:1)

My AEL dialplan segment:
--
context internals {
102 = {
Dial(${MARKCELL},30,tgU(screen));
jump s@home-menu;
};
};

macro screen() {
Wait(0.5);
Read(ACCEPT,followme/options,1,,1,20);
if( ${ACCEPT} = 1 ) {
Background(connecting);
} else {
Set(GOSUB_RESULT=CONTINUE);
};
return;
};

Here's the dialplan it created under 1.6.2.20, but U(screen)
in Dial() tries to call screen,s which doesn't exist.
---
[ Context 'internals' created by 'pbx_ael' ]
  '102' =  1. Dial(${MARKCELL},30,tgU(screen))   [pbx_ael]
2. Goto(home-menu,s,1)[pbx_ael]

[ Context 'screen' created by 'pbx_ael' ]
  '~~s~~' =1. Wait(0.5)  [pbx_ael]
2. Read(ACCEPT,followme/options,1,,1,20)  [pbx_ael]
3. GotoIf($[ ${ACCEPT} = 1 ]?4:6) [pbx_ael]
4. Background(connecting) [pbx_ael]
5. Goto(7)[pbx_ael]
6. Set(GOSUB_RESULT=CONTINUE) [pbx_ael]
7. NoOp(Finish if_screen_25)  [pbx_ael]
8. Return()   [pbx_ael]


This works, from an earlier version, before the pval.c change:

[ Context 'screen' created by 'pbx_ael' ]
  's' =1. Wait(0.5)  [pbx_ael]
2. Read(ACCEPT,followme/options,1,,1,20)  [pbx_ael]
3. GotoIf($[ ${ACCEPT} = 1 ]?4:6) [pbx_ael]
4. Background(connecting) [pbx_ael]
5. Goto(7)[pbx_ael]
6. Set(GOSUB_RESULT=CONTINUE) [pbx_ael]
7. NoOp(Finish if_screen_25)  [pbx_ael]
8. Return()   [pbx_ael]



-- 
Mark G. Thomas (m...@misty.com)
Web: http://mgtinternet.com/
Tel: +1-215-512-0112 US: 877-512-0112

--
_
-- 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


Re: [asterisk-users] ael context ~~s~~ in macros broke Dial() U() option in 1.6.2.17.2 and newer

2011-05-06 Thread Mark G Thomas
Hi,

On Thu, May 05, 2011 at 05:30:04PM -0400, Paul Belanger wrote:
 On 11-05-05 05:14 PM, Mark G Thomas wrote:
 Hi,
 
 I think this must be a bug introduced with 1.6.2.17.something.
 
 When I upgrade from asterisk-1.6.2.16.1 to asterisk-1.6.2.17.2 or 1.6.2.18,
 my AEL Dial() commands with the U options fail with the following error:
 
 [May  3 12:05:54] ERROR[6300] app_stack.c: Attempt to reach a non-existent
  destination for gosub: (Context:screen, Extension:s, Priority:1)
 
 You might want to have a look at:
 https://issues.asterisk.org/view.php?id=18910

Thanks. This is it.

If I'm reading this right, it describes the change which broke things for me,
but no solution applicable to my Dial() command U flag, which is invoking 
my AEL GoSub (Macro). Switching the Dials back to the M flag doesn't fix 
it either.

It sure seems to me this change to AEL has had unexpected consequences
in terms of breaking things in dialplans.

Mark


-- 
Mark G. Thomas (m...@misty.com)
Web: http://mgtinternet.com/
Tel: +1-215-512-0112 US: 877-512-0112

--
_
-- 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


Re: [asterisk-users] ael context ~~s~~ in macros broke Dial() U() option in 1.6.2.17.2 and newer

2011-05-06 Thread Watkins, Bradley



The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it.

From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
boun...@lists.digium.com] On Behalf Of Mark G Thomas
Sent: Friday, May 06, 2011 12:02 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] ael context ~~s~~ in macros broke Dial() U()
option in 1.6.2.17.2 and newer

Hi,

On Thu, May 05, 2011 at 05:30:04PM -0400, Paul Belanger wrote:
 On 11-05-05 05:14 PM, Mark G Thomas wrote:
 Hi,
 
 I think this must be a bug introduced with 1.6.2.17.something.
 
 When I upgrade from asterisk-1.6.2.16.1 to asterisk-1.6.2.17.2 or
 1.6.2.18, my AEL Dial() commands with the U options fail with the
following error:
 
 [May  3 12:05:54] ERROR[6300] app_stack.c: Attempt to reach a non-
existent
  destination for gosub: (Context:screen, Extension:s, Priority:1)
 
 You might want to have a look at:
 https://issues.asterisk.org/view.php?id=18910

Thanks. This is it.

If I'm reading this right, it describes the change which broke things for me,
but no solution applicable to my Dial() command U flag, which is invoking my
AEL GoSub (Macro). Switching the Dials back to the M flag doesn't fix it
either.

It sure seems to me this change to AEL has had unexpected consequences in
terms of breaking things in dialplans.


I was under the impression that this had been fixed, although perhaps it's not 
yet in a release.  Is there a chance you try with the latest 1.6.2 branch from 
SVN?

- Brad


--
_
-- 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


Re: [asterisk-users] AEL Eswitches

2011-02-09 Thread Tilghman Lesher
On Wednesday 09 February 2011 13:31:36 Thiago Maluf wrote:
 Hi List,
 
 Would someone can to explain me the main difference in SWITCHES or
 ESWITCHES in AEL.
 
 context default {
 switches {
  DUNDi/e164;
  IAX2/box5;
 };
 eswitches {
  IAX2/context@${CURSERVER};
 };
 };

A switch evaluates variables at load time.  An eswitch evaluates variables
locally at query time.  An lswitch sends the variables intact through to
the switch backend.

-- 
Tilghman

--
_
-- 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


Re: [asterisk-users] AEL - what is error: ael.flex:647 ael_yylex:Unhandled char(s):

2010-08-25 Thread Danny Nicholas
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Zeeshan
Zakaria
Sent: Wednesday, August 25, 2010 10:24 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] AEL - what is error: ael.flex:647
ael_yylex:Unhandled char(s):

 

Hi List,

 

When doing 'ael reload' on two servers, which are setup with asterisk
1.4.22 and 1.4.35 respectively, I am getting multiple lines of this strange
error:

 

ERROR[15483]: ael.flex:647 ael_yylex: Unhandled char(s):

 

On three other servers with same versions of asterisk, i.e. 1.4.22, I don't
see this error.

 

Number of lines of the error are the same as the number of lines of the
code. But the AEL code works fine otherwise.

 

Any idea what is the reason of this error? I couldn't find any useful info
on google regarding this error.

Zeeshan A Zakaria

 

According to this

https://issues.asterisk.org/view.php?id=14022

 

1.4.X doesn't have all of the 8-bit handling it should have (something in
your ael script is freaking out UTF-8)

-- 
_
-- 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

Re: [asterisk-users] AEL - what is error: ael.flex:647 ael_yylex:Unhandled char(s):

2010-08-25 Thread Zeeshan Zakaria
That's what I understood too from this one and probably only related google
search result, but even if I have just 3-4 lines of code, the error is still
there. It is all English characters, so UTF-8 compatibility issue should not
be there. I am sure there is some small little config change is required
somewhere related to AEL, but where, I don't know.

Zeeshan A Zakaria

--
www.ilovetovoip.com

On 2010-08-25 11:37 AM, Danny Nicholas da...@debsinc.com wrote:

  *From:* asterisk-users-boun...@lists.digium.com [mailto:
asterisk-users-boun...@lists.digium.com] *On Behalf Of *Zeeshan Zakaria
*Sent:* Wednesday, August 25, 2010 10:24 AM
*To:* Asterisk Users Mailing List - Non-Commercial Discussion
*Subject:* [asterisk-users] AEL - what is error: ael.flex:647
ael_yylex:Unhandled char(s):





Hi List,



When doing 'ael reload' on two servers, which are setup with asterisk
1.4.22 and...



Any idea what is the reason of this error? I couldn't find any useful info
on google regarding th...

According to this

https://issues.asterisk.org/view.php?id=14022



1.4.X doesn’t have all of the 8-bit handling it should have (something in
your ael script is freaking out UTF-8)

--
_
-- 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
-- 
_
-- 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

Re: [asterisk-users] AEL - what is error: ael.flex:647 ael_yylex:Unhandled char(s):

2010-08-25 Thread Watkins, Bradley
 



From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Zeeshan
Zakaria
Sent: Wednesday, August 25, 2010 11:43 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] AEL - what is error: ael.flex:647
ael_yylex:Unhandled char(s):



That's what I understood too from this one and probably only related
google search result, but even if I have just 3-4 lines of code, the
error is still there. It is all English characters, so UTF-8
compatibility issue should not be there. I am sure there is some small
little config change is required somewhere related to AEL, but where, I
don't know.


Zeeshan A Zakaria

 

Is there any chance that these files were edited on a Windows machine
and then copied back to the Asterisk boxes?  That is, are there some
nefarious ^m characters hiding in there?

 

Regards,

- Brad

-- 
_
-- 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

Re: [asterisk-users] AEL - what is error: ael.flex:647 ael_yylex:Unhandled char(s):

2010-08-25 Thread Zeeshan Zakaria
Actually I have found the problem, and leanred some new stuff along with it.

Apparently all Linux files have a mime type information stored in them,
which can be checked using command:

file -i filename

For my extensions.ael, which I copied from a different server, the mime type
is 'text/x-c' whereas all the other files have mime type 'text/plain'. Now
if I create a new file extemsions.maelstrom on this machine which is by
default 'text/plain', there are no errors on doing 'ael reload', however
using extensions.maelstrom with mime type 'text/x-c' gives errors, though
the code works fine.

How it got mime type 'text/x-c' on the other machine, Vim which I use there
assigned it this mime type. I'll have to fix it there.

Now I am trying to figure out how to convert between mime types. A simpler
solution is to just copy text to a new file, but would be nice to do a
proper conversion.

Zeeshan A Zakaria

--
www.ilovetovoip.com

On 2010-08-25 12:01 PM, Watkins, Bradley bradley.watk...@compuware.com
wrote:



 --


From: asterisk-users-boun...@lists.digium.com [mailto:
asterisk-users-boun...@lists.digium.com] On B...
*Sent:* Wednesday, August 25, 2010 11:43 AM


To: Asterisk Users Mailing List - Non-Commercial Discussion
*Subject:* Re: [asterisk-users] AEL - what is error: ael.flex:647
ael_yylex:Unhandled char(s):

That's what I understood too from this one and probably only related google
search result, but even ...

Is there any chance that these files were edited on a Windows machine and
then copied back to the Asterisk boxes?  That is, are there some nefarious
^m characters hiding in there?



Regards,

- Brad


--
_
-- 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
-- 
_
-- 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

Re: [asterisk-users] AEL - what is error: ael.flex:647 ael_yylex:Unhandled char(s):

2010-08-25 Thread Rodrigo Lang
Use the command aptitude install tofrodos to install dos2unix. This
command get the file and clear the ^M.


Regards,
Rodrigo Lang.

2010/8/25 Zeeshan Zakaria zisha...@gmail.com

 Actually I have found the problem, and leanred some new stuff along with
 it.

 Apparently all Linux files have a mime type information stored in them,
 which can be checked using command:

 file -i filename

 For my extensions.ael, which I copied from a different server, the mime
 type is 'text/x-c' whereas all the other files have mime type 'text/plain'.
 Now if I create a new file extemsions.maelstrom on this machine which is by
 default 'text/plain', there are no errors on doing 'ael reload', however
 using extensions.maelstrom with mime type 'text/x-c' gives errors, though
 the code works fine.

 How it got mime type 'text/x-c' on the other machine, Vim which I use there
 assigned it this mime type. I'll have to fix it there.

 Now I am trying to figure out how to convert between mime types. A simpler
 solution is to just copy text to a new file, but would be nice to do a
 proper conversion.

 Zeeshan A Zakaria

 --
 www.ilovetovoip.com

 On 2010-08-25 12:01 PM, Watkins, Bradley bradley.watk...@compuware.com
 wrote:



  --


 From: asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] On B...
 *Sent:* Wednesday, August 25, 2010 11:43 AM


 To: Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* Re: [asterisk-users] AEL - what is error: ael.flex:647
 ael_yylex:Unhandled char(s):

 That's what I understood too from this one and probably only related google
 search result, but even ...

 Is there any chance that these files were edited on a Windows machine and
 then copied back to the Asterisk boxes?  That is, are there some nefarious
 ^m characters hiding in there?



 Regards,

 - Brad


 --
 _
 -- 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


 --
 _
 -- 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




-- 
Rodrigo Lang
http://rodrigorecipes.blogspot.com/http://rodrigorecipes.blogspot.com/2010/08/ssh-rapido-e-pratico.html
-- 
_
-- 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

Re: [asterisk-users] AEL - what is error: ael.flex:647 ael_yylex:Unhandled char(s):

2010-08-25 Thread Zeeshan Zakaria
It did the trick. Thanks a lot for solving this annoying problem. Yes, it
was invisible ^M characters, which I could see in Vim, but not in vi. Now
'ael reload' ouput is how it should be.

Zeeshan A Zakaria

--
www.ilovetovoip.com

On 2010-08-25 1:29 PM, Rodrigo Lang rodrigoferreiral...@gmail.com wrote:

Use the command aptitude install tofrodos to install dos2unix. This
command get the file and clear the ^M.


Regards,
Rodrigo Lang.

2010/8/25 Zeeshan Zakaria zisha...@gmail.com



 Actually I have found the problem, and leanred some new stuff along with
it.

 Apparently all...



-- 
Rodrigo Lang
http://rodrigorecipes.blogspot.com/http://rodrigorecipes.blogspot.com/2010/08/ssh-rapido-e-pratico.html


--
_
-- 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
-- 
_
-- 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

Re: [asterisk-users] AEL - what is error: ael.flex:647 ael_yylex:Unhandled char(s):

2010-08-25 Thread Steve Edwards
On Wed, 25 Aug 2010, Zeeshan Zakaria wrote:

 Apparently all Linux files have a mime type information stored in them, 
 which can be checked using command:
 
 file -i filename

Linux files are just a byte stream. They do not have mime type 
information stored in them.

file works by examining the first x bytes of the file and comparing this 
to a magic file of rules to guess file types.

For instance, a JPEG file starts with 0xff 0xd8 0xff 0xe1.

The -i or --mime command line option causes file to display a mime 
type instead of a more traditional human readable one.

The hexdump command will show you the binary contents of a file in a 
variety for formats:

# Create a file with 2 lines
$ printf line 1\nline 2\n foo

# Dump the file. Note that 0a (newline, aka line-feed) is the line 
# ending character.
$ hexdump -C foo
  6c 69 6e 65 20 31 0a 6c  69 6e 65 20 32 0a|line 1.line 2.|

# file says it is just ASCII text, like all text files on Unix should be.
$ file foo
foo: ASCII text

# Convert the file to DOS line endings
$ unix2dos foo
unix2dos: converting file foo to DOS format ...

# Dump the file. Note that the line ending characters are now 0d 
# (carriage return) and 0a (newline).
$ hexdump -C foo
  6c 69 6e 65 20 31 0d 0a  6c 69 6e 65 20 32 0d 0a  |line 1..line 2..|

# file says it has funky line endings.
$ file foo
foo: ASCII text, with CRLF line terminators

CRLF = Carriage Return, Line Feed -- think of a typewriter. Watch the 
History Channel for more info.

-- 
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

-- 
_
-- 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


Re: [asterisk-users] AEL - what is error: ael.flex:647 ael_yylex:Unhandled char(s):

2010-08-25 Thread Zeeshan Zakaria
Thanks Steve for clearing this confusion.

Zeeshan A Zakaria

--
www.ilovetovoip.com

On 2010-08-25 3:16 PM, Steve Edwards asterisk@sedwards.com wrote:

On Wed, 25 Aug 2010, Zeeshan Zakaria wrote:

 Apparently all Linux files have a mime type informati...
Linux files are just a byte stream. They do not have mime type
information stored in them.

file works by examining the first x bytes of the file and comparing this
to a magic file of rules to guess file types.

For instance, a JPEG file starts with 0xff 0xd8 0xff 0xe1.

The -i or --mime command line option causes file to display a mime
type instead of a more traditional human readable one.

The hexdump command will show you the binary contents of a file in a
variety for formats:

# Create a file with 2 lines
$ printf line 1\nline 2\n foo

# Dump the file. Note that 0a (newline, aka line-feed) is the line
# ending character.
$ hexdump -C foo
  6c 69 6e 65 20 31 0a 6c  69 6e 65 20 32 0a|line 1.line 2.|

# file says it is just ASCII text, like all text files on Unix should be.
$ file foo
foo: ASCII text

# Convert the file to DOS line endings
$ unix2dos foo
unix2dos: converting file foo to DOS format ...

# Dump the file. Note that the line ending characters are now 0d
# (carriage return) and 0a (newline).
$ hexdump -C foo
  6c 69 6e 65 20 31 0d 0a  6c 69 6e 65 20 32 0d 0a  |line 1..line
2..|

# file says it has funky line endings.
$ file foo
foo: ASCII text, with CRLF line terminators

CRLF = Carriage Return, Line Feed -- think of a typewriter. Watch the
History Channel for more info.

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

--

_
-- Bandwidth and Colocation Pr...
-- 
_
-- 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

Re: [asterisk-users] AEL in 1.6 and Gosub

2010-03-17 Thread Klaus Darilion


Am 17.03.2010 00:40, schrieb Steve Murphy:



 How about:


 blacklist(${exten});


 macro blacklist(the_exten)
 {
  switch(the_exten)
  {
  pattern +4390[01]: Hangup();
  default: return;
  }
 }

Yes, that would work. I didn't knew the pattern statement.

 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.

I think I will just ignore it :-)

thanks
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


Re: [asterisk-users] AEL in 1.6 and Gosub

2010-03-17 Thread Elliot Murdock
Hello Klaus,

Just for your quick reference, here are some other changes in the AEL
from versions 1.4 to 1.6 (source:
http://asteriskuptospeed.linuxinnovations.com/core1.4-1.6.2.html and
CHANGES file) :

Macros are now implemented underneath with the Gosub() application.
Heaven Help You if you wrote code depending on any aspect of this!
Previous to 1.6, macros were implemented with the Macro() app, which
provided a nice feature of auto-returning. The compiler will do its
best to insert a Return() app call at the end of your macro if you did
not include it, but really, you should make sure that all execution
paths within your macros end in return;.

The conf2ael program is 'introduced' in this release; it is in a
rather crude state, but deemed useful for making a first pass at
converting extensions.conf code into AEL. More intelligence will come
with time.

AEL upgraded to use the Gosub with Arguments instead of Macro
application, to hopefully reduce the problems seen with the
artificially low stack ceiling that Macro bumps into. Macros can only
call other Macros to a depth of 7. Tests run using gosub, show depths
limited only by virtual memory. A small test demonstrated recursive
call depths of 100,000 without problems. -- in addition to this, all
apps that allowed a macro to be called, as in Dial, queues, etc, are
now allowing a gosub call in similar fashion.

AEL now generates LOCAL(argname) declarations when it Set()'s the each
arg name to the value of ${ARG1}, ${ARG2), etc. That makes the
arguments local in scope. The user can define their own local
variables in macros, now, by saying local myvar=someval; or using
Set() in this fashion: Set(LOCAL(myvar)=someval); (local is now an
AEL keyword).
utils/conf2ael introduced. Will convert an extensions.conf file into
extensions.ael. Very crude and unfinished, but will be improved as
time goes by. Should be useful for a first pass at conversion.

aelparse will now read extensions.conf to see if a referenced macro or
context is there before issueing a warning.

AEL parser sets a local channel variable ~~EXTEN~~, to preserve the
value of ${EXTEN} thru switch statements.

New operator in $[...] expressions: the ~~ operator serves as a
concatenation operator. AT THE MOMENT, it is really only necessary and
useful in AEL, especially in if() expressions. Operation: ${a} ~~ ${b|
with force both a and b to strings, strip any enclosing double-quotes,
and evaluate to the value of a concatenated with the value of b. For
example if a is set to xyz and b has the value abc, then ${a} ~~
${b| would evaluate to xyzabc

Good luck with your upgrade!
Elliot

On Wed, Mar 17, 2010 at 12:48 PM, Klaus Darilion
klaus.mailingli...@pernau.at wrote:


 Am 17.03.2010 00:40, schrieb Steve Murphy:
 
 

  How about:
 
         
  blacklist(${exten});
         
 
  macro blacklist(the_exten)
  {
       switch(the_exten)
       {
       pattern +4390[01]: Hangup();
       default: return;
       }
  }

 Yes, that would work. I didn't knew the pattern statement.

  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.

 I think I will just ignore it :-)

 thanks
 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

-- 
_
-- 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


Re: [asterisk-users] AEL in 1.6 and Gosub

2010-03-16 Thread Steve Murphy
On Mon, Mar 15, 2010 at 12:47 PM, Klaus Darilion 
klaus.mailingli...@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
-- 
_
-- 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

Re: [asterisk-users] AEL in 1.6 and Gosub

2010-03-15 Thread 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;
 
 }

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.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kflem...@digium.com
Check us out at www.digium.com  www.asterisk.org

-- 
_
-- 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


Re: [asterisk-users] AEL in 1.6 and Gosub

2010-03-15 Thread Klaus Darilion


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;

 }

 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


Re: [asterisk-users] AEL, 1.6, CUT and commas [SOLVED]

2009-12-03 Thread Olivier
2009/12/3 Olivier oza-4...@myamail.com

 Hello,

 How can you parse a comma separated list using function CUT and AEL ?

 I've tried but it displays error message (though is seems to find the
 correct value) :

 STRING=101,102
 VAL=${CUT(STRING,\,,1)};
 NoOp(VAL is ${VAL});

 Cheers


Sorry for the noise but I mixed up with another mistake elsewhere in my
code.
The above example works !
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] AEL problem: bug or feature?

2009-10-05 Thread Klaus Darilion
forgot to mention this happens on Asterisk 1.4.26.1

Klaus Darilion schrieb:
 Hi! I have a problem with jump in AEL:
 
  _+43123456789!  =  jump +22;
  +22 = { NoOp(); }
 
 - OK
 
  _+43123456789!  =  jump 22;
  22 = { NoOp(); }
 
 - OK
 
  _+43123456789!  =  jump 22;
  _22 = { NoOp(); }
 
 - OK
 
  _+43123456789!  =  jump +22;
  _+22 = { NoOp(); }
 
 -- AEL compile error:
 LOG: lev:4 file:pbx_ael.c  line:1234 func: check_goto  Error: file 
 ./ofis/extensions.ael_trunking, line 525-525: goto:  no label +22|1 
 exists in the current context, or any of its inclusions!
 
 Is this is some special feature/limitation or just a bug?
 
 thanks
 Klaus
 
 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 AstriCon 2009 - October 13 - 15 Phoenix, Arizona
 Register Now: http://www.astricon.net
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL problem: bug or feature?

2009-10-05 Thread Steve Edwards
On Mon, 5 Oct 2009, Klaus Darilion wrote:

 forgot to mention this happens on Asterisk 1.4.26.1

 Klaus Darilion schrieb:
 Hi! I have a problem with jump in AEL:

  _+43123456789!  =  jump +22;
  +22 = { NoOp(); }

Don't you need another semi-colon after the closing brace?

Since AEL compiles to dialplan, what does the resulting dialplan look 
like?

-- 
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL problem: bug or feature?

2009-10-05 Thread Philipp Kempgen
Klaus Darilion schrieb:
 forgot to mention this happens on Asterisk 1.4.26.1
 
 Klaus Darilion schrieb:
 Hi! I have a problem with jump in AEL:
 
  _+43123456789!  =  jump +22;
  +22 = { NoOp(); }
 
 - OK
 
  _+43123456789!  =  jump 22;
  22 = { NoOp(); }
 
 - OK
 
  _+43123456789!  =  jump 22;
  _22 = { NoOp(); }
 
 - OK
 
  _+43123456789!  =  jump +22;
  _+22 = { NoOp(); }
 
 -- AEL compile error:
 LOG: lev:4 file:pbx_ael.c  line:1234 func: check_goto  Error: file 
 ./ofis/extensions.ael_trunking, line 525-525: goto:  no label +22|1 
 exists in the current context, or any of its inclusions!

Not that it should make a difference (as + is not a special
character in Asterisk's patterns) but did you try
 _+43123456789!  =  jump +22;
 _[+]22 = { NoOp(); }
just in case?

 Is this is some special feature/limitation or just a bug?

Looks like a bug to me.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
-- 

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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL problem: bug or feature?

2009-10-05 Thread Klaus Darilion


Steve Edwards schrieb:
 On Mon, 5 Oct 2009, Klaus Darilion wrote:
 
 forgot to mention this happens on Asterisk 1.4.26.1

 Klaus Darilion schrieb:
 Hi! I have a problem with jump in AEL:

  _+43123456789!  =  jump +22;
  +22 = { NoOp(); }
 
 Don't you need another semi-colon after the closing brace?

No. IIRC this was changed from AEL to AEL2.

 Since AEL compiles to dialplan, what does the resulting dialplan look 
 like?

it failes during compilation, thus there is no dialplan generated.

regards
klaus

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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL problem: bug or feature?

2009-10-05 Thread Klaus Darilion


Philipp Kempgen schrieb:
 Klaus Darilion schrieb:
 forgot to mention this happens on Asterisk 1.4.26.1

 Klaus Darilion schrieb:
 Hi! I have a problem with jump in AEL:

  _+43123456789!  =  jump +22;
  +22 = { NoOp(); }

 - OK

  _+43123456789!  =  jump 22;
  22 = { NoOp(); }

 - OK

  _+43123456789!  =  jump 22;
  _22 = { NoOp(); }

 - OK

  _+43123456789!  =  jump +22;
  _+22 = { NoOp(); }

 -- AEL compile error:
 LOG: lev:4 file:pbx_ael.c  line:1234 func: check_goto  Error: file 
 ./ofis/extensions.ael_trunking, line 525-525: goto:  no label +22|1 
 exists in the current context, or any of its inclusions!
 
 Not that it should make a difference (as + is not a special
 character in Asterisk's patterns) but did you try
  _+43123456789!  =  jump +22;
  _[+]22 = { NoOp(); }
 just in case?

Indeed, that works. Also jump +22${FOO}; works

 
 Is this is some special feature/limitation or just a bug?
 
 Looks like a bug to me.

Me too :-)
https://issues.asterisk.org/view.php?id=16019

regards
klaus

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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL question: testing channel variables

2009-01-11 Thread Allann Jones
http://www.voip-info.org/wiki-Asterisk+variables
http://www.voip-info.org/wiki-Asterisk+Dialplan+Globals

Beware with the variable scope, if its scope is local the values can
be lost, so declare the variable as global when its value must persist
between calls.

[globals]

   FOOBAR = NO

[some_context]

if (${FOOBAR}=YES) {
   ...
}


On Sat, Jan 10, 2009 at 2:53 PM, Philipp Kempgen
philipp.kemp...@amooma.de wrote:
 Klaus Darilion schrieb:
 I use the following condition:

 if (${FOOBAR}=YES) {
...
 }

 The problem is, that if FOOBAR is not defined at all Asterisk generates
 a warning:

 WARNING[11982]: ast_expr2.fl:407 ast_yyerror: ast_yyerror():  syntax
 error: syntax error, unexpected '=', expecting $end; Input:
 =YES


 Of course I could use the following code, but this bloats up the code:


 if (${EXISTS(${FOOBAR})}) {
if (${FOOBAR}=YES) {
  ...
}
 }


 Is there another syntax to have nice looking code but avoid the warning?

 if (${FOOBAR}=YES) {
   ...
 }

 or

 if (x${FOOBAR}=xYES) {
   ...
 }


   Philipp Kempgen

 --
 AMOOCON 2009, May 4-5, Rostock / Germany   -  http://www.amoocon.de
 Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
 AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
 Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
 --

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

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




-- 
___
Allann J. O. Silva

I received the fundamentals of my education in school, but that was
not enough. My real education, the superstructure, the details, the
true architecture, I got out of the public library. For an
impoverished child whose family could not afford to buy books, the
library was the open door to wonder and achievement, and I can never
be sufficiently grateful that I had the wit to charge through that
door and make the most of it. (from I. Asimov, 1994)

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

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


Re: [asterisk-users] AEL question: testing channel variables

2009-01-10 Thread Philipp Kempgen
Klaus Darilion schrieb:
 I use the following condition:
 
 if (${FOOBAR}=YES) {
...
 }
 
 The problem is, that if FOOBAR is not defined at all Asterisk generates 
 a warning:
 
 WARNING[11982]: ast_expr2.fl:407 ast_yyerror: ast_yyerror():  syntax 
 error: syntax error, unexpected '=', expecting $end; Input:
 =YES
 
 
 Of course I could use the following code, but this bloats up the code:
 
 
 if (${EXISTS(${FOOBAR})}) {
if (${FOOBAR}=YES) {
  ...
}
 }
 
 
 Is there another syntax to have nice looking code but avoid the warning?

if (${FOOBAR}=YES) {
   ...
}

or

if (x${FOOBAR}=xYES) {
   ...
}


   Philipp Kempgen

-- 
AMOOCON 2009, May 4-5, Rostock / Germany   -  http://www.amoocon.de
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
-- 

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

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


Re: [asterisk-users] AEL and };

2009-01-08 Thread Olivier
2009/1/8 Klaus Darilion klaus.mailingli...@pernau.at

 Hi!

 All the AEL examples have a semicolon after the closing curly bracket, e.g:

 context test {
   1 = Hangup();
 };

 but without ; it works fine too, e.g:


 context test {
   1 = Hangup();
 }


 So - what is the reason for the ; after the closing curly bracket?


for syntax edition (ie ael.vim 0.2), this question seems to matter.





 thanks
 klaus

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

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

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

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

Re: [asterisk-users] AEL and };

2009-01-08 Thread Watkins, Bradley
 

 -Original Message-
 From: asterisk-users-boun...@lists.digium.com 
 [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of 
 Klaus Darilion
 Sent: Thursday, January 08, 2009 8:28 AM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: [asterisk-users] AEL and };
 
 Hi!
 
 All the AEL examples have a semicolon after the closing curly 
 bracket, e.g:
 
 context test {
1 = Hangup();
 };
 
 but without ; it works fine too, e.g:
 
 
 context test {
1 = Hangup();
 }
 
 
 So - what is the reason for the ; after the closing curly bracket?
 

In the original implementation of AEL, it was required to have the
semicolon after closing a block.  In the new implementation (AEL2), it
is not required but is allowed for backward compatibility with dialplans
written for the earlier parser.

- Brad

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

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


Re: [asterisk-users] AEL and };

2009-01-08 Thread Klaus Darilion


Watkins, Bradley schrieb:
  
 
 -Original Message-
 From: asterisk-users-boun...@lists.digium.com 
 [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of 
 Klaus Darilion
 Sent: Thursday, January 08, 2009 8:28 AM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: [asterisk-users] AEL and };

 Hi!

 All the AEL examples have a semicolon after the closing curly 
 bracket, e.g:

 context test {
1 = Hangup();
 };

 but without ; it works fine too, e.g:


 context test {
1 = Hangup();
 }


 So - what is the reason for the ; after the closing curly bracket?

 
 In the original implementation of AEL, it was required to have the
 semicolon after closing a block.  In the new implementation (AEL2), it
 is not required but is allowed for backward compatibility with dialplans
 written for the earlier parser.

sounds logical

thanks
klaus

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

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


Re: [asterisk-users] AEL question: testing channel variables

2009-01-08 Thread Julian Lyndon-Smith
Klaus Darilion wrote:
 Hi!

 I use the following condition:

 if (${FOOBAR}=YES) {
...
 }

 The problem is, that if FOOBAR is not defined at all Asterisk generates 
 a warning:

 WARNING[11982]: ast_expr2.fl:407 ast_yyerror: ast_yyerror():  syntax 
 error: syntax error, unexpected '=', expecting $end; Input:
 =YES


 Of course I could use the following code, but this bloats up the code:


 if (${EXISTS(${FOOBAR})}) {
if (${FOOBAR}=YES) {
  ...
}
 }


 Is there another syntax to have nice looking code but avoid the warning?
   

How about

if (${FOOBAR}=YES) {

Julian
 thanks
 klaus

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

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

   


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

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

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


Re: [asterisk-users] AEL question: testing channel variables

2009-01-08 Thread Steve Murphy
On Thu, 2009-01-08 at 19:24 +0100, Klaus Darilion wrote:
 Hi!
 
 I use the following condition:
 
 if (${FOOBAR}=YES) {
...
 }
 
 The problem is, that if FOOBAR is not defined at all Asterisk generates 
 a warning:
 
 WARNING[11982]: ast_expr2.fl:407 ast_yyerror: ast_yyerror():  syntax 
 error: syntax error, unexpected '=', expecting $end; Input:
 =YES
 
 
 Of course I could use the following code, but this bloats up the code:
 
 
 if (${EXISTS(${FOOBAR})}) {
if (${FOOBAR}=YES) {
  ...
}
 }
 
 
 Is there another syntax to have nice looking code but avoid the warning?

Klaus--

The simplest I can think of is:

if (${FOOBAR}=YES) {
   ...
}

adding the quotes just makes it so if ${FOOBAR} evaluates to nothing,
then it will still end being a token, and you avoid the syntax error.

You have to keep in mind that by the time the $[ ... ] exprs are evaluated,
all ${..} constructs have been recursively evaluated away.

the wiki is a good reference for AEL2... 
(http://voip-info.org/wiki/view/Asterisk+AEL2
and there is a page of example snippets.

murf


 
 thanks
 klaus

-- 
Steve Murphy m...@digium.com
Digium


smime.p7s
Description: S/MIME cryptographic signature
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] AEL question: testing channel variables

2009-01-08 Thread Brent Vrieze
Initialize FOOBAR to some know value (ie NO) and change it when you need 
to.  Then it will always be defined.

Klaus Darilion wrote:
 Hi!

 I use the following condition:

 if (${FOOBAR}=YES) {
...
 }

 The problem is, that if FOOBAR is not defined at all Asterisk generates 
 a warning:

 WARNING[11982]: ast_expr2.fl:407 ast_yyerror: ast_yyerror():  syntax 
 error: syntax error, unexpected '=', expecting $end; Input:
 =YES


 Of course I could use the following code, but this bloats up the code:


 if (${EXISTS(${FOOBAR})}) {
if (${FOOBAR}=YES) {
  ...
}
 }


 Is there another syntax to have nice looking code but avoid the warning?

 thanks
 klaus

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

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


   

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

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


Re: [asterisk-users] AEL Variable Warning Messages

2009-01-05 Thread Brent Davidson

Watkins, Bradley wrote:



From: asterisk-users-boun...@lists.digium.com


[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Brent
Davidson
  

Sent: Wednesday, December 31, 2008 1:03 PM
To: m...@digium.com; Asterisk Users Mailing List -


Non-Commercial Discussion
  

Subject: Re: [asterisk-users] AEL Variable Warning Messages

Well, before I file a bug I have another question...  In AEL,


what is the correct syntax?  Do all variable references still need to be
wrapped in ${} or not?  If they do, then the documentation on
voip-info.org needs to be changed to reflect that.

Yes, variable references need to be wrapped in ${}.  Where on the wiki
do you see an example that is otherwise?  I just looked at the main
documentation for AEL, and I didn't see any instances of it.  Certainly
they can and should be fixed if they are there.
  


Beyond that, what are the rules for putting the values assigned


to variables in quotes?  In my example above, at one point I had a space
between the = and the Zap/r2 statement with no quotes.  The value
assigned to TRUNK then included a leading space.  I didn't test to see
whether or not putting a space after the variable name adds a space to
the variables name.  I would think that any spaces after an operator
should be ignored unless the come after a single or double quote.

The rules are that there aren't any really.  Neither a single- nor
double-quote have any specific meaning in the sense of signifying a
string.  I'm also curious to know where you saw an example of assignment
that used quotes of any kind, since I can't find that either.

Regards,
- Brad
  
Both the AEL and AEL2 examples include the following examples in the 
Variables section:


---HTML Copied from WIKI page 
http://www.voip-info.org/wiki/view/Asterisk+AEL---



   Variables

Variables in Asterisk do not have a type, so to define a variable, it 
just has to be specified with a value.


Global variables are set in their own block.

globals {
   CONSOLE=Console/dsp;
   TRUNK=Zap/g2;
};

*NOTE:* The opening curly-brace must appear as above. Moving it to the 
following line may have disastrous consequences!


Variables can be set within extensions as well.


context foo {
   555 = {
x=5;
y=blah;
divexample=10/2
NoOp(x is ${x} and y is ${y} !);
   };
};


*NOTE:* Asterisk beta1 parses assignments using a $[] wrapper as opposed 
to the more logical way of doing it like Set and SetVar work. In this 
example, I had ${ARG1} set to SIP/x7065558529 sans-quotes and it 
flunked out.
*NOTE:* Another opinion: The $[ ] allow expressions to be used, and add 
extra power to the language. Read the README.variables about the 
requirements of $ http://www.voip-info.org/wiki/view/Asterisk+AEL 
expressions. In the following example, the SIP/x7065558529
 should not be sans quotes. So, the statement might have been entered:  requesting_channel=${ARG1};( where the 's prevent the evaluation. ) 

*NOTE:* These things are wrapped up in a $[ ] expression: The while() 
test; the if() test; the middle expression in the for( x; y; z) 
statement (the y expression); Assignments --- the right hand side, so a 
= b - Set(a=$[b])


requesting_channel=${ARG1}
ERROR: Oct 10 12:48:59 WARNING[19726]: ast_expr2.y:811 op_div: 
non-numeric argument
  --- Executing Set(SIP/x7065558529-2afd, requesting_channel=0) in new stack 


FROM show dialplan:
's' =1. Set(requesting_channel=$[ ${ARG1} ])   [pbx_ael]

But you can use Set and it works the old way.

Set(requesting_channel=${ARG1})


Writing to a dialplan function is treated the same as writing to a 
variable.



context blah {
   s = {
CALLERID(name)=ChickenMan;
NoOp(My name is ${CALLERID(name)} !);
   };
}; 


---END HTML Copied from WIKI---

I see the line about using the old Set syntax, but the examples and the 
rest of the notes imply that that you could just do x=5; rather than 
${x}=5; and get the same result either way.


Another question along these lines...  If I set a Global called TRUNK 
in the globals section and later assign do a TRUNK=whatever it appears 
that a local variable called TRUNK is created instead of using the 
global.  You must explicitly use the Set(GLOBAL(TRUNK)=whatever) syntax 
to alter the global.


As far as the quotes go, I resorted to using them in an effort to get 
rid of that extra space at the beginning of my value.  I just figured 
that if the examples were wrong on one aspect that maybe they were off 
in other ways as well.


The examples in the Macros and Conditionals sections of AEL shows 
the variables with the curly brace syntax, but the loops section uses 
both syntaxes in it's examples.


I would be happy to help clean up the examples on the wiki as long as 
I'm sure I know what I'm doing.  As for my dialplan, I've reverted to 
using the Set

Re: [asterisk-users] AEL Variable Warning Messages

2009-01-05 Thread Benoit
Brent Davidson a écrit :
 Watkins, Bradley wrote:
 ...
 Well, before I file a bug I have another question...  In AEL,
 
 what is the correct syntax?  Do all variable references still need to be
 wrapped in ${} or not?  If they do, then the documentation on
 voip-info.org needs to be changed to reflect that.

 Yes, variable references need to be wrapped in ${}.  Where on the wiki
 do you see an example that is otherwise?  I just looked at the main
 documentation for AEL, and I didn't see any instances of it.  Certainly
 they can and should be fixed if they are there.
 ..

 I see the line about using the old Set syntax, but the examples and
 the rest of the notes imply that that you could just do x=5; rather
 than ${x}=5; and get the same result either way.
Well, the process of declaring/assigning a value to a variable isn't the
same a refering a variable.
And the wiki example are correct, you can assign a value with x=0;,
but to display this value
(by referring to the variable) you have to do NoOp(${x});.


 Another question along these lines...  If I set a Global called
 TRUNK in the globals section and later assign do a TRUNK=whatever it
 appears that a local variable called TRUNK is created instead of using
 the global.  You must explicitly use the Set(GLOBAL(TRUNK)=whatever)
 syntax to alter the global.
And the question is ?



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

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


Re: [asterisk-users] AEL Variable Warning Messages

2009-01-05 Thread Brent Davidson

Benoit wrote:

Brent Davidson a écrit :
  

Another question along these lines...  If I set a Global called
TRUNK in the globals section and later assign do a TRUNK=whatever it
appears that a local variable called TRUNK is created instead of using
the global.  You must explicitly use the Set(GLOBAL(TRUNK)=whatever)
syntax to alter the global.


And the question is ?
I guess my question was whether or not the above is the intended 
behavior.  It seems to me that if you declare a global, then later use 
the same name it should refer to the global without having to use the 
old syntax.
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] AEL Variable Warning Messages

2008-12-31 Thread Brent Davidson

Steve Murphy wrote:

On Tue, 2008-12-23 at 12:14 -0600, Brent Davidson wrote:
  
I have two offices sharing a phone system.  They also share a common 
internal context because all of the employees of the second office also 
work for the first office.  Each office has 4 outside lines and I have 
defined 2 channel groups in my zapata.conf.  The second office needs all 
of their outgoing calls to go out over their lines so the people they 
call will have the correct callerID.  I created an asterisk database and 
with entries in the database for all extensions in the second office and 
defined the following macro:


globals {
  CONSOLE=Console/dsp;
  TRUNK=Zap/r1;
  TCTC_Operator=15;
  Law_Operator=12;
};

macro outside-dial ( num ) {
  if (${DB_EXISTS(Office/${CALLERID(num)})}) {
TRUNK=Zap/r2;
  } else {
TRUNK=Zap/r1;
  }
  Dial(${TRUNK}/${num},,Ttok);
}

It's working and correctly routing outside calls, but I get the 
following messages when I reload the extensions.ael file:


[Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: 
Warning: file /etc/asterisk/extensions.ael, line 93-93: expression 
Zap/r2 has operators, but no variables. Interesting...
[Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: 
Warning: file /etc/asterisk/extensions.ael, line 95-95: expression 
Zap/r1 has operators, but no variables. Interesting...


Any idea what is causing the warnings?



Yes, I do! I was concerned that users were falling into a common
error, where they forget to wrap variable references in $(); so,
if it looks like an expr has arithmetic operators, but no variable
refs, then you get this message.

Yes, I *could* have made it more intelligent. File a bug, and I'll
see if I can do so. At the worst, you can ignore this warning, or
I can simply remove this overly-simple warning.

murf
  
Well, before I file a bug I have another question...  In AEL, what is 
the correct syntax?  Do all variable references still need to be wrapped 
in ${} or not?  If they do, then the documentation on voip-info.org 
needs to be changed to reflect that.


Beyond that, what are the rules for putting the values assigned to 
variables in quotes?  In my example above, at one point I had a space 
between the = and the Zap/r2 statement with no quotes.  The value 
assigned to TRUNK then included a leading space.  I didn't test to see 
whether or not putting a space after the variable name adds a space to 
the variables name.  I would think that any spaces after an operator 
should be ignored unless the come after a single or double quote.


Thanks,
Brent
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] AEL Variable Warning Messages

2008-12-31 Thread Watkins, Bradley


   From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Brent
Davidson
   Sent: Wednesday, December 31, 2008 1:03 PM
   To: m...@digium.com; Asterisk Users Mailing List -
Non-Commercial Discussion
   Subject: Re: [asterisk-users] AEL Variable Warning Messages

   Well, before I file a bug I have another question...  In AEL,
what is the correct syntax?  Do all variable references still need to be
wrapped in ${} or not?  If they do, then the documentation on
voip-info.org needs to be changed to reflect that.

Yes, variable references need to be wrapped in ${}.  Where on the wiki
do you see an example that is otherwise?  I just looked at the main
documentation for AEL, and I didn't see any instances of it.  Certainly
they can and should be fixed if they are there.
   
   Beyond that, what are the rules for putting the values assigned
to variables in quotes?  In my example above, at one point I had a space
between the = and the Zap/r2 statement with no quotes.  The value
assigned to TRUNK then included a leading space.  I didn't test to see
whether or not putting a space after the variable name adds a space to
the variables name.  I would think that any spaces after an operator
should be ignored unless the come after a single or double quote.

The rules are that there aren't any really.  Neither a single- nor
double-quote have any specific meaning in the sense of signifying a
string.  I'm also curious to know where you saw an example of assignment
that used quotes of any kind, since I can't find that either.

Regards,
- Brad




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

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


Re: [asterisk-users] AEL Variable Warning Messages

2008-12-29 Thread Steve Murphy
On Tue, 2008-12-23 at 12:14 -0600, Brent Davidson wrote:
 I have two offices sharing a phone system.  They also share a common 
 internal context because all of the employees of the second office also 
 work for the first office.  Each office has 4 outside lines and I have 
 defined 2 channel groups in my zapata.conf.  The second office needs all 
 of their outgoing calls to go out over their lines so the people they 
 call will have the correct callerID.  I created an asterisk database and 
 with entries in the database for all extensions in the second office and 
 defined the following macro:
 
 globals {
   CONSOLE=Console/dsp;
   TRUNK=Zap/r1;
   TCTC_Operator=15;
   Law_Operator=12;
 };
 
 macro outside-dial ( num ) {
   if (${DB_EXISTS(Office/${CALLERID(num)})}) {
 TRUNK=Zap/r2;
   } else {
 TRUNK=Zap/r1;
   }
   Dial(${TRUNK}/${num},,Ttok);
 }
 
 It's working and correctly routing outside calls, but I get the 
 following messages when I reload the extensions.ael file:
 
 [Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: 
 Warning: file /etc/asterisk/extensions.ael, line 93-93: expression 
 Zap/r2 has operators, but no variables. Interesting...
 [Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: 
 Warning: file /etc/asterisk/extensions.ael, line 95-95: expression 
 Zap/r1 has operators, but no variables. Interesting...
 
 Any idea what is causing the warnings?

Yes, I do! I was concerned that users were falling into a common
error, where they forget to wrap variable references in $(); so,
if it looks like an expr has arithmetic operators, but no variable
refs, then you get this message.

Yes, I *could* have made it more intelligent. File a bug, and I'll
see if I can do so. At the worst, you can ignore this warning, or
I can simply remove this overly-simple warning.

murf


 
 Thanks,
 Brent

-- 
 Steve Murphy
Digium, Inc. | Software Developer
57 Lane 17, Cody, WY 82414 USA
direct: +1 256-428-6002
mobile: +1 307-899-5535
fax/home: +1 307-754-5675
irc: codefreeze | jabber: m...@digium.com
Check us out at: www.digium.com  www.asterisk.org



smime.p7s
Description: S/MIME cryptographic signature
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] AEL: how to check if variable is defined

2008-12-29 Thread Philipp Kempgen
Klaus Darilion schrieb:
 I use an if condition in extensions.ael to check if a channel variable 
 is defined and if defined I add a certain header:
 
 context toNormaleRufe {
_X. = {
 if (${NUMBER}) {
 SIPAddHeader(X-NUMBER: ${NUMBER});
 };
 ...
};
 
 This works fine, except NUMBER starts with the + sign.
 
 I tried using quotes but
 if (${NUMBER})
 evaluates always true.
 
 What is the suggested way to solve this?

if (${NUMBER} != ) {
// ...
}

That doesn't tell you whether the variable is defined but in
most cases (if any) that doesn't matter anyway.

   Philipp Kempgen

-- 
http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
Amooma GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
-- 

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

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


Re: [asterisk-users] AEL: how to check if variable is defined

2008-12-29 Thread Philipp Kempgen
Philipp Kempgen schrieb:
 Klaus Darilion schrieb:
 I use an if condition in extensions.ael to check if a channel variable 
 is defined and if defined I add a certain header:
 
 context toNormaleRufe {
_X. = {
 if (${NUMBER}) {
 SIPAddHeader(X-NUMBER: ${NUMBER});
 };
 ...
};
 
 This works fine, except NUMBER starts with the + sign.
 
 I tried using quotes but
 if (${NUMBER})
 evaluates always true.
 
 What is the suggested way to solve this?
 
 if (${NUMBER} != ) {
 // ...
 }
 
 That doesn't tell you whether the variable is defined but in
 most cases (if any) that doesn't matter anyway.

But I guess it wouldn't hurt to add a DEFINED() function to
Asterisk.

if (DEFINED(myvariable)) {
// ...
}


   Philipp Kempgen

-- 
http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
Amooma GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
-- 

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

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


Re: [asterisk-users] AEL: how to check if variable is defined

2008-12-29 Thread Richard Lyman
Philipp Kempgen wrote:
*snipped
 But I guess it wouldn't hurt to add a DEFINED() function to
 Asterisk.

 if (DEFINED(myvariable)) {
 // ...
 }
   
Isn't that what ISNULL is for?

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

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


Re: [asterisk-users] AEL: how to check if variable is defined

2008-12-29 Thread Dave Fullerton
Philipp Kempgen wrote:
 Philipp Kempgen schrieb:
 Klaus Darilion schrieb:
 I use an if condition in extensions.ael to check if a channel variable 
 is defined and if defined I add a certain header:

 context toNormaleRufe {
_X. = {
 if (${NUMBER}) {
 SIPAddHeader(X-NUMBER: ${NUMBER});
 };
 ...
};

 This works fine, except NUMBER starts with the + sign.

 I tried using quotes but
 if (${NUMBER})
 evaluates always true.

 What is the suggested way to solve this?
 if (${NUMBER} != ) {
 // ...
 }

 That doesn't tell you whether the variable is defined but in
 most cases (if any) that doesn't matter anyway.
 
 But I guess it wouldn't hurt to add a DEFINED() function to
 Asterisk.
 
 if (DEFINED(myvariable)) {
 // ...
 }
 

Isn't that what EXISTS() is for?

-Dave

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

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


Re: [asterisk-users] AEL: how to check if variable is defined

2008-12-29 Thread Philipp Kempgen
Dave Fullerton schrieb:
 Philipp Kempgen wrote:

 But I guess it wouldn't hurt to add a DEFINED() function to
 Asterisk.
 
 if (DEFINED(myvariable)) {
 // ...
 }
 
 
 Isn't that what EXISTS() is for?

Well, yes.  :-)
I've never needed it before and it didn't come to my mind.


   Philipp Kempgen

-- 
http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
Amooma GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
-- 

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

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


Re: [asterisk-users] AEL: how to check if variable is defined

2008-12-29 Thread Philipp Kempgen
Richard Lyman schrieb:
 Philipp Kempgen wrote:

 But I guess it wouldn't hurt to add a DEFINED() function to
 Asterisk.

 if (DEFINED(myvariable)) {
 // ...
 }
   
 Isn't that what ISNULL is for?

No. ISNULL() works on values not on variables.

But Dave Fullerton found EXISTS():
http://lists.digium.com/pipermail/asterisk-users/2008-December/224059.html


   Philipp Kempgen

-- 
http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
Amooma GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
-- 

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

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


Re: [asterisk-users] AEL: how to check if variable is defined

2008-12-29 Thread Richard Lyman
Philipp Kempgen wrote:
 Richard Lyman schrieb:
   
 Philipp Kempgen wrote:
 

   
 But I guess it wouldn't hurt to add a DEFINED() function to
 Asterisk.

 if (DEFINED(myvariable)) {
 // ...
 }
   
   
 Isn't that what ISNULL is for?
 

 No. ISNULL() works on values not on variables.

 But Dave Fullerton found EXISTS():
 http://lists.digium.com/pipermail/asterisk-users/2008-December/224059.html


Philipp Kempgen

   
if (${ISNULL(${CAMPAIGN})}) {
Set(CAMPAIGN=INBOUND);
};

This is how i use it.


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

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


Re: [asterisk-users] AEL: how to check if variable is defined

2008-12-29 Thread Klaus Darilion
Thanks Dave, Philipp and Richard!

klaus

Richard Lyman wrote:
 Philipp Kempgen wrote:
 Richard Lyman schrieb:
   
 Philipp Kempgen wrote:
 
   
 But I guess it wouldn't hurt to add a DEFINED() function to
 Asterisk.

 if (DEFINED(myvariable)) {
 // ...
 }
   
   
 Isn't that what ISNULL is for?
 
 No. ISNULL() works on values not on variables.

 But Dave Fullerton found EXISTS():
 http://lists.digium.com/pipermail/asterisk-users/2008-December/224059.html


Philipp Kempgen

   
 if (${ISNULL(${CAMPAIGN})}) {
 Set(CAMPAIGN=INBOUND);
 };
 
 This is how i use it.
 
 
 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

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

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


Re: [asterisk-users] AEL Variable Warning Messages

2008-12-23 Thread Philipp Kempgen
Brent Davidson schrieb:

 macro outside-dial ( num ) {
   if (${DB_EXISTS(Office/${CALLERID(num)})}) {
 TRUNK=Zap/r2;
   } else {
 TRUNK=Zap/r1;
   }
   Dial(${TRUNK}/${num},,Ttok);
 }

 [Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: 
 Warning: file /etc/asterisk/extensions.ael, line 93-93: expression 
 Zap/r2 has operators, but no variables. Interesting...
 [Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: 
 Warning: file /etc/asterisk/extensions.ael, line 95-95: expression 
 Zap/r1 has operators, but no variables. Interesting...

I'd suggest
Set(TRUNK=Zap/r2);
resp.
Set(TRUNK=Zap/r1);


   Philipp Kempgen

-- 
http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
Amooma GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
-- 

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

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


Re: [asterisk-users] AEL Variable Warning Messages

2008-12-23 Thread Brent Davidson

Philipp Kempgen wrote:

Brent Davidson schrieb:

  

macro outside-dial ( num ) {
  if (${DB_EXISTS(Office/${CALLERID(num)})}) {
TRUNK=Zap/r2;
  } else {
TRUNK=Zap/r1;
  }
  Dial(${TRUNK}/${num},,Ttok);
}



  
[Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: 
Warning: file /etc/asterisk/extensions.ael, line 93-93: expression 
Zap/r2 has operators, but no variables. Interesting...
[Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: 
Warning: file /etc/asterisk/extensions.ael, line 95-95: expression 
Zap/r1 has operators, but no variables. Interesting...



I'd suggest
Set(TRUNK=Zap/r2);
resp.
Set(TRUNK=Zap/r1);


   Philipp Kempgen

  


According to the AEL Documentation I should be able to set variables 
without using the Set command.  They even give the following example:


context foo {
   555 = {
x=5;
y=blah;
divexample=10/2
NoOp(x is ${x} and y is ${y} !);
   };
};

I wonder if maybe AEL is ignoring the double quotes and treating the 
Zap/r2 as if it were division???  Should I file a bug report on this?



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

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

Re: [asterisk-users] AEL Variable Warning Messages

2008-12-23 Thread Dave Fullerton
Brent Davidson wrote:
 Philipp Kempgen wrote:
 Brent Davidson schrieb:

  
 macro outside-dial ( num ) {
   if (${DB_EXISTS(Office/${CALLERID(num)})}) {
 TRUNK=Zap/r2;
   } else {
 TRUNK=Zap/r1;
   }
   Dial(${TRUNK}/${num},,Ttok);
 }
 

  
 [Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: 
 Warning: file /etc/asterisk/extensions.ael, line 93-93: expression 
 Zap/r2 has operators, but no variables. Interesting...
 [Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: 
 Warning: file /etc/asterisk/extensions.ael, line 95-95: expression 
 Zap/r1 has operators, but no variables. Interesting...
 

 I'd suggest
 Set(TRUNK=Zap/r2);
 resp.
 Set(TRUNK=Zap/r1);


Philipp Kempgen

   
 
 According to the AEL Documentation I should be able to set variables 
 without using the Set command.  They even give the following example:
 
 context foo {
555 = {
 x=5;
 y=blah;
 divexample=10/2
 NoOp(x is ${x} and y is ${y} !);
};
 };
 
 I wonder if maybe AEL is ignoring the double quotes and treating the 
 Zap/r2 as if it were division???  Should I file a bug report on this?
 

I had gotten similar messages when I forgot to put quotes around 
channels like that (took me forever to realize that one). Since you have 
them I would say this is a bug. What version of asterisk are you running?

-Dave

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

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


Re: [asterisk-users] AEL Variable Warning Messages

2008-12-23 Thread Brent Davidson
Dave Fullerton wrote:
 I had gotten similar messages when I forgot to put quotes around 
 channels like that (took me forever to realize that one). Since you have 
 them I would say this is a bug. What version of asterisk are you running?

 -Dave
I'm running 1.4.21.2 and I can't upgrade until Oslec works reliably with 
DAHDI and Rhino RCBFX card.  I tried doing a new install with 1.4.22 
yesterday and couldn't get Oslec to work correctly with the Rhino card 
when running with DAHDI instead of zaptel.  Unfortunately 1.4.22 no 
longer has Zaptel.  :(

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

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


Re: [asterisk-users] AEL Variable Warning Messages

2008-12-23 Thread Jeff LaCoursiere


On Tue, 23 Dec 2008, Brent Davidson wrote:

 Dave Fullerton wrote:
 I had gotten similar messages when I forgot to put quotes around
 channels like that (took me forever to realize that one). Since you have
 them I would say this is a bug. What version of asterisk are you running?

 -Dave
 I'm running 1.4.21.2 and I can't upgrade until Oslec works reliably with
 DAHDI and Rhino RCBFX card.  I tried doing a new install with 1.4.22
 yesterday and couldn't get Oslec to work correctly with the Rhino card
 when running with DAHDI instead of zaptel.  Unfortunately 1.4.22 no
 longer has Zaptel.  :(


Why do you need oslec to work with the rhino card - it has hardware echo 
cancellation built in doesn't it?

j

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

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


Re: [asterisk-users] AEL Variable Warning Messages

2008-12-23 Thread Tzafrir Cohen
On Tue, Dec 23, 2008 at 03:09:51PM -0600, Brent Davidson wrote:

 Unfortunately 1.4.22 no 
 longer has Zaptel.  :(

Asterisk 1.4.22 builds with both Zaptel and DAHDI.

-- 
   Tzafrir Cohen
icq#16849755  jabber:tzafrir.co...@xorcom.com
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

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

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


Re: [asterisk-users] AEL Variable Warning Messages

2008-12-23 Thread Brent Davidson

Tzafrir Cohen wrote:

On Tue, Dec 23, 2008 at 03:09:51PM -0600, Brent Davidson wrote:

  
Unfortunately 1.4.22 no 
longer has Zaptel.  :(



Asterisk 1.4.22 builds with both Zaptel and DAHDI.

  
I spent several hours trying to make it work yesterday and it just 
wouldn't.  I kept getting an error message that it was unable to bind 
the echo canceler to channel 1.  It might have something to do with the 
RCBFX drivers, I'm not sure.  I found your page and followed your 
instructions.  Everything appeared to work until I checked with 
dahdi_cfg -vv.  That's where I got the message.  Don't have my notes 
here so I don't have the actual error message right now.




--
Brent Davidson
I.T. Manager
Texas Country Title Company
112 W 2nd / P.O. Box 663
Cameron, TX 76520
254-605-0140 ex. 21

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

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

Re: [asterisk-users] AEL Variable Warning Messages

2008-12-23 Thread Brent Davidson

Jeff LaCoursiere wrote:

On Tue, 23 Dec 2008, Brent Davidson wrote:

  

Dave Fullerton wrote:


I had gotten similar messages when I forgot to put quotes around
channels like that (took me forever to realize that one). Since you have
them I would say this is a bug. What version of asterisk are you running?

-Dave
  

I'm running 1.4.21.2 and I can't upgrade until Oslec works reliably with
DAHDI and Rhino RCBFX card.  I tried doing a new install with 1.4.22
yesterday and couldn't get Oslec to work correctly with the Rhino card
when running with DAHDI instead of zaptel.  Unfortunately 1.4.22 no
longer has Zaptel.  :(




Why do you need oslec to work with the rhino card - it has hardware echo 
cancellation built in doesn't it?


j
  


The Rhino card is supposed to have hardware echo cancellation.  That's 
one of the main reasons I switched to that card from the X-100p's I was 
using.  Unfortunately, either I don't know how to turn on the hardware 
echo cancellation or it just doesn't work.  I have 5  separate location 
where I'm using that card and if I turn off Oslec at any of them the 
echo is so bad that the systems is virtually unusable.  With Oslec 
enabled, however, there is no echo at all.



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

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

Re: [asterisk-users] AEL Variable Warning Messages

2008-12-23 Thread Tzafrir Cohen
On Tue, Dec 23, 2008 at 04:01:24PM -0600, Brent Davidson wrote:
 Tzafrir Cohen wrote:
 On Tue, Dec 23, 2008 at 03:09:51PM -0600, Brent Davidson wrote:
 
   
 Unfortunately 1.4.22 no 
 longer has Zaptel.  :(
 
 
 Asterisk 1.4.22 builds with both Zaptel and DAHDI.
 
   
 I spent several hours trying to make it work yesterday and it just 
 wouldn't.  I kept getting an error message that it was unable to bind 
 the echo canceler to channel 1.  

What error message from where?

With Zaptel the echo canceller settings are global (that is: one
hard-coded echo canceller). With DAHDI there are echo canceller modules
and you can (and actually need to) set them per-channel.

 It might have something to do with the 
 RCBFX drivers, I'm not sure.  I found your page and followed your 
 instructions.  Everything appeared to work until I checked with 
 dahdi_cfg -vv.  That's where I got the message.  Don't have my notes 
 here so I don't have the actual error message right now.
 
 
 
 -- 
 Brent Davidson
 I.T. Manager
 Texas Country Title Company
 112 W 2nd / P.O. Box 663
 Cameron, TX 76520
 254-605-0140 ex. 21
 

 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
   Tzafrir Cohen
icq#16849755  jabber:tzafrir.co...@xorcom.com
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

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

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


Re: [asterisk-users] AEL Variable Warning Messages

2008-12-23 Thread Brent Davidson

Tzafrir Cohen wrote:



What error message from where?

With Zaptel the echo canceller settings are global (that is: one
hard-coded echo canceller). With DAHDI there are echo canceller modules
and you can (and actually need to) set them per-channel.

  
It might have something to do with the 
RCBFX drivers, I'm not sure.  I found your page and followed your 
instructions.  Everything appeared to work until I checked with 
dahdi_cfg -vv.  That's where I got the message.  Don't have my notes 
here so I don't have the actual error message right now.

I don't remember the actual error name, but it showed up when I did 
dahdi_cfg -vv.  It was something like DAHDI_ATTACH_ECHO_CANCELLER 
Failed for Channel 1.  Unsupported command (22).


I was trying to see if maybe it was logged to my  syslog but this is all 
I find in my /var/log/messages:


Dec 22 17:01:43 localhost modprobe: FATAL: Error inserting 
dahdi_echocan_oslec (/lib/modules/2.6.23.8x86_64/dahdi/dahdi_echocan_osle

c.ko): Unknown symbol in module, or unknown parameter (see dmesg)

Dec 22 17:01:43 localhost kernel: rcbfx 1: Spotted a Rhino: Rhino 
RCB4FXO (4 channels)
Dec 22 17:01:43 localhost kernel: dahdi_echocan_oslec: Unknown symbol 
oslec_create
Dec 22 17:01:43 localhost kernel: dahdi_echocan_oslec: Unknown symbol 
oslec_update
Dec 22 17:01:43 localhost kernel: dahdi_echocan_oslec: Unknown symbol 
oslec_free



Also, when using the Dahdi/Oslec/RCBFX combination I was getting tons of 
blocks like this in my syslog:


Dec 22 16:54:58 localhost kernel: 80c = 2c7e5000
Dec 22 16:54:58 localhost kernel: 810 = 240
Dec 22 16:54:59 localhost kernel: 814 = 0
Dec 22 16:55:00 localhost kernel: 818 = 0
Dec 22 16:55:00 localhost kernel: 81c = 0
Dec 22 16:55:00 localhost kernel: 820 = 
Dec 22 16:55:01 localhost kernel: 824 = 
Dec 22 16:55:01 localhost kernel: 828 = 
Dec 22 16:55:02 localhost kernel: 82c = 0
Dec 22 16:55:02 localhost kernel: 830 = 
Dec 22 16:55:02 localhost kernel: 834 = 
Dec 22 16:55:02 localhost kernel: 838 = 
Dec 22 16:55:03 localhost kernel: 83c = 0
Dec 22 16:55:03 localhost kernel: 840 = 3
Dec 22 16:55:04 localhost kernel: 844 = f
Dec 22 16:55:04 localhost kernel: 848 = 
Dec 22 16:55:04 localhost kernel: 84c = 0
Dec 22 16:55:04 localhost kernel: 850 = 0
Dec 22 16:55:05 localhost kernel: 854 = 10f
Dec 22 16:55:05 localhost kernel: 858 = 14e00ff
Dec 22 16:55:12 localhost kernel: 85c = 3d434310
Dec 22 16:55:13 localhost kernel: 860 = 0
Dec 22 16:55:13 localhost kernel: 864 = 0
Dec 22 16:55:18 localhost kernel: 868 = 229e229e
Dec 22 16:55:18 localhost kernel: 86c = 0
Dec 22 16:55:19 localhost kernel: 870 = 5
Dec 22 16:55:19 localhost kernel: 874 = 5
Dec 22 16:55:20 localhost kernel: 878 = 
Dec 22 16:55:20 localhost kernel: 87c = 0
Dec 22 16:55:21 localhost kernel: 880 = 0
Dec 22 16:55:21 localhost kernel: 884 = 0
Dec 22 16:55:21 localhost kernel: 888 = 0
Dec 22 16:55:22 localhost kernel: 88c = 0
Dec 22 16:55:22 localhost kernel: 890 = 0
Dec 22 16:55:22 localhost kernel: 894 = 0
Dec 22 16:55:24 localhost kernel: 898 = 0
Dec 22 16:55:26 localhost kernel: 89c = 0
Dec 22 16:55:28 localhost kernel: 8a0 = 0
Dec 22 16:55:28 localhost kernel: 8a4 = 0
Dec 22 16:55:28 localhost kernel: 8a8 = 0
Dec 22 16:55:28 localhost kernel: 8ac = 0
Dec 22 16:55:28 localhost kernel: 8b0 = 0
Dec 22 16:55:28 localhost kernel: 8b4 = 0
Dec 22 16:55:28 localhost kernel: 8b8 = 0
Dec 22 16:55:28 localhost kernel: 8bc = 0
Dec 22 16:55:28 localhost kernel: 8c0 = 0
Dec 22 16:55:28 localhost kernel: 8c4 = 0
Dec 22 16:55:28 localhost kernel: 8c8 = 0
Dec 22 16:55:28 localhost kernel: 8cc = 0
Dec 22 16:55:28 localhost kernel: 8d0 = 0
Dec 22 16:55:28 localhost kernel: 8d4 = 0
Dec 22 16:55:28 localhost kernel: 8d8 = 0
Dec 22 16:55:28 localhost kernel: 8dc = 0
Dec 22 16:55:28 localhost kernel: 8e0 = 0
Dec 22 16:55:28 localhost kernel: 8e4 = 0
Dec 22 16:55:28 localhost kernel: 8e8 = 0
Dec 22 16:55:28 localhost kernel: 8ec = 0
Dec 22 16:55:29 localhost kernel: 8f0 = 0
Dec 22 16:55:29 localhost kernel: 8f4 = 0
Dec 22 16:55:29 localhost kernel: 8f8 = 0
Dec 22 16:55:29 localhost kernel: 8fc = 0
Dec 22 16:55:29 localhost kernel: 900 = 0
Dec 22 16:55:29 localhost kernel: 904 = 0
Dec 22 16:55:29 localhost kernel: 908 = 0
Dec 22 16:55:29 localhost kernel: 90c = f0f0f0f
Dec 22 16:55:29 localhost kernel: 910 = f0f0f0f

Switching back to Zaptel solved all of the problems.
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] ael vs conf

2008-12-18 Thread RE Kushner List Account
David fire wrote:
 hi
 what i should use? ael or conf???

I think it's personal choice at this point, I recently switched 
everything to ael, it's easier to read and follow the flow and less 
typing of redundant stuff. I have found that ael finds more of my fat 
finger mistakes when it compiles in Asterisk, bombing out during ael 
load instead of a call bombing in unexpected ways if you have a syntax 
error in the .conf file.

Redoing extensions.conf into extensions.ael also allowed me to reduce 
the file several hundred lines due to optimization of a file that was 
out of control to begin with. The reduction in size was still achieved 
even though I had to add call queue functionality into the ael file due 
to AgentCallbackLogin being eliminated. This experience taught me I need 
to go back and review everything every few months to keep things from 
getting out of hand.

-Ron


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

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


Re: [asterisk-users] ael vs conf

2008-12-18 Thread Tzafrir Cohen
On Thu, Dec 18, 2008 at 10:48:03AM -0200, David fire wrote:
 hi
 what i should use? ael or conf??? 

lua ?

 thanks
 David

Silly (and untested) tip of the day:

Instead of using include, use templates:

If you have:


[a]
exten = _12X

[b]
include = a
exten = _1.


This won't work as planned, as [a] is included and checked after [b].
So:

[a]
exten = _12X

[b](a)
exten = _1.

Would result in [b] having:
exten = _12X
exten = _1.

What's the ael equivalent?

-- 
   Tzafrir Cohen
icq#16849755  jabber:tzafrir.co...@xorcom.com
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

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

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


Re: [asterisk-users] ael vs conf

2008-12-18 Thread David fire
???

2008/12/18 Tzafrir Cohen tzafrir.co...@xorcom.com

 On Thu, Dec 18, 2008 at 10:48:03AM -0200, David fire wrote:
  hi
  what i should use? ael or conf???

 lua ?

  thanks
  David

 Silly (and untested) tip of the day:

 Instead of using include, use templates:

 If you have:


 [a]
 exten = _12X

 [b]
 include = a
 exten = _1.


 This won't work as planned, as [a] is included and checked after [b].
 So:

 [a]
 exten = _12X

 [b](a)
 exten = _1.

 Would result in [b] having:
 exten = _12X
 exten = _1.

 What's the ael equivalent?

 --
   Tzafrir Cohen
 icq#16849755  
 jabber:tzafrir.co...@xorcom.comjabber%3atzafrir.co...@xorcom.com
 +972-50-7952406   mailto:tzafrir.co...@xorcom.com
 http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

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

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



???
-- 
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
()_()signature to help him gain world domination.
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] ael vs conf

2008-12-18 Thread Steve Murphy
On Thu, 2008-12-18 at 15:36 +0200, Tzafrir Cohen wrote:
 On Thu, Dec 18, 2008 at 10:48:03AM -0200, David fire wrote:
  hi
  what i should use? ael or conf??? 
 
 lua ?
 
  thanks
  David
 
 Silly (and untested) tip of the day:
 
 Instead of using include, use templates:
 
 If you have:
 
 
 [a]
 exten = _12X
 
 [b]
 include = a
 exten = _1.
 
 
 This won't work as planned, as [a] is included and checked after [b].
 So:
 
 [a]
 exten = _12X
 
 [b](a)
 exten = _1.
 
 Would result in [b] having:
 exten = _12X
 exten = _1.
 
 What's the ael equivalent?

I guess, if you use the #include filename, you could save the exten =
_12X in a file snippet and include it where you want it.

I'll have to think about how AEL might support templates, tho.

murf


Steve Murphy
Digium, Inc. | Software Developer
57 Lane 17 –Cody, WY 82414 – USA
direct: +1 256-428-6002
mobile: +1 307-899-5535
fax/home: +1 307-754-5675
irc: codefreeze | jabber: m...@digium.com
Check us out at: www.digium.com www.asterisk.org




smime.p7s
Description: S/MIME cryptographic signature
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] ael queue gosub already has PBX structure??

2008-12-17 Thread Mark Michelson
Giedrius Augys wrote:
 Hello,
 
   I want that after client and queue member call would be established, 
 cmd queue runs some 'procedures' . So I am using cmd Queue option 
 'gosub'. This is my example of ael :
 
 context QUEUE {
 _X. = {
 Ringing();
 Wait(4);
 Answer();
 Queue(${Queue},wr,,,60,,,check-record);
 Hangup();
 };
 };
 
 macro check-record() {
 Set(MEMBERNUMBER=${CUT(MEMBERINTERFACE,@,1)});
 Set(MEMBERNUMBER=${CUT(MEMBERNUMBER,/,2)});
 return;
 };
 
 Everything works normal, but when the client's and queue call 
 establishes , I get this WARNING:
 
 -- Local/1...@cc-out-da9a;1 answered SIP/xxx.xxx.xx-12d132d0
 [Dec 17 20:52:12] WARNING[3849]: pbx.c:3656 __ast_pbx_run: 
 SIP/sip.call.lt-12d132d0 already has PBX structure??
   == Starting SIP/sip.call.lt-12d132d0 at check-record,s,0 failed so 
 falling back to exten 's'
 -- Executing [...@check-record:1] Set(SIP/sip.call.lt-12d132d0, 
 MEMBERNUMBER=Local/123) in new stack
 -- Executing [...@check-record:2] Set(SIP/sip.call.lt-12d132d0, 
 MEMBERNUMBER=123) in new stack
 
 What I'm missing? Something wrong with ael syntax/structure ?
 
 Thanks in advance
 
 -- 
 Pagarbiai  / Best Regards,
 Giedrius Augys
 

This is a bug you are experiencing, which I fixed recently in a series of 
commits. Assuming you are using a 1.6 tag, the next build should have this 
problem fixed.

Mark Michelson

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

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


Re: [asterisk-users] ael queue gosub already has PBX structure??

2008-12-17 Thread Giedrius Augys
2008/12/17 Mark Michelson mmichel...@digium.com

 Giedrius Augys wrote:
  Hello,
 
I want that after client and queue member call would be established,
  cmd queue runs some 'procedures' . So I am using cmd Queue option
  'gosub'. This is my example of ael :
 
  context QUEUE {
  _X. = {
  Ringing();
  Wait(4);
  Answer();
  Queue(${Queue},wr,,,60,,,check-record);
  Hangup();
  };
  };
 
  macro check-record() {
  Set(MEMBERNUMBER=${CUT(MEMBERINTERFACE,@,1)});
  Set(MEMBERNUMBER=${CUT(MEMBERNUMBER,/,2)});
  return;
  };
 
  Everything works normal, but when the client's and queue call
  establishes , I get this WARNING:
 
  -- Local/1...@cc-out-da9a;1 answered SIP/xxx.xxx.xx-12d132d0
  [Dec 17 20:52:12] WARNING[3849]: pbx.c:3656 __ast_pbx_run:
  SIP/sip.call.lt-12d132d0 already has PBX structure??
== Starting SIP/sip.call.lt-12d132d0 at check-record,s,0 failed so
  falling back to exten 's'
  -- Executing [...@check-record:1] Set(SIP/sip.call.lt-12d132d0,
  MEMBERNUMBER=Local/123) in new stack
  -- Executing [...@check-record:2] Set(SIP/sip.call.lt-12d132d0,
  MEMBERNUMBER=123) in new stack
 
  What I'm missing? Something wrong with ael syntax/structure ?
 
  Thanks in advance
 
  --
  Pagarbiai  / Best Regards,
  Giedrius Augys
 

 This is a bug you are experiencing, which I fixed recently in a series of
 commits. Assuming you are using a 1.6 tag, the next build should have this
 problem fixed.

 Mark Michelson

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

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


Hi,
  yes I'm using 1.6.0.1 version.

-- 
Pagarbiai  / Best Regards,
Giedrius Augys
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] AEL NoOp not working [SOLVED]

2008-11-07 Thread Olivier
2008/11/6 Steve Murphy [EMAIL PROTECTED]

 On Thu, 2008-11-06 at 13:55 +0100, Olivier wrote:

 
  Yes, you're right : NoOp needs verbosity of 3 and above.
  Thanks for helping.
 
  The surprising thing is that AEL Verbose prints output whatever the
  verbosity level is (even with 0).
  Would you qualify this as normal ?
 

 Olivier--

 The Verbose() app behaves the same whether you call it from AEL or via
 extensions.conf, or any other method that is used to get dialplan stuff
 into Asterisk. Are you including the verbosity level? For instance,
 if you say Verbose(Hi there); the verbosity level is zero by default.
 If you want to restrict it 3 or more, then Verbose(3,Hello); should do
 the trick.

 murf


Hi,

Ok  : I didn't know that
I should have read doc more deeply before asking here
Thanks

 
 --
 Steve Murphy
 Software Developer
 Digium

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

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

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

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

Re: [asterisk-users] AEL NoOp not working

2008-11-06 Thread Olivier
2008/11/5 Atis Lezdins [EMAIL PROTECTED]

 On Wed, Nov 5, 2008 at 5:28 PM, Olivier [EMAIL PROTECTED] wrote:
 
 
  2008/11/5 Atis Lezdins [EMAIL PROTECTED]
 
  On Wed, Nov 5, 2008 at 12:39 PM, Olivier [EMAIL PROTECTED] wrote:
   Hi,
  
   I've new to http://www.voip-info.org/wiki/view/Asterisk+AEL2
  
   I'm using NoOp and Verbose functions inside extensions.ael.
   Strangely, NoOp is not printing anything in Asterisk console while
   Verbose
   is working.
   Am I missing something obvious ?
 
  Hi,
 
  NoOp is not outputting anything, it's just does nothing, however you
  should still be able to see Executing NoOp(blablabla) in console,
  as it's a command.
 
  Yes, that's the point : I don't see anything in console (I wasn't
 expecting
  anything else to happen).
  Strange ...

 Ok, i played with this, and seems that Executing ...  lines are
 shown in CLI only on verbose level 3 or higher.

 So, either start asterisk with asterisk -vvv or issue core set
 verbose 3 in CLI.


Yes, you're right : NoOp needs verbosity of 3 and above.
Thanks for helping.

The surprising thing is that AEL Verbose prints output whatever the
verbosity level is (even with 0).
Would you qualify this as normal ?


 Regards,
 Atis

 --
 Atis Lezdins,
 VoIP Project Manager / Developer,
 [EMAIL PROTECTED]
 Skype: atis.lezdins
 Cell Phone: +371 28806004
 Cell Phone: +1 800 7300689
 Work phone: +1 800 7502835

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

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

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

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

Re: [asterisk-users] AEL NoOp not working

2008-11-06 Thread Steve Murphy
On Thu, 2008-11-06 at 13:55 +0100, Olivier wrote:

 
 Yes, you're right : NoOp needs verbosity of 3 and above.
 Thanks for helping.
 
 The surprising thing is that AEL Verbose prints output whatever the
 verbosity level is (even with 0).
 Would you qualify this as normal ?
 

Olivier--

The Verbose() app behaves the same whether you call it from AEL or via
extensions.conf, or any other method that is used to get dialplan stuff
into Asterisk. Are you including the verbosity level? For instance,
if you say Verbose(Hi there); the verbosity level is zero by default.
If you want to restrict it 3 or more, then Verbose(3,Hello); should do 
the trick.

murf

 
-- 
Steve Murphy
Software Developer
Digium


smime.p7s
Description: S/MIME cryptographic signature
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] AEL NoOp not working

2008-11-05 Thread Atis Lezdins
On Wed, Nov 5, 2008 at 12:39 PM, Olivier [EMAIL PROTECTED] wrote:
 Hi,

 I've new to http://www.voip-info.org/wiki/view/Asterisk+AEL2

 I'm using NoOp and Verbose functions inside extensions.ael.
 Strangely, NoOp is not printing anything in Asterisk console while Verbose
 is working.
 Am I missing something obvious ?

Hi,

NoOp is not outputting anything, it's just does nothing, however you
should still be able to see Executing NoOp(blablabla) in console,
as it's a command.

Regards,
Atis


-- 
Atis Lezdins,
VoIP Project Manager / Developer,
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

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

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


Re: [asterisk-users] AEL NoOp not working

2008-11-05 Thread Olivier
2008/11/5 Atis Lezdins [EMAIL PROTECTED]

 On Wed, Nov 5, 2008 at 12:39 PM, Olivier [EMAIL PROTECTED] wrote:
  Hi,
 
  I've new to http://www.voip-info.org/wiki/view/Asterisk+AEL2
 
  I'm using NoOp and Verbose functions inside extensions.ael.
  Strangely, NoOp is not printing anything in Asterisk console while
 Verbose
  is working.
  Am I missing something obvious ?

 Hi,

 NoOp is not outputting anything, it's just does nothing, however you
 should still be able to see Executing NoOp(blablabla) in console,
 as it's a command.


Yes, that's the point : I don't see anything in console (I wasn't expecting
anything else to happen).
Strange ...



 Regards,
 Atis


 --
 Atis Lezdins,
 VoIP Project Manager / Developer,
 [EMAIL PROTECTED]
 Skype: atis.lezdins
 Cell Phone: +371 28806004
 Cell Phone: +1 800 7300689
 Work phone: +1 800 7502835

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

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

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

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

Re: [asterisk-users] AEL NoOp not working

2008-11-05 Thread Atis Lezdins
On Wed, Nov 5, 2008 at 5:28 PM, Olivier [EMAIL PROTECTED] wrote:


 2008/11/5 Atis Lezdins [EMAIL PROTECTED]

 On Wed, Nov 5, 2008 at 12:39 PM, Olivier [EMAIL PROTECTED] wrote:
  Hi,
 
  I've new to http://www.voip-info.org/wiki/view/Asterisk+AEL2
 
  I'm using NoOp and Verbose functions inside extensions.ael.
  Strangely, NoOp is not printing anything in Asterisk console while
  Verbose
  is working.
  Am I missing something obvious ?

 Hi,

 NoOp is not outputting anything, it's just does nothing, however you
 should still be able to see Executing NoOp(blablabla) in console,
 as it's a command.

 Yes, that's the point : I don't see anything in console (I wasn't expecting
 anything else to happen).
 Strange ...

Ok, i played with this, and seems that Executing ...  lines are
shown in CLI only on verbose level 3 or higher.

So, either start asterisk with asterisk -vvv or issue core set
verbose 3 in CLI.

Regards,
Atis

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

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

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


Re: [asterisk-users] AEL and swap from macros to contexts

2008-10-07 Thread Pavel Jezek


Atis Lezdins wrote:
 On Tue, Oct 7, 2008 at 8:45 AM, Pavel Jezek [EMAIL PROTECTED] wrote:
   
 Steve Murphy wrote:
 
 On Mon, 2008-10-06 at 18:25 +0200, Pavel Jezek wrote:

   
 Atis Lezdins wrote:

 
 On Mon, Oct 6, 2008 at 5:21 PM, Pavel Jezek [EMAIL PROTECTED] wrote:


   
 Hi, according to discussion on asterisk IRC, where people said, that
 macros will be depracated, I tried to migrate from macros to contexts
 and Gosub
 but if I try to use gosub in extensions.ael, ael compiler complains,
 that I shouln't use Gosub app,
 but I can't find ael keyword, that will be Gosub equivalent, or can I
 ignore this ael warnings? thanks
 PJ


 LOG: lev:3 file:pval.c  line:2521 func: check_pval_item  Warning: file
 /etc/asterisk/extensions.ael, line 36-36: application call to Gosub
 affects flow of control, and needs to be re-written using AEL if, while,
 goto, etc. keywords instead!


 
 Hi,

 In definition use:

 macro set_record(A,B) {
   // do something
 }

 And for calling:

 set_record(${CALLERID(NUM)},${EXTEN});

 It will automatically be translated to GoSub in 1.6, but will remain
 as Macro in 1.4.


   
 yes, I know, but I hear on IRC, that macros will be deprecated and
 suggestion was to move to contexts,
 personaly I would like also move away from macros, because macros have
 some limitations, eg. variable number of arguments isn't possible with
 classic macros,
 macros also require variable to be defined in macro definition (that is
 needless, because I'm referecing to ARG1, ARG2 etc. inside macros)
 so I definitively agree with moving from macros to contexts, only one
 bad thing is compiler warning, when I try to Gosub to context (as macro
 replacement)
 PJ



 
 Pavel--

 Yes, you can ignore the warnings and go ahead and hardcoded gosub calls
 into your source. I didn't upgrade 1.4 to use gosub-instead-of-macro
 because
 the key element ended up being calling gosub with arguments, which
 didn't
 make it into 1.4.

 Someday, when you upgrade from 1.4 to 1.6, you will have to change
 all your gosub's to use the argument passing feature, if you hardcode
 gosubs now. Or, you can backport the gosub-with-arguments feature to
 1.4,
 and use 1.6 AEL to compile... which will give you some future
 portability
 when you do move to 1.6...

 Sorry to make simple things sound so complicated!

 murf


   
 murf, thank you for clear answer,
 currently, I'm using asterisk trunk (and 1.6 also),
 do you plan to remove quite confusing AEL warnings, that appears, when I
 try to hardcode Gosub with arguments into ael dialplan?
 

 Why would you still want to hardcode them?
   
because I would like to move completely away from using classic macros, 
because it have some limitations, as I said, variable number of 
arguments passed to macro is example,
so I moving from macros to contexts that do the same functionality and 
haven't limitations that macros have
and if I will have only contexts in ael dialplan I must call it with 
Gosub (I can't call context using )
PJ

 Please see above sample, you can use prefixing with and  ().
   

 Regards,
 Atis.

   
 PJ


 
 Regards,
 Atis





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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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

 

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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
 
 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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

 



   

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL and swap from macros to contexts

2008-10-07 Thread Atis Lezdins
On Tue, Oct 7, 2008 at 2:20 PM, Pavel Jezek [EMAIL PROTECTED] wrote:


 Atis Lezdins wrote:
 On Tue, Oct 7, 2008 at 8:45 AM, Pavel Jezek [EMAIL PROTECTED] wrote:

 Steve Murphy wrote:

 On Mon, 2008-10-06 at 18:25 +0200, Pavel Jezek wrote:


 Atis Lezdins wrote:


 On Mon, Oct 6, 2008 at 5:21 PM, Pavel Jezek [EMAIL PROTECTED] wrote:



 Hi, according to discussion on asterisk IRC, where people said, that
 macros will be depracated, I tried to migrate from macros to contexts
 and Gosub
 but if I try to use gosub in extensions.ael, ael compiler complains,
 that I shouln't use Gosub app,
 but I can't find ael keyword, that will be Gosub equivalent, or can I
 ignore this ael warnings? thanks
 PJ


 LOG: lev:3 file:pval.c  line:2521 func: check_pval_item  Warning: file
 /etc/asterisk/extensions.ael, line 36-36: application call to Gosub
 affects flow of control, and needs to be re-written using AEL if, while,
 goto, etc. keywords instead!



 Hi,

 In definition use:

 macro set_record(A,B) {
   // do something
 }

 And for calling:

 set_record(${CALLERID(NUM)},${EXTEN});

 It will automatically be translated to GoSub in 1.6, but will remain
 as Macro in 1.4.



 yes, I know, but I hear on IRC, that macros will be deprecated and
 suggestion was to move to contexts,
 personaly I would like also move away from macros, because macros have
 some limitations, eg. variable number of arguments isn't possible with
 classic macros,
 macros also require variable to be defined in macro definition (that is
 needless, because I'm referecing to ARG1, ARG2 etc. inside macros)
 so I definitively agree with moving from macros to contexts, only one
 bad thing is compiler warning, when I try to Gosub to context (as macro
 replacement)
 PJ




 Pavel--

 Yes, you can ignore the warnings and go ahead and hardcoded gosub calls
 into your source. I didn't upgrade 1.4 to use gosub-instead-of-macro
 because
 the key element ended up being calling gosub with arguments, which
 didn't
 make it into 1.4.

 Someday, when you upgrade from 1.4 to 1.6, you will have to change
 all your gosub's to use the argument passing feature, if you hardcode
 gosubs now. Or, you can backport the gosub-with-arguments feature to
 1.4,
 and use 1.6 AEL to compile... which will give you some future
 portability
 when you do move to 1.6...

 Sorry to make simple things sound so complicated!

 murf



 murf, thank you for clear answer,
 currently, I'm using asterisk trunk (and 1.6 also),
 do you plan to remove quite confusing AEL warnings, that appears, when I
 try to hardcode Gosub with arguments into ael dialplan?


 Why would you still want to hardcode them?

 because I would like to move completely away from using classic macros,
 because it have some limitations, as I said, variable number of
 arguments passed to macro is example,
 so I moving from macros to contexts that do the same functionality and
 haven't limitations that macros have
 and if I will have only contexts in ael dialplan I must call it with
 Gosub (I can't call context using )

I think you didn't understood, that declaring macro x and calling it
with x() would make AEL parser to do it for you. They are called
macro just in AEL, but internally they are GoSub's. Additionally you
will be ready for any other future changes.

For example You can use
$aelparse -d -n -w -q extensions.ael

and take a look at generated .conf file. In 1.6.0 it would be:

[set-record]
exten = s,1,Set(LOCAL(A)=${ARG1})
exten = s,2,Set(LOCAL(B)=${ARG2})
...
exten = s,20,Return()

And call to it:
Gosub(set_record,s,1(${CALLERID(num)},${EXTEN}))


Regards,
Atis


 PJ

 Please see above sample, you can use prefixing with and  ().


 Regards,
 Atis.


 PJ



 Regards,
 Atis






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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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

 

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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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

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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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







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

 AstriCon 2008 - September 22 - 

Re: [asterisk-users] AEL and swap from macros to contexts

2008-10-07 Thread Atis Lezdins
On Tue, Oct 7, 2008 at 8:45 AM, Pavel Jezek [EMAIL PROTECTED] wrote:


 Steve Murphy wrote:
 On Mon, 2008-10-06 at 18:25 +0200, Pavel Jezek wrote:

 Atis Lezdins wrote:

 On Mon, Oct 6, 2008 at 5:21 PM, Pavel Jezek [EMAIL PROTECTED] wrote:


 Hi, according to discussion on asterisk IRC, where people said, that
 macros will be depracated, I tried to migrate from macros to contexts
 and Gosub
 but if I try to use gosub in extensions.ael, ael compiler complains,
 that I shouln't use Gosub app,
 but I can't find ael keyword, that will be Gosub equivalent, or can I
 ignore this ael warnings? thanks
 PJ


 LOG: lev:3 file:pval.c  line:2521 func: check_pval_item  Warning: file
 /etc/asterisk/extensions.ael, line 36-36: application call to Gosub
 affects flow of control, and needs to be re-written using AEL if, while,
 goto, etc. keywords instead!


 Hi,

 In definition use:

 macro set_record(A,B) {
   // do something
 }

 And for calling:

 set_record(${CALLERID(NUM)},${EXTEN});

 It will automatically be translated to GoSub in 1.6, but will remain
 as Macro in 1.4.


 yes, I know, but I hear on IRC, that macros will be deprecated and
 suggestion was to move to contexts,
 personaly I would like also move away from macros, because macros have
 some limitations, eg. variable number of arguments isn't possible with
 classic macros,
 macros also require variable to be defined in macro definition (that is
 needless, because I'm referecing to ARG1, ARG2 etc. inside macros)
 so I definitively agree with moving from macros to contexts, only one
 bad thing is compiler warning, when I try to Gosub to context (as macro
 replacement)
 PJ




 Pavel--

 Yes, you can ignore the warnings and go ahead and hardcoded gosub calls
 into your source. I didn't upgrade 1.4 to use gosub-instead-of-macro
 because
 the key element ended up being calling gosub with arguments, which
 didn't
 make it into 1.4.

 Someday, when you upgrade from 1.4 to 1.6, you will have to change
 all your gosub's to use the argument passing feature, if you hardcode
 gosubs now. Or, you can backport the gosub-with-arguments feature to
 1.4,
 and use 1.6 AEL to compile... which will give you some future
 portability
 when you do move to 1.6...

 Sorry to make simple things sound so complicated!

 murf


 murf, thank you for clear answer,
 currently, I'm using asterisk trunk (and 1.6 also),
 do you plan to remove quite confusing AEL warnings, that appears, when I
 try to hardcode Gosub with arguments into ael dialplan?

Why would you still want to hardcode them?

Please see above sample, you can use prefixing with and  ().

Regards,
Atis.

 PJ


 Regards,
 Atis





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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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

 

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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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

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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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




-- 
Atis Lezdins,
VoIP Project Manager / Developer,
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL and swap from macros to contexts

2008-10-06 Thread Atis Lezdins
On Mon, Oct 6, 2008 at 5:21 PM, Pavel Jezek [EMAIL PROTECTED] wrote:
 Hi, according to discussion on asterisk IRC, where people said, that
 macros will be depracated, I tried to migrate from macros to contexts
 and Gosub
 but if I try to use gosub in extensions.ael, ael compiler complains,
 that I shouln't use Gosub app,
 but I can't find ael keyword, that will be Gosub equivalent, or can I
 ignore this ael warnings? thanks
 PJ


 LOG: lev:3 file:pval.c  line:2521 func: check_pval_item  Warning: file
 /etc/asterisk/extensions.ael, line 36-36: application call to Gosub
 affects flow of control, and needs to be re-written using AEL if, while,
 goto, etc. keywords instead!

Hi,

In definition use:

macro set_record(A,B) {
  // do something
}

And for calling:

set_record(${CALLERID(NUM)},${EXTEN});

It will automatically be translated to GoSub in 1.6, but will remain
as Macro in 1.4.

Regards,
Atis



-- 
Atis Lezdins,
VoIP Project Manager / Developer,
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL and swap from macros to contexts

2008-10-06 Thread Pavel Jezek


Atis Lezdins wrote:
 On Mon, Oct 6, 2008 at 5:21 PM, Pavel Jezek [EMAIL PROTECTED] wrote:
   
 Hi, according to discussion on asterisk IRC, where people said, that
 macros will be depracated, I tried to migrate from macros to contexts
 and Gosub
 but if I try to use gosub in extensions.ael, ael compiler complains,
 that I shouln't use Gosub app,
 but I can't find ael keyword, that will be Gosub equivalent, or can I
 ignore this ael warnings? thanks
 PJ


 LOG: lev:3 file:pval.c  line:2521 func: check_pval_item  Warning: file
 /etc/asterisk/extensions.ael, line 36-36: application call to Gosub
 affects flow of control, and needs to be re-written using AEL if, while,
 goto, etc. keywords instead!
 

 Hi,

 In definition use:

 macro set_record(A,B) {
   // do something
 }

 And for calling:

 set_record(${CALLERID(NUM)},${EXTEN});

 It will automatically be translated to GoSub in 1.6, but will remain
 as Macro in 1.4.
   

yes, I know, but I hear on IRC, that macros will be deprecated and 
suggestion was to move to contexts,
personaly I would like also move away from macros, because macros have 
some limitations, eg. variable number of arguments isn't possible with 
classic macros,
macros also require variable to be defined in macro definition (that is 
needless, because I'm referecing to ARG1, ARG2 etc. inside macros)
so I definitively agree with moving from macros to contexts, only one 
bad thing is compiler warning, when I try to Gosub to context (as macro 
replacement)
PJ



 Regards,
 Atis



   

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL and swap from macros to contexts

2008-10-06 Thread Kevin P. Fleming
Pavel Jezek wrote:

 yes, I know, but I hear on IRC, that macros will be deprecated and 
 suggestion was to move to contexts,
 personaly I would like also move away from macros, because macros have 
 some limitations, eg. variable number of arguments isn't possible with 
 classic macros,
 macros also require variable to be defined in macro definition (that is 
 needless, because I'm referecing to ARG1, ARG2 etc. inside macros)
 so I definitively agree with moving from macros to contexts, only one 
 bad thing is compiler warning, when I try to Gosub to context (as macro 
 replacement)

You are confusing AEL macros with traditional dialplan macros; they are
no longer the same thing. As of Asterisk 1.6, AEL macros are implemented
using Gosub, but this is transparent to the AEL programmer... the AEL
dialplan still calls it a 'macro'.

-- 
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - The Genuine Asterisk Experience (TM)

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL and swap from macros to contexts

2008-10-06 Thread Steve Murphy
On Mon, 2008-10-06 at 18:25 +0200, Pavel Jezek wrote:
 
 Atis Lezdins wrote:
  On Mon, Oct 6, 2008 at 5:21 PM, Pavel Jezek [EMAIL PROTECTED] wrote:

  Hi, according to discussion on asterisk IRC, where people said, that
  macros will be depracated, I tried to migrate from macros to contexts
  and Gosub
  but if I try to use gosub in extensions.ael, ael compiler complains,
  that I shouln't use Gosub app,
  but I can't find ael keyword, that will be Gosub equivalent, or can I
  ignore this ael warnings? thanks
  PJ
 
 
  LOG: lev:3 file:pval.c  line:2521 func: check_pval_item  Warning: file
  /etc/asterisk/extensions.ael, line 36-36: application call to Gosub
  affects flow of control, and needs to be re-written using AEL if, while,
  goto, etc. keywords instead!
  
 
  Hi,
 
  In definition use:
 
  macro set_record(A,B) {
// do something
  }
 
  And for calling:
 
  set_record(${CALLERID(NUM)},${EXTEN});
 
  It will automatically be translated to GoSub in 1.6, but will remain
  as Macro in 1.4.

 
 yes, I know, but I hear on IRC, that macros will be deprecated and 
 suggestion was to move to contexts,
 personaly I would like also move away from macros, because macros have 
 some limitations, eg. variable number of arguments isn't possible with 
 classic macros,
 macros also require variable to be defined in macro definition (that is 
 needless, because I'm referecing to ARG1, ARG2 etc. inside macros)
 so I definitively agree with moving from macros to contexts, only one 
 bad thing is compiler warning, when I try to Gosub to context (as macro 
 replacement)
 PJ
 
 

Pavel--

Yes, you can ignore the warnings and go ahead and hardcoded gosub calls
into your source. I didn't upgrade 1.4 to use gosub-instead-of-macro
because
the key element ended up being calling gosub with arguments, which
didn't
make it into 1.4.

Someday, when you upgrade from 1.4 to 1.6, you will have to change
all your gosub's to use the argument passing feature, if you hardcode
gosubs now. Or, you can backport the gosub-with-arguments feature to
1.4,
and use 1.6 AEL to compile... which will give you some future
portability
when you do move to 1.6...

Sorry to make simple things sound so complicated!

murf


 
  Regards,
  Atis
 
 
 

 
 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
Steve Murphy
Software Developer
Digium


smime.p7s
Description: S/MIME cryptographic signature
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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

Re: [asterisk-users] AEL and swap from macros to contexts

2008-10-06 Thread Pavel Jezek


Steve Murphy wrote:
 On Mon, 2008-10-06 at 18:25 +0200, Pavel Jezek wrote:
   
 Atis Lezdins wrote:
 
 On Mon, Oct 6, 2008 at 5:21 PM, Pavel Jezek [EMAIL PROTECTED] wrote:
   
   
 Hi, according to discussion on asterisk IRC, where people said, that
 macros will be depracated, I tried to migrate from macros to contexts
 and Gosub
 but if I try to use gosub in extensions.ael, ael compiler complains,
 that I shouln't use Gosub app,
 but I can't find ael keyword, that will be Gosub equivalent, or can I
 ignore this ael warnings? thanks
 PJ


 LOG: lev:3 file:pval.c  line:2521 func: check_pval_item  Warning: file
 /etc/asterisk/extensions.ael, line 36-36: application call to Gosub
 affects flow of control, and needs to be re-written using AEL if, while,
 goto, etc. keywords instead!
 
 
 Hi,

 In definition use:

 macro set_record(A,B) {
   // do something
 }

 And for calling:

 set_record(${CALLERID(NUM)},${EXTEN});

 It will automatically be translated to GoSub in 1.6, but will remain
 as Macro in 1.4.
   
   
 yes, I know, but I hear on IRC, that macros will be deprecated and 
 suggestion was to move to contexts,
 personaly I would like also move away from macros, because macros have 
 some limitations, eg. variable number of arguments isn't possible with 
 classic macros,
 macros also require variable to be defined in macro definition (that is 
 needless, because I'm referecing to ARG1, ARG2 etc. inside macros)
 so I definitively agree with moving from macros to contexts, only one 
 bad thing is compiler warning, when I try to Gosub to context (as macro 
 replacement)
 PJ


 

 Pavel--

 Yes, you can ignore the warnings and go ahead and hardcoded gosub calls
 into your source. I didn't upgrade 1.4 to use gosub-instead-of-macro
 because
 the key element ended up being calling gosub with arguments, which
 didn't
 make it into 1.4.

 Someday, when you upgrade from 1.4 to 1.6, you will have to change
 all your gosub's to use the argument passing feature, if you hardcode
 gosubs now. Or, you can backport the gosub-with-arguments feature to
 1.4,
 and use 1.6 AEL to compile... which will give you some future
 portability
 when you do move to 1.6...

 Sorry to make simple things sound so complicated!

 murf

   
murf, thank you for clear answer,
currently, I'm using asterisk trunk (and 1.6 also),
do you plan to remove quite confusing AEL warnings, that appears, when I 
try to hardcode Gosub with arguments into ael dialplan?
PJ


 Regards,
 Atis



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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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

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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] AEL Help

2008-06-13 Thread Sherwood McGowan
Jeremy Mann wrote:
 I need help translating extensions.conf to AEL:

 [default]
 exten = _X.,1,Set(DID=${EXTEN:6})
 exten = _X.,n,Goto(continue,1)
 exten = _1X.,1,Set(DID=${EXTEN:7})
 exten = _1X.,n,Goto(continue,1)

 exten = continue,1,Noop(${DID})
 exten = continue,n,Set(GROUP(IAX)=incoming)
 exten = continue,n,GotoIf($[${MATH(${GROUP_COUNT([EMAIL 
 PROTECTED])}+${GROUP_COUNT([EMAIL PROTECTED])},i)}10]?fail)
 exten = continue,n,Goto(from-pri,${DID},1)
 exten = continue,n(fail),Set(DIALSTATUS=CHANUNAVAIL)


 I need the above to goto AEL, here's what I have so far:
 context default {
 _X. = {
 Set(DID=${EXTEN:6});
 Goto(continue,1);
 };

 _1X. = {
 Set(DID=${EXTEN:7});
 Goto(continue,1);
 };

 continue:
 Noop(${DID});
 Set(GROUP(IAX)=incoming);
 GotoIf($[${MATH(${GROUP_COUNT([EMAIL 
 PROTECTED])}+${GROUP_COUNT([EMAIL PROTECTED])},i)}10]?fail);
 Goto(from-pri,${DID},1);
 fail:
 Set(DIALSTATUS=CHANUNAVAIL);
 };
 };

 My issue is I don't know what to do with the fail and continue goto 
 statements.

 Thanks.

 This e-mail, facsimile, or letter and any files or attachments transmitted 
 with it contains information that is confidential and privileged. This 
 information is intended only for the use of the individual(s) and entity(ies) 
 to whom it is addressed. If you are the intended recipient, further 
 disclosures are prohibited without proper authorization. If you are not the 
 intended recipient, any disclosure, copying, printing, or use of this 
 information is strictly prohibited and possibly a violation of federal or 
 state law and regulations. If you have received this information in error, 
 please notify Texas Health Management Group immediately at 1-817-310-4999. 
 Texas Health Management Group, its subsidiaries, and affiliates hereby claim 
 all applicable privileges related to this information.

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

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
   
I'll be more than glad to help :)

Here's the code:
context default {
_X. = {
Set(DID=${EXTEN:6});
continue:
Noop(${DID});
Set(GROUP(IAX)=incoming);

if(${MATH(${GROUP_COUNT([EMAIL PROTECTED])}+${GROUP_COUNT([EMAIL 
PROTECTED])},i)} 
  10) {
Set(DIALSTATUS=CHANUNAVAIL);
}
jump [EMAIL PROTECTED];
}
}

You didn't really need the continue or fail label, as the code that you 
had at fail is taken care of within the if statement's execution.

Let me know if there's any issue, if there is it's probably in the 
implementation of the conditional

-- 
Sherwood McGowan
VoIP / Telecom Solutions
[EMAIL PROTECTED]


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

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


Re: [asterisk-users] AEL Help

2008-06-13 Thread Sherwood McGowan
Sherwood McGowan wrote:
 snip 
 I'll be more than glad to help :)

 Here's the code:
 context default {
_X. = {
Set(DID=${EXTEN:6});
 continue:
Noop(${DID});
Set(GROUP(IAX)=incoming);

 if(${MATH(${GROUP_COUNT([EMAIL PROTECTED])}+${GROUP_COUNT([EMAIL 
 PROTECTED])},i)} 
  10) {
Set(DIALSTATUS=CHANUNAVAIL);
}
jump [EMAIL PROTECTED];
}
 }

 You didn't really need the continue or fail label, as the code that 
 you had at fail is taken care of within the if statement's execution.

 Let me know if there's any issue, if there is it's probably in the 
 implementation of the conditional

Ooops, remove the continue: line, it's not needed

-- 
Sherwood McGowan
VoIP / Telecom Solutions
[EMAIL PROTECTED]


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

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


Re: [asterisk-users] AEL: how to copy a variable without interpretation of the content

2008-04-23 Thread Philipp Kempgen
Eric Dantie schrieb:
 I've got the next AEL:
 
TEST=${X-CALLID};
NoOp(${TEST});
 
 where X-CALLID=ctprueba-1208953210.12 (passed by a custom sip header)  
 
 Executing I've got the error:
 
 [2008-04-23 13:24:01] WARNING[15638]: ast_expr2.y:742 op_minus: non-numeric 
 argument

X_CALLID=SIP_HEADER(X-CALLID);
NoOp(${X_CALLID});

?

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
Let's use IT to solve problems and not to create new ones.
  Asterisk? - http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998

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

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


Re: [asterisk-users] AEL: how to copy a variable without interpretation of the content

2008-04-23 Thread Philipp Kempgen
Philipp Kempgen schrieb:
 Eric Dantie schrieb:
 I've got the next AEL:
 
TEST=${X-CALLID};
NoOp(${TEST});
 
 where X-CALLID=ctprueba-1208953210.12 (passed by a custom sip header)  
 
 Executing I've got the error:
 
 [2008-04-23 13:24:01] WARNING[15638]: ast_expr2.y:742 op_minus: non-numeric 
 argument
 
 X_CALLID=SIP_HEADER(X-CALLID);

Sorry,
X_CALLID=${SIP_HEADER(X-CALLID)};

 NoOp(${X_CALLID});

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
Let's use IT to solve problems and not to create new ones.
  Asterisk? - http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998

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

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


Re: [asterisk-users] AEL: how to copy a variable without interpretation of the content

2008-04-23 Thread Eric Dantie
Strangely, working...
TEST should be ctprueba-123456789.12  but not ctprueba-123456789.12
But got the value.

Thanks.

- Original Message -  
 Try TEST=${X-CALLID}; and see how you go.
 
 Eric Dantie wrote:
 Sorry, bad expressed, what I want to know is how can I do this in AEL:
  
 I've already got a variable X-CALLID with the 
 content ctprueba-123456789.12
  
 How can I copy the content X-CALLID to the new variable TEST?
  
 something like TEST=${X-CALLID};
  
 (The problem comes because of the operator minus).
  
 Thank you.
 Eric Dantie
  


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

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


Re: [asterisk-users] AEL - SQL and TIMEDIFF()

2008-03-06 Thread Andreas Sikkema
 context testsql {
   s = {
 MYSQL(Connect connid ${DBHOST} ${DBUSER} ${DBPASS} ${DB});
 MYSQL(Query resultid ${connid} SELECT 
 TIMEDIFF(callend,callstart) FROM tblCall WHERE id=7);
 MYSQL(fetch fetchid ${resultid} temp);
 MYSQL(Disconnect ${connid});
   }
 }
 /CODE
 
 The error I'm getting is below: 
 [Mar  6 08:59:35] WARNING[27116]: app_addon_sql_mysql.c:268 
 aMYSQL_query: aMYSQL_query: mysql_query failed. Error: You 
 have an error in your SQL syntax; check the manual that 
 corresponds to your MySQL server version for the right syntax 
 to use near ') FROM tblCall WHERE id=7' at line 1

I think the solution would be to escape the , with a backslash, so 
your query would look like this:
SELECT TIMEDIFF(callend\,callstart) FROM tblCall WHERE id=7

Maybe even the brackets ()

-- 
Andreas Sikkema

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

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


Re: [asterisk-users] AEL includes?

2008-01-17 Thread Jay Moore
voip*CLI ael reload
Jan 17 08:53:30 NOTICE[20600]: pbx_ael.c:1146 handle_root_token: Unknown 
root token '#include'

Asterisk 1.2.14. Old, I know but my boss won't spring for a spare box, 
and I don't want to upgrade our only production computer.

Jay

Rodrigo R Passos wrote:
 Jay,
 
 What error?
 
 
 Jay Moore wrote:
 How do I include a file (not a context) in AEL?  #include filename 
 returns an error.

 Thanks,
 Jay

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

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

   
 
 
 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
 


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

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


Re: [asterisk-users] AEL includes?

2008-01-17 Thread Atis Lezdins
On 1/17/08, Jay Moore [EMAIL PROTECTED] wrote:
 How do I include a file (not a context) in AEL?  #include filename
 returns an error.

What's the error?

For me this works:
#include extensions_db.ael;
#include extensions_utils.ael;
#include extensions_ivr.ael;
#include extensions_globals.ael;

However i'm using
#aelparse -d -n -w -q extensions.ael

to dump ael into .conf format

Regards,
Atis

-- 
Atis Lezdins
VoIP Developer,
IQ Labs Inc.
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Work phone: +1 800 7502835

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

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


Re: [asterisk-users] AEL includes?

2008-01-17 Thread Watkins, Bradley
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Jay Moore
 Sent: Thursday, January 17, 2008 9:11 AM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: [asterisk-users] AEL includes?
 
 How do I include a file (not a context) in AEL?  #include filename 
 returns an error.
 
 Thanks,
 Jay
 


That is exactly the syntax that you should be (and I am) using.

I don't know why that wouldn't work, unless you're using an older
version of Asterisk and are using fully-qualified paths.

- Brad

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

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


Re: [asterisk-users] AEL includes?

2008-01-17 Thread Rodrigo R Passos
Jay,

What error?


Jay Moore wrote:
 How do I include a file (not a context) in AEL?  #include filename 
 returns an error.

 Thanks,
 Jay

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

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

   


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

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


Re: [asterisk-users] AEL includes?

2008-01-17 Thread Atis Lezdins
On 1/17/08, Jay Moore [EMAIL PROTECTED] wrote:
 voip*CLI ael reload
 Jan 17 08:53:30 NOTICE[20600]: pbx_ael.c:1146 handle_root_token: Unknown
 root token '#include'

 Asterisk 1.2.14. Old, I know but my boss won't spring for a spare box,
 and I don't want to upgrade our only production computer.

I suppose, that it doesn't support AEL2. You can dump ael to conf file
with command i posted before. Oh, and you will need to grab 1.4, and
compile aelparse from it.

Regards,
Atis


 Jay

 Rodrigo R Passos wrote:
  Jay,
 
  What error?
 
 
  Jay Moore wrote:
  How do I include a file (not a context) in AEL?  #include filename
  returns an error.
 
  Thanks,
  Jay
 
  ___
  -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
  asterisk-users mailing list
  To UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users
 
 
 
 
  ___
  -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
  asterisk-users mailing list
  To UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users
 


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

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



-- 
Atis Lezdins
VoIP Developer,
IQ Labs Inc.
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Work phone: +1 800 7502835

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

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


Re: [asterisk-users] AEL includes?

2008-01-17 Thread Rodrigo R Passos
AEL was an experimental feature in Asterisk 1.2.x and you may not implement all 
funcionts.


Jay Moore wrote:
 voip*CLI ael reload
 Jan 17 08:53:30 NOTICE[20600]: pbx_ael.c:1146 handle_root_token: Unknown 
 root token '#include'

 Asterisk 1.2.14. Old, I know but my boss won't spring for a spare box, 
 and I don't want to upgrade our only production computer.

 Jay

 Rodrigo R Passos wrote:
   
 Jay,

 What error?


 Jay Moore wrote:
 
 How do I include a file (not a context) in AEL?  #include filename 
 returns an error.

 Thanks,
 Jay

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

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

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

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

 


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

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

   


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

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


Re: [asterisk-users] AEL missing in recent 1.2 releases?

2007-09-01 Thread Steve Murphy
On Fri, 2007-08-31 at 19:01 +0100, Chris Bagnall wrote:
 Greetings list,
 
 I've just been upgrading one of our servers from 1.2.17 to 1.2.21.1-r1, and 
 noticed that it's not picking up any of my macros written in AEL.
 
 Upon further examination, it looks like pbx_ael is missing. Is this a 
 deliberate change, or is this something I need to address in the pre-compile 
 configuration?
 
 Regards,
 
 Chris

Chris--

If you can trace this down to something for which we are responsible,
please let us know via a bug report. As far as I know, AEL in 1.2 is
still there. I can't even begin to guess what the problem might be; I
hope you have success in tracking it down!

murf


-- 
Steve Murphy
Software Developer
Digium


smime.p7s
Description: S/MIME cryptographic signature
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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

Re: [asterisk-users] AEL #include file

2007-03-09 Thread Philipp Kempgen
Philipp Kempgen wrote:

 Does anyone know how to include a file in AEL using the
 #include filename
 syntax in .conf files?

Seems like
#include test.ael
works but
#include test.conf
does not.

Regards,
  Philipp

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
 Let's use IT to solve problems and not to create new ones.
   Asterisk? - http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998
___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] AEL #include file

2007-03-09 Thread Tzafrir Cohen
On Fri, Mar 09, 2007 at 07:49:45PM +0100, Philipp Kempgen wrote:
 Hi,
 
 Does anyone know how to include a file in AEL using the
 #include filename
 syntax in .conf files?

Yes, it is supported.

(Technically: It is not part of the ael syntax. #include and #exec are 
preprocessing done before the ael parser gets to read the text.)

-- 
   Tzafrir Cohen   
icq#16849755jabber:[EMAIL PROTECTED]
+972-50-7952406   mailto:[EMAIL PROTECTED]   
http://www.xorcom.com  iax:[EMAIL PROTECTED]/tzafrir
___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] AEL #include file

2007-03-09 Thread Philipp Kempgen
Tzafrir Cohen wrote:

 On Fri, Mar 09, 2007 at 07:49:45PM +0100, Philipp Kempgen wrote:
 Hi,

 Does anyone know how to include a file in AEL using the
 #include filename
 syntax in .conf files?
 
 Yes, it is supported.
 
 (Technically: It is not part of the ael syntax. #include and #exec are 
 preprocessing done before the ael parser gets to read the text.)

Is there a way to include a .conf file from within .ael?
Or the other way round?

BTW: Never heard of #exec. What does that do? Shell exec?


Regards,
  Philipp

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
 Let's use IT to solve problems and not to create new ones.
   Asterisk? - http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998
___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] AEL #include file

2007-03-09 Thread Steve Murphy
On Fri, 2007-03-09 at 20:42 +0100, Philipp Kempgen wrote:
 Tzafrir Cohen wrote:
 
  On Fri, Mar 09, 2007 at 07:49:45PM +0100, Philipp Kempgen wrote:
  Hi,
 
  Does anyone know how to include a file in AEL using the
  #include filename
  syntax in .conf files?
  
  Yes, it is supported.

Correct. It should assume that files are in /etc/asterisk, if that's
what the config file dir is. If they are somewhere, use absolute paths.

  
  (Technically: It is not part of the ael syntax. #include and #exec are 
  preprocessing done before the ael parser gets to read the text.)
 
Well, mostly true; the #include directives are obeyed at the lexical
level of the AEL parser, which is underneath the parser. 

 Is there a way to include a .conf file from within .ael?
 Or the other way round?

No, there isn't. the extensions.conf format is entirely different than
the AEL format, and the AEL parser will not read in extensions.conf
formatted files. 

 
 BTW: Never heard of #exec. What does that do? Shell exec?

The #exec option is available in the extensions.conf (and all config
files, for that matter). It basically will run the command provided, and
the output from it had better be the config file it wants to read in.

This is NOT available for AEL files (at the moment, at least).

 
 
 Regards,
   Philipp
 


smime.p7s
Description: S/MIME cryptographic signature
___
--Bandwidth and Colocation provided by Easynews.com --

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


  1   2   >