javasipjain-sip

SIP signal with public wifi?


I had an issue with Jain SIP. My application is used to make a VOIP call. It work well with ethernet, but it is fail in public Wifi.

Below is package that I sent to login to SIP server. It seems server does not response any data(It works on ethenet)

REGISTER sip:sip.linphone.org:5060 SIP/2.0
Call-ID: 56866e2b305987eac0d6e8bee07c6f69@192.168.56.1
CSeq: 1 REGISTER
From: "myaccount" <sip:myaccount@sip.linphone.org>;tag=647554
To: "myaccount" <sip:myaccount@sip.linphone.org>
Via: SIP/2.0/UDP 192.168.56.1:5075;branch=z9hG4bK-333032-33f14b15adbdc0cd848ccd102acb2b45
Max-Forwards: 70
Contact: <sip:192.168.56.1:5075>
Expires: 60000
Content-Length: 0

Does anyone have any ideas?


Solution

  • This is most likely a NAT/firewall issue. First of all check the DNS if sip.linphone.org resolves properly on your Wifi. Second you are behind NAT and are advertising a private IP 192.168.56.1 so the remote side has to be capable of finding your public IP which is not always possible. You will want to look into STUN and STUN4j (and then TURN and ICE if that is not enough) to find your own public IP and port, linphone already host a stun server at stun.linphone.org to help you. NAT traversal can be quite complicated. If you have a public IP and port just put the public IP instead and it will work.

    Another thing is you are not sending any SDP here so SDP is probably irrelevant. But if you have SDP later on and RTP, then you may have to look into TURN and ICE to put in the SDP and relay RTP through a third party. It depends on the remote side what is supported and it depends on your NAT configuration. Sometimes the remote servers will work just fine the way you send REGISTER now, but sometimes they need a lot of extra things or they might not work at all.