Check if qualify=yes , or maybe try to change its value qualifyfreq.
Next, try to decrease the value for defaultexpiry (if the value is 1800, try to put 300)
Check your NAT settings.
What happen when you try to restart asterisk ? # service asterisk restart
If no change, try to restart network service. # service network restart
If your trunk works after restarting network service, the issue came from the network environment i guess. (Router settings, Gateway settings)
If you don’t be able to fixe this issue side network, you could make a small rule in Fail2ban restarting networks service if internet is up again.
The problem is out of my freepbx machine. I have an UTM firewall developed by a local vendor, that is not able to encampsulate UTP packets correctly whe the connection is recovered. When I make a restart of the machine the session seems to be expired and everyting works again.