network: reregister proxy configs in case of wifi change

This commit is contained in:
Gautier Pelloux-Prayer 2016-05-10 11:16:24 +02:00
parent 6798dd0bda
commit ad6857399b
2 changed files with 5 additions and 2 deletions

View file

@ -28,6 +28,7 @@ consider inputs to be phone numbers, otherwise SIP addresses.
- Automatically start call when answering from within notification in iOS9+ - Automatically start call when answering from within notification in iOS9+
- Contact details view is now scrollable to fix issue on small screens - Contact details view is now scrollable to fix issue on small screens
- Unregister accounts in case of application shutdown when remote push notifications are not enabled - Unregister accounts in case of application shutdown when remote push notifications are not enabled
- Reregister accounts in case of WiFi change
## [3.12.1] - 2016-02-19 ## [3.12.1] - 2016-02-19

View file

@ -1226,7 +1226,9 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
// else keep default value from linphonecore // else keep default value from linphonecore
} }
if (lm.connectivity != newConnectivity) { // in case of wifi change (newconnectivity == lm.connectivity == wifi), we must
// reregister because we are using a different router anyway
if (lm.connectivity != newConnectivity || newConnectivity != wwan) {
// connectivity has changed // connectivity has changed
linphone_core_set_network_reachable(theLinphoneCore, false); linphone_core_set_network_reachable(theLinphoneCore, false);
if (newConnectivity == wwan && proxy && isWifiOnly) { if (newConnectivity == wwan && proxy && isWifiOnly) {
@ -1235,8 +1237,8 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
linphone_core_set_network_reachable(theLinphoneCore, true); linphone_core_set_network_reachable(theLinphoneCore, true);
linphone_core_iterate(theLinphoneCore); linphone_core_iterate(theLinphoneCore);
LOGI(@"Network connectivity changed to type [%s]", (newConnectivity == wifi ? "wifi" : "wwan")); LOGI(@"Network connectivity changed to type [%s]", (newConnectivity == wifi ? "wifi" : "wwan"));
lm.connectivity = newConnectivity;
} }
lm.connectivity = newConnectivity;
} }
if (ctx && ctx->networkStateChanged) { if (ctx && ctx->networkStateChanged) {
(*ctx->networkStateChanged)(lm.connectivity); (*ctx->networkStateChanged)(lm.connectivity);