Registration issue with correct informations

I am having registration issues with my peers. I have thousands of extensions already setup across my systems but this one in particular is giving me problems.

Peers are in an analog gateway in a remote location and they register to an asterisk server running 1.8.

The peers will not register. If I go in sip.conf and change the peer name form 633 to 644, I will see:
Registration from “sip:633@“hostname”:5060” failed for “IPADD”’ - No matching peer found

So I go back in sip.conf, fix the peername to be 633 to match the analog gateway, reload asterisk, refresh the registration and in the CLI (verbose is at 10) I see nothing pass, the peer does not register.

I did a tcpdump at the same time to see if the packets reach destination. They do, I see the registration attempt, but get denied with a 401 Unauthorized.

Any clues?

401 is not a rejection. The peer should repeat the request with correct credentials, If it doesn’t, it probably means it has no password configured.

Check if the ata has a registration try timeout setting and configure it at 60 sec.