0

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?

Hieu Doan
  • 5
  • 4

2 Answers2

0

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.

Vladimir Ralev
  • 1,371
  • 9
  • 18
  • Thanks Vladimir, do you know any example for using STUN/STUN4j/TURN/ICE ? BTW, we're using kamalio for SIP server. – Hieu Doan Sep 16 '15 at 10:13
  • One thing, I run this code behind ethernet(same data package). Then it works !? – Hieu Doan Sep 16 '15 at 10:37
  • Kamailio can be configured to work out your NAT issues, but you have to read the docs about NAT in kamailio. STUN and TURN are complicated and they are more about the follow up problem you may encounter later on with RTP and SDP, so don't think about that yet. You can check the jitsi phone as a full blown example with STUN and TURN and ICE support in Java. – Vladimir Ralev Sep 16 '15 at 11:50
  • Thanks, your answer and comment help me alot :) I will try with jitsi phone first. – Hieu Doan Sep 16 '15 at 14:23
0

Its not a peivate/public IP issue. As far as your SIP server hosted in a public IP (which is very normal), it does not matter your client in private IP or not.

Look at your SIP message. You are providing SIP server your private IP.

Call-ID: 56866e2b305987eac0d6e8bee07c6f69@192.168.56.1

Just change the IP address with your public IP. If you do not know your external IP then you need to learn how to get that.

Sohag Mony
  • 597
  • 2
  • 8
  • 16
  • The Call-ID is just a unique identifier: a local IP is fully correct. The [@host] part of Call-ID header is even optional. – AymericM Oct 02 '15 at 12:59