PJSIP.CONF Reverting to default on reboot

Every time I reboot the Server, I lose all config changes in pjsip.conf.

Current system.

Asterisk 13
FreePBX 13.0.192.16
Red Hat 4.4.7-17
2.6.32-642.6.2.el6.x86_64 GNU/Linux

What are you doing that you believe should update that file? Did you mean pjsip.conf?

Hi David

Yes pjsip.conf
I am new to this so I may be missing out vital steps. I am simply creating 2 x endpoints in the config, then creating a dial plan so that 2 phones can call each other, Please see below. It works fine but every time I reboot the server, my version is overwritten with the default pjsip.conf.

PJSIP.CONF
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[6002]
type=endpoint
context=Internal-Users
disallow=all
allow=ulaw
auth=6002
aors=6002

[6002]
type=auth
auth_type=userpass
password=mysecret
username=6002

[6002]
type=aor
max_contacts=1

[6001]
type=endpoint
context=Internal-Users
disallow=all
allow=ulaw
auth=6001
aors=6001

[6001]
type=auth
auth_type=userpass
password=mysecret
username=6001

[6001]
type=aor
max_contacts=1

EXTENSIONS.CONF
[Internal-Users]
exten = 6002,1,Dial(PJSIP/6002,20)
exten = 6001,1,Dial(PJSIP/6001,20)

There isn’t a default pjsip.conf, only a sample one, and that is only installed by make configs. Even then, it is not installed if one already exists.

I wonder if you are using a GUI. GUis, like FreePBX, are not part of Asterisk, and not supported, here, but they do tend to take ownership of most top level configuration files.

Hi David.

Thanks for the reply. I am changing the name of the sample file below and creating a new one with the config detailed above. There is a GUI but I have not made changes in this way. Then, on reboot, the file is overwritten with the sample file again.

mv pjsip.conf pjsip.conf.sample
nano pjsip.conf

;------------------------------------------------------------------------------$
; Do NOT edit this file as it is auto-generated by FreePBX. $
;------------------------------------------------------------------------------$
; For information on adding additional paramaters to this file, please visit th$
; FreePBX.org wiki page, or ask on IRC. This file was created by the new FreePB$
; BMO - Big Module Object. Any similarity in naming with BMO from Adventure Tim$
; is totally deliberate. $
;------------------------------------------------------------------------------$
#include pjsip_custom.conf
#include pjsip.transports.conf
#include pjsip.transports_custom_post.conf
#include pjsip.endpoint.conf
#include pjsip.endpoint_custom_post.conf
#include pjsip.aor.conf
#include pjsip.aor_custom_post.conf
#include pjsip.auth.conf
#include pjsip.auth_custom_post.conf
#include pjsip.registration.conf
#include pjsip.registration_custom_post.conf

As stated in the file you can’t touch it, FreePBX will overwrite and take control of it. Even creating a new file won’t work. It will still get replaced.

Hi all

Thanks for the input. I made the changes in pjsip_custom.conf and extensions_custom.conf. I have rebooted the server and the config changes remain. The system now works as I wanted it to.

Thanks once again.