[Home]

Summary:ASTERISK-15739: In dialplan (extensions.conf), subdirectories are not respected
Reporter:Ruddy G (ruddy)Labels:
Date Opened:2010-03-03 14:15:40.000-0600Date Closed:2011-06-07 14:05:02
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Addons/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:In extensions.conf, I include a file which is in  the subdirectory /etc/asterisk/contatio.d/

#include "contatio.d/users.conf"

That works !
Then, in users.conf, I include another file in the same directory
#include "users.part1.conf"

Asterisk looks for users.part1.conf in /etc/asterisk/ instead of the relative directory /etc/asterisk/contatio.d/


****** ADDITIONAL INFORMATION ******

I think that when we include another file, if the include does not start with /, we should look in the relative directory where the include happenned.
Comments:By: Leif Madsen (lmadsen) 2010-03-03 20:30:54.000-0600

Actually I disagree with your assumption. When you perform an include, Asterisk does not have the concept that you included a file within another file. When you include a file, all Asterisk is doing is including that information as if it was a flat file. So doing the following:

extensions.conf:

[context]
exten => 1,1,NoOp()
#include external.inc

external.inc
exten => 2,1,NoOp()


Is exactly the equivalent of doing:

extensions.conf:

[context]
exten => 1,1,NoOp()
exten => 2,1,NoOp()



Just because something is in separate locations and subdirectories on your filesystem, will not relate to Asterisk, because all it will do is load the information from the file, and place it in the extensions.conf file as if it had loaded it directly from the extensions.conf file, so you'll always have to assume a relative path from /etc/asterisk/ or you could specify the full path.