Set NAT = yes
IP Configuration = Static IP
Override External IP = my static External IP In General SIP Settings Tab
External Address = my static External IP
Local Networks = 192.168.4.0 / 255.255.255.0
We just port forward 5060 and 5160 , 10000 to 20000 UDP ports
If you’re using a static IP on the outside of the Fortigate, you should set up the SIP settings so that your external address is set correctly, then enable NAT on the server and use the internal address for the local network address.
Once that’s set up, you need to set up a passthrough that sends all incoming traffic on the Fortigate on the appropriate SIP ports to your server on the local network. This usually means (as a minimum) whatever port your ITSP is going to be sending your traffic to (e;g;, UDP 5060) and UDP ports 10000-20000.
I’ve never used a STUN server and I’m on a dynamic ip. My SIP/UDP ports are open (not NATed) but restricted by IP for my several remote extensions. Btw I have to update the external IP in SIP settings whenever my IP changes otherwise FreePBX gets messed up.
FreePBX and Asterisk support Dynamic DNS setups. You set up your system with a hostname instead of an IP address and every time you try to connect to the world, your IP address is re-evaluated to make sure it hasn’t changed. Even with a dynamic address, you wouldn’t typically use a STUN server.