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 *chatDBFileName = [LinphoneManager documentFile:kLinphoneInternalChatDBFilename];
NSString *device = [[NSString
stringWithFormat:@"%@_%@_iOS%@", [NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"],
[LinphoneUtils deviceName], UIDevice.currentDevice.systemVersion]
stringByReplacingOccurrencesOfString:@","
withString:@"."];
NSMutableString *device = [[NSMutableString alloc]
initWithString:[NSString
stringWithFormat:@"%@_%@_iOS%@",
[NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"],
[LinphoneUtils deviceName], UIDevice.currentDevice.systemVersion]];
[device stringByReplacingOccurrencesOfString:@"," withString:@"."];
[device stringByReplacingOccurrencesOfString:@" " withString:@"."];
linphone_core_set_user_agent(theLinphoneCore, device.UTF8String, LINPHONE_IOS_VERSION);
_contactSipField = [self lpConfigStringForKey:@"contact_im_type_value" withDefault:@"SIP"];