diff --git a/CHANGELOG.md b/CHANGELOG.md index 478b696bf..f5522a644 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ consider inputs to be phone numbers, otherwise SIP addresses. - Automatically start call when answering from within notification in iOS9+ - 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 +- Reregister accounts in case of WiFi change ## [3.12.1] - 2016-02-19 diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index ed55c602e..5d5a539f3 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1226,7 +1226,9 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach // 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 linphone_core_set_network_reachable(theLinphoneCore, false); if (newConnectivity == wwan && proxy && isWifiOnly) { @@ -1235,8 +1237,8 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach linphone_core_set_network_reachable(theLinphoneCore, true); linphone_core_iterate(theLinphoneCore); LOGI(@"Network connectivity changed to type [%s]", (newConnectivity == wifi ? "wifi" : "wwan")); + lm.connectivity = newConnectivity; } - lm.connectivity = newConnectivity; } if (ctx && ctx->networkStateChanged) { (*ctx->networkStateChanged)(lm.connectivity);