[asterisk-users] AEL #include file

Philipp Kempgen philipp.kempgen at amooma.de
Fri Mar 9 14:21:10 MST 2007


Steve Murphy wrote:

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

Sure.

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

Ok. Thanks.

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

Ok, that's what I tried to do. Now I understand how things
are processed.

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

Found it on the bug tracker. This seems really old but it's
not well known, is it?

This is what I do:

in extensions.conf:

context voicemail
{
	mailbox => {
		VoiceMailMain(${user_name},s);
	}
	#include "e-number-vmm.ael"
}

in e-number-vmm.ael:

80 => jump mailbox;

So if the user wants to change the number to reach VoicemailMain
- provided they use a web interface for that - e-number-vmm.ael
can easily be parsed and adjusted accordingly by some script.


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


More information about the asterisk-users mailing list