Same File included more than once!

Hello,

Hope you doing well

I am More confused with the below warnings

[Jan 11 16:06:05] WARNING[10697]: config.c:351 ast_include_new: '/var/www/pbx/companies/extensions/905.conf', line 2970:  Same File included more than once! This data will be saved in /var/www/pbx/companies/extensions/commonrules/commonrules.conf~~371 if saved back to disk.

[Jan 11 16:06:05] WARNING[10697]: config.c:351 ast_include_new: '/var/www/pbx/companies/extensions/908.conf', line 2986:  Same File included more than once! This data will be saved in /var/www/pbx/companies/extensions/commonrules/commonrules.conf~~373 if saved back to disk.

My Extensions.conf file

#tryinclude /var/www/pbx/companies/extensions/*.conf

My /var/www/pbx/companies/extensions/905.conf file

[905]

#include  /var/www/pbx/companies/extensions/commonrules/commonrules.conf

My /var/www/pbx/companies/extensions/908.conf file

[905]

#include  /var/www/pbx/companies/extensions/commonrules/commonrules.conf

Note: commonrules.conf had no includes or duplicate dialplans

Please Help

Thanks in Advance

Their contents is the same.

Content is same. but context is different only. then what is the reason

Include doesn’t work like that. You’re not including the contents into the context. The entire file is included into the entirety of the dialplan.

The context is 905 in both cases. Whilst I don’t know whether Asterisk would detect this, and I guess it might be going a bit out of its way to do so, all I was saying is that the complete contents of both files was the same.

According to the above, both files begin with the line [905]. Perhaps the line in 908.conf should be [908]?

I think it would be easier to define all these extensions according to a macro. Including a single file should be quicker than doing multiple includes, one per extension.

Second file context is 908 only. It is mistakenly updated. Can I know how to avoid warning in it .

Note: commonrules.conf had not seperate context inside it. it had only dialplan.

My /var/www/pbx/companies/extensions/905.conf file

[905]

#include  /var/www/pbx/companies/extensions/commonrules/commonrules.conf

My /var/www/pbx/companies/extensions/908.conf file

[908]

#include  /var/www/pbx/companies/extensions/commonrules/commonrules.conf

If rules are common, why not just create context and then include them ?

common-rules1
common-rules2

905

908


Daniel