Dovid Bender
2021-Sep-05 21:10 UTC
[asterisk-users] Asterisk stops loading include files it file is missing
Hi, If I have in extensions.conf includes to files that does not exist Asterisk stop loading all other files. Say for instance I have: #include one.conf ; Exists #include two.conf ; Does not exist #include three.conf ; Exists If two.conf does not exist, even if three.conf exists, asterisk will not load it. Was this done by design or is this a bug? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20210905/e2089594/attachment.html>
Administrator
2021-Sep-05 21:15 UTC
[asterisk-users] Asterisk stops loading include files it file is missing
Hi Le 05/09/2021 à 23:10, Dovid Bender a écrit :> Hi, > > If I have in extensions.conf includes to files that does not exist > Asterisk stop loading all other files. Say for instance I have: > > #include one.conf ; Exists > #include two.conf ; Does not exist > #include three.conf ; Exists > > If two.conf does not exist, even if three.conf exists, asterisk will > not load it. Was this done by design or is this a bug?My solution is to (sample) #include local/directory.d/*.conf so I can add README.md .bak files or whatever I need in this directory and I'm sure that .conf file are taken in account -- Daniel
asterisk at phreaknet.org
2021-Sep-05 21:38 UTC
[asterisk-users] Asterisk stops loading include files it file is missing
On 9/5/2021 5:10 PM, Dovid Bender wrote:> Hi, > > If I have in extensions.conf includes to files that does not exist > Asterisk stop loading all other files. Say for instance I have: > > #include one.conf ; Exists > #include two.conf ; Does not exist > #include three.conf ; Exists > > If two.conf does not exist, even if three.conf exists, asterisk will > not load it. Was this done by design or is this a bug?This is by design. You should use #tryinclude instead of #include for two.conf: https://wiki.asterisk.org/wiki/display/AST/Using%20The%20include,%20tryinclude%20and%20exec%20Constructs