Summary:ASTERISK-19107: #include configuration file if it exists (do not fail if it's missing)
Reporter:Timo Teräs (fabled)Labels:
Date Opened:2011-12-26 06:46:25.000-0600Date Closed:2011-12-27 15:22:02.000-0600
Versions:10.0.0 Frequency of
Environment:Attachments:( 0) implement-include-if-exists.diff
Description:A new configuration file directive to include another file, but only if it exists. That is, if it's missing, it would not result in hard error. This is especially useful, to have "#include my_sip_users.d/*.conf" or similar to work properly even if the directory is empty.

See attached patch. It implements new "#-include" that works like this (name similar to Makefile -include).
Comments:By: Paul Belanger (pabelanger) 2011-12-27 15:21:43.027-0600

I believe this has already been added to trunk[1] (Asterisk 11) but it is named #tryinclude, see reviewboard[2] also.

[1] http://svnview.digium.com/svn/asterisk?view=revision&revision=345735
[2] https://reviewboard.asterisk.org/r/1476/

By: Timo Teräs (fabled) 2011-12-28 00:17:56.389-0600

Ah, sorry. I looked over JIRA, and trunk snapshot just before it was committed and didn't notice it. I actually though I had up-to-date trunk, but apparently I messed up my git svn tracking and it was outdated be a month or so.

You still might want to look over the patch, it has few additional fixes: the error checking is done properly there.

Though, the commit from trunk is perfectly sufficient for me.

By: Paul Belanger (pabelanger) 2012-01-03 10:58:34.438-0600

Feel free to submit a new patch using trunk.  I don't see an issue adding more error checking.