【发布时间】:2016-09-19 15:37:58
【问题描述】:
我最近更新了最新版本的 Linphone 库,以遵循 Apple 的 IPV6 标准支持。 但它无法创建安全呼叫。 每次我尝试将呼叫转换为安全呼叫时,确认失败并且 SAS 返回 null。 与旧库(IPV4 支持)一起工作也是如此。 我正在使用 ZRTP 加密进行安全通话。
自过去 15 天以来,我一直在苦苦挣扎。 下面的代码行返回 SAS 值 null。
NSString *localLize = NSLocalizedString(@"Confirm the following SAS with peer:\n%s", nil);
const char *authToken = linphone_call_get_authentication_token(call);
NSLog(@"localize %@ authToken %s",localLize,authToken);
以下是将呼叫转换为安全呼叫的完整功能。
- (IBAction)onSecurityClick:(id)sender {
if (linphone_core_get_calls_nb(LC)) {
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call != NULL) {
//force encryption ZRTP
LinphoneMediaEncryption enc = LinphoneMediaEncryptionZRTP;
if (enc == LinphoneMediaEncryptionZRTP) {
NSString *localLize = NSLocalizedString(@"Confirm the following SAS with peer:\n%s", nil);
const char *authToken = linphone_call_get_authentication_token(call);
NSLog(@"localize %@ authToken %s",localLize,authToken);
NSString *message =
[NSString stringWithFormat:NSLocalizedString(@"Confirm the following SAS with peer:\n%s", nil),
linphone_call_get_authentication_token(call)];
if (securityDialog == nil) {
__block __strong StatusBarView *weakSelf = self;
securityDialog = [UIConfirmationDialog ShowWithMessage:message
cancelMessage:NSLocalizedString(@"DENY", nil)
confirmMessage:NSLocalizedString(@"ACCEPT", nil)
onCancelClick:^() {
if (linphone_core_get_current_call(LC) == call) {
linphone_call_set_authentication_token_verified(call, NO);
}
weakSelf->securityDialog = nil;
}
onConfirmationClick:^() {
if (linphone_core_get_current_call(LC) == call) {
linphone_call_set_authentication_token_verified(call, YES);
}
weakSelf->securityDialog = nil;
}];
}
}
}
}
}
任何帮助都应该是可观的。
提前致谢。
【问题讨论】:
-
嘿!你找出问题所在了吗?我也遇到了同样的问题。
标签: security encryption voip linphone linphone-sdk