Position of #include statements in conf files

FreePBX is not adding the PJSIP Outbound Proxy to the relevant config files (separate issue)

To workaround, I have added this option in the _custom.conf file as below.

outbound_proxy=internet.p-cscf.sfr.net:5064

However, as the #include added by freePBX to the conf file is at the start, this additional setting is ignored.

` #include pjsip.registration_custom.conf

[TrunkA]
type=registration
transport=0.0.0.0-udp`

If I move it to the end of the conf file, the custom file is read and the option is accepted

`
[TrunkA]
type=registration
transport=0.0.0.0-udp

#include pjsip.registration_custom.conf

`

This is repeatable and verifiable by using a core restart.

Can this not be modified in Freepbx, as as it stands, the custom conf appears ignored by Asterisk?

In your pjsip.registration_custom.conf, try:

[TrunkA]
outbound_proxy=internet.p-cscf.sfr.net:5064

Thanks Dave. I have tried this and it does not work. I have also tried:

[TrunkA](+)

and

[TrunkA](+) type=registration

The only form that works (verified with pjsip show registration TrunkA, is the simple option line in the _custom, and the include at the end.

Generally speaking, custom.conf files are for adding contexts and custom_post.conf files are for modifying existing freepbx contexts. Have you tried using the post file for your mods?

2 Likes

No Igaetz, I have not. Where are these files included, and what is the correct syntax as per the discussion with Dave please?

A grep will tell you where a file is included.

When modifying a context called TrunkA, I would place this in the appropriate *custom_post.conf file:

[TrunkA](+)
type=registration
transport=0.0.0.0-udp
1 Like

OK, I have tried all of the different syntax, and effectively it does work in custom_post.conf by just adding the option (i.e. no trunk, type or +) as in my original post.

As the #include is in pjsip.conf, it seems that the order is the only way that it ends up in the right place (your syntax above is much better) but that is an Asterisk issue.

Thanks for this solution and I will close the issue that I have just created :relaxed:

1 Like

I wouldn’t close the ticket. IMHO, If the option is on the screen, it should be getting updated in the conf file.

Right Dave - but I have created 2 issues, one for the option, and one for the includes - I have asked to have the includes one closed