Search code examples
registrationsipasterisklandomain-name

Failing to register with domainname asterisk from local LAN


I am using a local asterisk server on a machine behind a router. The asterisk-server has a fixed local IP and the routers external IP is registered with dyndns and can be resolved from outside my network.

1) I am able to register a SIP client with the server from outside my LAN using the domain name mydomain@dyndns.com

2) I am able to register a SIP client with the server from inside my LAN using the local fixed IP address of the asterisk server

3) Howver, I can't register from inside my LAN using the domain name. As a consequence, I need to change registration settings on my mobile SIP client every time I leave my house (or come back home).

I have tried multiple variations and permutations of parameters in sip.conf (localnet, externhost, nat, domain) but fail to get it right (or find a simple explanation what to do in such a basic scenario). Could anybody please help me with the parameters for my sip.conf? Many thanks in advance...


Solution

  • 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

    1. Change router. Simplest way.

    2. If router have linux/openwrt inside - fix firewall

    3. If router have linux/openwrt inside - change dns server to give local ip for requests from inside network.

    4. if router support SIP-ALG - try turn that off.

    5. Use softphone with more then 1 sip record(for example zoiper free version).