2016-09-19 13 views
0

私は最近AppleのIPV6標準サポートに従うように最新のリリースからLinphoneライブラリを更新しました。 しかし、安全な呼び出しを作成できません。 セキュリティで保護されたコールにコールを変換しようとするたびに、肯定応答が失敗し、SASがnullを返します。 古いライブラリ(IPV4サポート)と同じことが働いています。 私は安全な呼び出しのためにZRTP暗号化を使用しています。LinphoneがZRTPセキュアコールのためにSASを作成できません

私は過去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; 
        }]; 
      } 
     } 
    } 
    } 
} 

助けが必要です。

ありがとうございました。

+0

ちょっと!あなたはその問題が何かを知りましたか?私は同じ問題を抱えています。 –

答えて

0

私は何が問題だったかを考え出しました。たぶんあなたにとっても役に立つかもしれません。

コール状態がLinphoneCallOutgoingProgressに変更された直後に私はlinphone_call_get_authentication_tokenに電話をかけていました。それを修正するために私がしなければならなかったのは、コール状態がLinphoneCallOutgoingProgressに変わったときに、1秒ごとにメソッドを呼び出すTimerを開始することでした。ここに私のために働いた:

timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { 

    DispatchQueue.main.async { 

     let sas = linphone_call_get_authentication_token(Call.current()) 

     if sas != nil { 

      self!.sasLabel.text = String(cString: sas!) 
      timer.invalidate() 
     } 
    } 
} 
関連する問題