[asterisk-dev] sIP & NAT issues

Dmitry Andrianov dimas at dataart.com
Fri Mar 19 10:57:14 CDT 2010


Hello.
After some playing with my first client behind NAT it seems to me that NAT support in Asterisk is somewhat broken. At least when nat= RFC3581.
If I understand the code properly, the idea was that in order to detect NAT we are checking for the presence of rport in incoming packets and if it is present, we are sort of switching to nat=route.

The problem is that Asterisk still replies packets to the address from Contact header even if there is ;rport so  these replies never get to the phone behind NAT. I originally filled the issue for that: https://issues.asterisk.org/view.php?id=13823 The issue was later resolved but it seems that it is still not fixed and testing shows there are more problems (below). Unfortunately it looks to me that you guys at Digium do not run any tests with phones being behind NAT and nat=RFC. (I think so because even simple REGISTER test should fail according to what I saw).

I tied fixing the code myself but only partially succeeded. It required a person with really good understanding of what is going on in chan_sip to do the proper fix. This is because these NAT related things are spread all over across the code and Ib m not really sure what causes what.

So what kind of use cases/problems I saw:
ÿóÿýauthentication requiredb Setting nat=yes seems to fix the issue but my understanding is that everything should work with RFC3581 too. Otherwise I do not understand purpose for this mode at all.

Again, could someone with good understanding of SIP channel architecture do a real test with NAT please? I believe you will see everything yourself and wonb t need any further explanation.

Thanks.



More information about the asterisk-dev mailing list