This will be an issue you cannot really solve with a dynamic IP, it will always happen unless you switch to a static IP.
You can try using the Settings >> Network >> Dynamic option, but that will take some time switch whenever the IP changes, so you will still have some downtime.
Alternatively, you can try hosting 3CX in the cloud and avoid this problem altogether (along with other issues like NAT).
You can choose your own cloud host, or you can use ours: https://www.3cx.com/ordering/pricing/hosted-info/