[pjsip] TLS connect port issue with TURN server on a client outside of firewall

Paul Dorosh pdorosh at compunetix.com
Fri Oct 18 16:36:47 EDT 2013


I'm new to PJSIP, and I'm trying to make a small Windows application (a SIP phone client) work with our TURN server using TLS sockets outside of a firewall.  Inside our company's firewall, everything is working fine.  The application successfully connects the socket and receives replies from the target PC with no issues.  However, the app cannot see the target responses when it's run outside of the firewall (like, on my home PC).

I can see that every time I initially connect my socket over the TLS default port 5061, the TURN server always requests a different port to be used for the target responses.  Even if I modify the contact header to include that port, I still get no responses from the target.  Using wireshark, I was able to confirm that target responses do arrive at my client PC on that port that TURN server requested, but my app simply doesn't see them, as if it's still listening on another port.

So, my question is how do I switch the TLS connect port on my app from the default (5061) to the port requested by the TURN server?  In the sip_transport_tls.c, I tried modifying the lis_create_transport() function's tls->base.local_name, tls->base.local_addr, listener->bound_addr, listener->factory.local_addr, and listener->factory.addr_name, but nothing worked so far.  I also tried closing the default socket and creating a new one (also in the lis_create_transport() function), but that didn't work either.  I know I probably shouldn't mess with that low level of the PJSIP code, but I'm not sure what else to do at this point.

Thanks in advance for your help,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20131018/d5d60bf6/attachment-0001.html>

More information about the pjsip mailing list