I'm filing this as a bug report rather than a feature request because although it is a bug in Asterisk and not FreePBX, it appears that it's not going to be fixed anytime soon (I hope I am wrong about that!) and FreePBX could easily(?) work around it.
There is apparently an ongoing issue where Asterisk freezes up for INTERNAL sip calling if you have one or more SIP trunks that connect to outside providers via the public Internet, and your Internet connection goes down. In that case you not only lose the ability to make outside calls, you also lose the ability to make SIP calls between internal extensions. IAX2 devices are unaffected, but relatively few endpoints use IAX2.
Many commenters have been of the opinion that this is due to a bug in chan_sip or some similar part of Asterisk. However this bug existed in Asterisk 1.2 and apparently still exists in Asterisk 1.4. There has been a discussion of this issue in these threads (and possibly others):
http://forums.whirlpool.net.au/forum-replies.cfm?t=960451
http://www.elastix.org/index.php?option=com_fireboard&Itemid=55&func=view&catid=3&id=10405#10405
My specific request is that FreePBX would have a new "tool" module that would do at least one, and possibly two things:
1) At a minimum, detect when Internet connectivity is lost, by attempting to connect to some outside server at one-minute or five-minute intervals. This could be ANY outside server, though obviously you'd probably want something that exchanges a minimal amount of data. However, if you go to a server that returns your outside IP address, then you could also...
2) Attempt to determine the current "outside" IP address of the Asterisk server and detect whether it has changed since the last time you checked.
In the case of #1, it should disable all SIP trunks (maybe there should be a check box in the SIP trunk configuration to indicate whether that trunk should be disabled if outside connectivity is lost.
In the case of #2, it should (if this function is enabled, which should only be the case if the server does not have a static IP address) rewrite the line in sip_nat.conf that starts with externip=, replacing the part on the right side of the = with the new external IP address. This would help with another apparent Asterisk bug, where using externhost= doesn't always work, and you have to fall back to externip= to avoid one-way audio issues.
These could be part of a module under "Tools" called "Internet connectivity monitor" or something similar. The goal would be that if the Internet goes down completely, disable any SIP trunks that might keep the system from functioning. If the "outside" IP address changes, change it accordingly in sip_nat.conf so users don't have issues with one-way audio or similar. It just seems logical that these very similar functions could be combined in one "tool" module, which could then be installed only by users who need the functions it provides.
Of course the better way would be to get the Asterisk folks to fix these bugs (and backport the fixes!) but as long as they have persisted, I am not holding my breath.