mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
User agent: use device name and version as user agent
This commit is contained in:
parent
59ad155cb7
commit
924ea29282
3 changed files with 13 additions and 4 deletions
|
|
@ -1293,10 +1293,10 @@ static LinphoneCoreVTable linphonec_vtable = {.show = NULL,
|
|||
const char *lRootCa =
|
||||
[[LinphoneManager bundleFile:@"rootca.pem"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||
|
||||
linphone_core_set_user_agent(theLinphoneCore,
|
||||
[[[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]
|
||||
stringByAppendingString:@"Iphone"] UTF8String],
|
||||
LINPHONE_IOS_VERSION);
|
||||
NSString *device = [NSString
|
||||
stringWithFormat:@"%@_%@_iOS%@", [NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"],
|
||||
[LinphoneUtils deviceName], UIDevice.currentDevice.systemVersion];
|
||||
linphone_core_set_user_agent(theLinphoneCore, device.UTF8String, LINPHONE_IOS_VERSION);
|
||||
|
||||
_contactSipField = [self lpConfigStringForKey:@"contact_im_type_value" withDefault:@"SIP"];
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
+ (void)buttonFixStatesForTabs:(UIButton*)button;
|
||||
+ (void)buttonMultiViewAddAttributes:(NSMutableDictionary*)attributes button:(UIButton*)button;
|
||||
+ (void)buttonMultiViewApplyAttributes:(NSDictionary*)attributes button:(UIButton*)button;
|
||||
+ (NSString *)deviceName;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#import "Utils.h"
|
||||
#include "linphone/linphonecore.h"
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
#import <sys/utsname.h>
|
||||
|
||||
@implementation LinphoneLogger
|
||||
|
||||
|
|
@ -298,6 +299,13 @@ void linphone_iphone_log_handler(int lev, const char *fmt, va_list args) {
|
|||
return nil;
|
||||
}
|
||||
|
||||
+ (NSString *)deviceName {
|
||||
struct utsname systemInfo;
|
||||
uname(&systemInfo);
|
||||
|
||||
return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSNumber (HumanReadableSize)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue