This relates to an issue that I am seeing with FreePbx writing conf files, and my workaround to fix, but the question relates to the order of #include statements when read by Asterisk when extending a context.
FreePbx appears to not add the outgoing_proxy parameter to the PJSIP conf files it writes. To address this, without messing with the FreePbx written pjsip.registration.conf file, I have included the parameter in pjsip.registration_custom.conf as follows:
[ATrunk](+) type=registration outbound_proxy=THEPROXYSERVER
with the intention of extending the registration context. However, in pjsip.registration.conf, the include statement added by FreePbx is before the context at the start of the file, and not after at the end.
#include pjsip.registration_custom.conf [ATrunk] type=registration transport=0.0.0.0-udp .......rest of context
In this situation, will the include work, or will it be ignored (i.e. to use the
[context](+) form, does it have to be read after the context it extends, or does Asterisk manage this either way)?