Fix 3 bugs:

- Failure to REGISTER over UDP when the SIP server has both IPv6 and IPv4 addresses and the network has no IPv6
- Bad handling of wifi network change causing very frequent network disconnections (useless calls to linphone_core_set_network_reachable(lc,FALSE) )
- Fix crash while exiting from settings, due to video_port_range being erroneously created and later accessed.
This commit is contained in:
Simon Morlat 2016-11-17 22:38:52 +01:00
parent c25f21c8db
commit 86686a0ead
4 changed files with 14 additions and 9 deletions

View file

@ -352,7 +352,7 @@
if (minPort != maxPort)
[self setObject:[NSString stringWithFormat:@"%d-%d", minPort, maxPort] forKey:@"video_port_preference"];
else
[self setInteger:minPort forKey:@"video_port_preference"];
[self setObject:[NSString stringWithFormat:@"%d", minPort] forKey:@"video_port_preference"];
}
[self setBool:linphone_core_ipv6_enabled(LC) forKey:@"use_ipv6"];
LinphoneMediaEncryption menc = linphone_core_get_media_encryption(LC);

View file

@ -1409,6 +1409,7 @@ static void showNetworkFlags(SCNetworkReachabilityFlags flags) {
LOGI(@"%@", log);
}
//This callback keeps tracks of wifi SSID changes.
static void networkReachabilityNotification(CFNotificationCenterRef center, void *observer, CFStringRef name,
const void *object, CFDictionaryRef userInfo) {
LinphoneManager *mgr = LinphoneManager.instance;
@ -1420,11 +1421,17 @@ static void networkReachabilityNotification(CFNotificationCenterRef center, void
if ([newSSID compare:mgr.SSID] == NSOrderedSame)
return;
if (newSSID != Nil && newSSID.length > 0 && mgr.SSID != Nil && newSSID.length > 0){
if (SCNetworkReachabilityGetFlags([mgr getProxyReachability], &flags)) {
LOGI(@"Wifi SSID changed, resesting transports.");
mgr.connectivity=none; //this will trigger a connectivity change in networkReachabilityCallback.
networkReachabilityCallBack([mgr getProxyReachability], flags, nil);
}
}
mgr.SSID = newSSID;
if (SCNetworkReachabilityGetFlags([mgr getProxyReachability], &flags)) {
networkReachabilityCallBack([mgr getProxyReachability], flags, nil);
}
}
void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void *nilCtx) {
@ -1460,9 +1467,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
// else keep default value from linphonecore
}
// 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) {
if (lm.connectivity != newConnectivity) {
// connectivity has changed
linphone_core_set_network_reachable(theLinphoneCore, false);
if (newConnectivity == wwan && proxy && isWifiOnly) {

@ -1 +1 @@
Subproject commit d0c166650a4a39aaae1d5bc17b5ae64639982930
Subproject commit 7f951f6d3d25b328de9fb006fbdc43a1463ad8ea

@ -1 +1 @@
Subproject commit 8e6e00bb9b080275726384881aae194c39933f93
Subproject commit 4da1c5ea4db5634beeb92ff7300e160446a594e5