Java – jain sip How to connect to WiFi in android

jain sip How to connect to WiFi in android… here is a solution to the problem.

jain sip How to connect to WiFi in android

I’m developing a softphone using Jain SIP and it’s nearing completion, but I have the following issues:
I’m using restcomm-android-sdk in android-jain-sip-ri-1.2.233.jar
The question is
Suppose the two customers are customer A and customer B

  1. If client A and client B are using 3G/4G, then everything is fine because they can both call each other and can speak to each other

  2. If client A uses

  3. a 3G/4G network and client B uses public WiFi, the two can call each other, but only client A can hear Client B , and Client B cannot hear anything.

I think it’s something related to routing and NAT.
This is my android list

<uses-permission android:name="android.permission.USE_SIP" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-feature android:name="android.hardware.telephony" android:required="true"/>
<uses-feature android:name="android.hardware.sip.voip" android:required="true" />
<uses-feature android:name="android.hardware.wifi" android:required="true" />
<uses-feature android:name="android.hardware.microphone" android:required="true" />

Can anyone help with this?

Solution

NAT may be too restrictive in the public WiFi you use.
Have you tried non-public wifi?
Which SIP server do you use? Do you use RestComm as a server?

To ensure that a network capture is required, also known as a wireshark trace (on the client side – you can try https://play.google.com/store/apps/details?id=lv.n3o.shark&hl=fr, you can also try it on the server side).

If so (NAT is too restrictive, STUN and TURN will need to be implemented on Android clients, planned on the roadmap). If you use RestComm, another option is to create a session application and have two clients call the session application to see if that helps.

Have you tried using two clients on different public WiFi networks?

Related Problems and Solutions