This issue related to your router. When you use external domain from inside lan, path of packet is different and router's firewall(or sip-alg algorithm) can work different.
You choices are
Change router. Simplest way.
If router have linux/openwrt inside - fix firewall
If router have linux/openwrt inside - change dns server to give local ip for requests from inside network.
if router support SIP-ALG - try turn that off.
Use softphone with more then 1 sip record(for example zoiper free version).