[asterisk-users] #exec in #include'd file

Philipp Kempgen philipp.kempgen at amooma.de
Tue Jul 14 17:50:43 CDT 2009


Tilghman Lesher schrieb:
> On Tuesday 14 July 2009 15:35:20 Philipp Kempgen wrote:
>> Tilghman Lesher schrieb:
>> > On Monday 13 July 2009 17:19:15 Philipp Kempgen wrote:

>> >> Is any *.conf file (which permits #exec) guaranteed to be read before
>> >> extensions.ael? It would then be possible to (ab)use an #exec in there
>> >> to trigger my generator script (which must not output anything then of
>> >> course). extconfig.conf? logger.conf? modules.conf? Ugly workaround
>> >> but doable.
>> >
>> > No, but you can force it by doing an explicit load of a particular module
>> > in modules.conf.  Explicitly loaded modules are loaded before all
>> > automatically-loaded modules.
>>
>> I'm thinking about the options in following:
>> a) load => extconfig   ; possible?
>>    #exec in extconfig.conf.
>> b) #exec in modules.conf itself

>> It certainly reads modules.conf twice on startup and reads
>> extconfig.conf on startup and reload.
>> Do any other events make Asterisk re-read these files?
> 
> For modules.conf, no, but extconfig.conf is re-read upon a 'module reload
> extconfig' command.  This permits changing realtime settings without
> restarting Asterisk.

Just found out that even a simple `asterisk -r` causes extconfig.conf
to be re-read. That rules extconfig.conf out for what I am trying to
do since I don't want to re-generate extensions.ael every time some-
body connects to the Asterisk console.
Looks like I should go for modules.conf then and implement a mechanism
to avoid re-generating extensions.ael on the second pass in modules.conf.
E.g. I could make the script not do anything if extensions.ael was
modified less than 5 seconds ago. That's not perfect but should do
the trick.
Alternatively I could use load => pbx_config.so and put the #exec in
extensions.conf as murf suggested.
Need to play around a bit.
Thanks to both of you and sorry for hijacking my own thread a bit. :-)


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



More information about the asterisk-users mailing list