From 14b2c92346f035dfa71f4144239903fdc30d563a Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 10 Feb 2016 17:01:19 +0100 Subject: [PATCH] CallStats: display encryption properly --- Classes/CallSideMenuView.m | 16 +++++++++++++++- Classes/CallSideMenuView.xib | 4 ++-- Classes/LinphoneUI/UICompositeView.m | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Classes/CallSideMenuView.m b/Classes/CallSideMenuView.m index b61cd3099..da0cac541 100644 --- a/Classes/CallSideMenuView.m +++ b/Classes/CallSideMenuView.m @@ -68,6 +68,20 @@ } } ++ (NSString *)mediaEncryptionToString:(LinphoneMediaEncryption)enc { + switch (enc) { + case LinphoneMediaEncryptionDTLS: + return @"DTLS"; + case LinphoneMediaEncryptionSRTP: + return @"SRTP"; + case LinphoneMediaEncryptionZRTP: + return @"ZRTP"; + case LinphoneMediaEncryptionNone: + break; + } + return NSLocalizedString(@"None", nil); +} + - (NSString *)updateStatsForCall:(LinphoneCall *)call stream:(LinphoneStreamType)stream { NSMutableString *result = [[NSMutableString alloc] init]; const PayloadType *payload = NULL; @@ -161,7 +175,7 @@ LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)); if (enc != LinphoneMediaEncryptionNone) { [stats appendString:[NSString - stringWithFormat:@"Call encrypted using %s", linphone_media_encryption_to_string(enc)]]; + stringWithFormat:@"Call encrypted using %@", [self.class mediaEncryptionToString:enc]]]; } [stats appendString:[self updateStatsForCall:call stream:LinphoneStreamTypeAudio]]; diff --git a/Classes/CallSideMenuView.xib b/Classes/CallSideMenuView.xib index 4dc481bcd..a75479d08 100644 --- a/Classes/CallSideMenuView.xib +++ b/Classes/CallSideMenuView.xib @@ -20,9 +20,9 @@ -