LinphoneManager: replace space in user agent if needed

This commit is contained in:
Gautier Pelloux-Prayer 2016-02-10 17:02:35 +01:00
parent 14b2c92346
commit 7fb175bd12

View file

@ -1312,11 +1312,13 @@ static LinphoneCoreVTable linphonec_vtable = {
NSString *zrtpSecretsFileName = [LinphoneManager documentFile:@"zrtp_secrets"]; NSString *zrtpSecretsFileName = [LinphoneManager documentFile:@"zrtp_secrets"];
NSString *chatDBFileName = [LinphoneManager documentFile:kLinphoneInternalChatDBFilename]; NSString *chatDBFileName = [LinphoneManager documentFile:kLinphoneInternalChatDBFilename];
NSString *device = [[NSString NSMutableString *device = [[NSMutableString alloc]
stringWithFormat:@"%@_%@_iOS%@", [NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"], initWithString:[NSString
[LinphoneUtils deviceName], UIDevice.currentDevice.systemVersion] stringWithFormat:@"%@_%@_iOS%@",
stringByReplacingOccurrencesOfString:@"," [NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"],
withString:@"."]; [LinphoneUtils deviceName], UIDevice.currentDevice.systemVersion]];
[device stringByReplacingOccurrencesOfString:@"," withString:@"."];
[device stringByReplacingOccurrencesOfString:@" " withString:@"."];
linphone_core_set_user_agent(theLinphoneCore, device.UTF8String, LINPHONE_IOS_VERSION); linphone_core_set_user_agent(theLinphoneCore, device.UTF8String, LINPHONE_IOS_VERSION);
_contactSipField = [self lpConfigStringForKey:@"contact_im_type_value" withDefault:@"SIP"]; _contactSipField = [self lpConfigStringForKey:@"contact_im_type_value" withDefault:@"SIP"];