You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the gnirehtet app is used to reverse tether over USB, it simulates use of the VPN mechanism. Other apps on the phone have no network issue, such as browsers. But SIPdroid 4.4 beta fails to detect the network. In the profile for a SIP account there is an option to connect over VPN. After enabling that it still fails to connect.
FWIW, the LinPhone project had the same problem 5 years ago:
It seems that by default, USB communication is not anticipated. I had the same issue and implemented the following solution:
As a quick fix, I added the following code to the Receiver class, and I was able to establish the call without any issues. First, I added the following function:
public static String getIPAddress(boolean useIPv4) {
try {
List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface intf : interfaces) {
List<InetAddress> addrs = Collections.list(intf.getInetAddresses());
for (InetAddress addr : addrs) {
if (!addr.isLoopbackAddress()) {
String sAddr = addr.getHostAddress();
boolean isIPv4 = sAddr.indexOf(':') < 0;
if (useIPv4) {
if (isIPv4)
return sAddr;
} else {
if (!isIPv4) {
int delim = sAddr.indexOf('%'); // drop ip6 zone suffix
return delim < 0 ? sAddr.toUpperCase() : sAddr.substring(0, delim).toUpperCase();
}
}
}
}
}
} catch (Exception ignored) { } // for now eat exceptions
return "";
}
This function checks for a local network connection and returns the IP address. Then, I added the following code to the end of the isFastGSM function:
if (nt == TelephonyManager.NETWORK_TYPE_EDGE)
return PreferenceManager.getDefaultSharedPreferences(mContext).getBoolean(org.sipdroid.sipua.ui.Settings.PREF_EDGE + (i != 0 ? i : ""), org.sipdroid.sipua.ui.Settings.DEFAULT_EDGE);
// This condition was added by me
if (getIPAddress(true) != "") {
Log.i("ZARE:", "NET ZARE 7 " + true);
on_wlan = true;
return true;
}
return false;
Please note that I checked this condition as the last priority; you may need to adjust its position based on your requirements.
When the gnirehtet app is used to reverse tether over USB, it simulates use of the VPN mechanism. Other apps on the phone have no network issue, such as browsers. But SIPdroid 4.4 beta fails to detect the network. In the profile for a SIP account there is an option to connect over VPN. After enabling that it still fails to connect.
FWIW, the LinPhone project had the same problem 5 years ago:
BelledonneCommunications/linphone-android#709
The text was updated successfully, but these errors were encountered: