You don’t need the cron job (and shell script, I assume) to modify /etc/hosts. While chan_sip “always” supported a FQDN in FPBX External Address, chan_pjsip just got this capability relatively recently (some time in 2018).
See this blog post:
https://blogs.asterisk.org/2018/01/10/pjsip-dns-manager-dnsmgr-full-dynamic-hostname-support-coming-soon/
and this Community thread:
How do I have my external IP address in Freepbx updated automatically when using PJSIP?
I am behind a dual wan situation and have DDNS, where my FQDN updates automatically.
I understand that there is the External Address setting under General SIP Settings, where you can press the Detect Network Settings to update the external IP address manually.
If you want that to happen automatically for chansip you can provide a Dynamic Host under Chansip Settings and set a refresh intervall.
How do I do…
I set up FPBX 14 with a FQDN in External Address in 11/2018 – works fine.
(This assumes that you have dynamic DNS for the FQDN. Many routers can provide dynamic DNS updates.)
1 Like