Wrong Password when accessing via external IP

I have a standard Asterisk box running on Ubuntu (latest version of both Asterisk & Ubuntu). SIP is working properly and I can make calls from soft phones within my LAN. I have a static IP Address and have port-forwarded 5060 + 10000/10010 UDP through my router allowing SIP registrations from the WAN.

This seems to work. The CLI shows the connection, but then fails saying that the password is wrong. (which it isn’t). If I remove the ‘secret line’ from sip.conf (i.e. no password) the user can then connect externally to my asterisk box. I suspect the MD5 hash forming the password is including the local IP address of the connecting machine, thus when the incoming IP address doesn’t match, neither does the password…? But I might be miles out.

Any suggestions?

This is the error I get, when I include a password and connect remotely: (static ip & users blanked out)

I’ve had a good delve around the docs and the web - I came across this site - which seemed to suggest a similar problem, but I didn’t understand their solution: forum.voxilla.com/threads/sipura … word.9450/

Thanks folks :smile:

The best solution is to do what Asterisk itself does and configure the user agent so that it knows its external address, and configure the router not to touch anything above the IP level. That is what the STUN server setting is about.

Thanks for your reply, I’ve read the docs and I’m not sure how to go about doing this, can you point me in the right direction?

Not without details of the soft phone and the router at the remote site (even then, personally, I probably won’t know enough about the router).

OK - I understand, thanks anyway.

I’ll look into the docs, I’m assuming that if the router is letting through the packets and I can see the result on the Asterisk CLI then I can be assured that the router config is correct and that my issue is with Asterisk configuration?

I’ll read up on STUN :smile:

You can’t assume the router is OK. It sounds as though the router is rewriting the addresses in the SIP headers.

Good point - I’ve changed the system to run on a domain name rather than IP address. This now seems to be working properly. Well in the sense that it connects and I can call people… however the calls are silent. I will now look into this next issue! Thanks for your help.

Did you ever get this figured out? I’m crawling all over the Internet trying to find a solution. I am having the same issue with my external SIP devices. They register fine internally, but once I take the device off the internal network, I get the registration Failed/Wrong Password error in CLI.

How did you go about getting the system to run on a domain name? I saw some stuff on that too. Something about adding “autodomain” to sip.conf. Was that the final answer to your problem?? Thanks in advance for you help!

FYI I’m running Asterisk 1.8/Freepbx 2.10. I’m testing the external SIP functionality with an iPad softphone from Bria. My internal phones are Aastra 57i.