Registration problems [FIXED]

I have * 1.2.9.1 behind port-forwarding NAT. The local IP is 10.10.10.10, the external NAT IP is 11.11.11.11.
sip.conf:

[code][general]
context=default
bindport=5060
bindaddr=0.0.0.0
externip=11.11.11.11
allowguest=no
realm=voip.localdomain.com

[TestExt]
username=TestExt
type=friend
secret=password
host=dynamic
canreinvite=no
regexten=1006
context=internal
qualify=yes
[/code]

I have 2 Cisco ATA 186 adapters, one on my local network, the other in another network with a public IP behind a firewall. The relevant sip.conf entries for both ATAs are identical except the extension, username and regexten. My local ATA always successfully registers with *, but when the remote ATA tries to register, the following line appears in the log:

The remote ATA is configured to use * at 11.11.11.11 (Proxy) with UID=TestExt and PWD=password. 22.22.22.22 is its public address which I can easily access via HTTP.

The weird thing is that the remote ATA successfully registers if I comment out the “secret=password” line in sip.conf. I don’t get it. The only reason I can think of is that I use voip.localdomain.com as the realm and the domain name is meaningful only in our network (defined only in our internal DNS).

Can anybody help me to understand what is going on?

Fixed!

It turns out that ATAs authenticate with Asterisk using Asterisk’s FQDN as the realm. So the ‘Proxy’ setting in ATAs should match your Asterisk’s realm and FQDN.

It seems to me that imposes certain restrictions on how one can pair ATAs with *, but anyway. What works does work.