Use proper port when switching transport for sip.linphone.org domain: use 5223 for TLS, and none for UDP/TCP. It solves the registration issue when changing the transport to TCP/UDP after the wizard which has forced the port to 5223 for data networks limitation

This commit is contained in:
Gautier Pelloux-Prayer 2014-12-09 15:13:13 +01:00
parent 04fa920bec
commit 3c7f18a956
2 changed files with 11 additions and 2 deletions

View file

@ -349,13 +349,22 @@ public class LinphonePreferences {
LinphoneAddress proxyAddr;
try {
proxyAddr = LinphoneCoreFactory.instance().createLinphoneAddress(proxyConfig.getProxy());
int port = 0;
if (transport.equals(getString(R.string.pref_transport_udp_key))) {
proxyAddr.setTransport(TransportType.LinphoneTransportUdp);
} else if (transport.equals(getString(R.string.pref_transport_tcp_key))) {
proxyAddr.setTransport(TransportType.LinphoneTransportTcp);
} else if (transport.equals(getString(R.string.pref_transport_tls_key))) {
proxyAddr.setTransport(TransportType.LinphoneTransportTls);
port = 5223;
}
/* 3G mobile firewall might block random TLS port, so we force use of 5223.
* However we must NOT use this port when changing to TCP/UDP because otherwise
* REGISTER (and everything actually) will fail...
* */
if ("sip.linphone.org".equals(proxyConfig.getDomain())) {
proxyAddr.setPort(port);
}
LinphoneProxyConfig prxCfg = getProxyConfig(n);

@ -1 +1 @@
Subproject commit 273207b25c2087d665f45f3793c625dc5bf83545
Subproject commit 4ebc9c85b954fd0e993a3f7e8890ae190fd8a79e