Benny Prijono schrieb: > On 3/19/08, Sasa Coh <sasacoh at gmail.com> wrote: >> Hello! >> >> Yes, it should be error in UAS. Thanks Klaus! >> >> Now I have another case: >> While testing pjSIP's behavior using TCP transport with pjsua, I've >> encountered another strange situation. If I use STUN server and UDP >> transport, pjsua sends (as I expected) message SIP REGISTER with correct, >> STUN resolved addresses in fields "via" and "contact". >> On the other hand, if I switch to TCP transport (and use the same STUN >> server) than pjsua sends message SIP REGISTER with "wrong - IMO" IP >> addresses (my local-private) in "via" and "contact" fields and not like I >> would expect with STUN resolved addresses. See log below... > > Yep that's intentional. STUN, as it stands for, applies only to UDP > transports. For TCP/TLS transport, the only way to get around NAT is > to use SIP outbound draft, which I plan to implement in the next few > weeks. There is also another approach (e.g. which is used by eyebeam/xlite). It sends a REGISTER with private IPs. In the response it evaluates the Via header and gets the public Ip:port from received and rport parameter. Then it deREGISTERs the public contact and reREGISTERs using the learnt IP address:port. regards klaus