2017-08-10 35 views
0

Linphoneコール中に私に電話している番号を検出しようとしています。私は試しましたLinphoneコールから着信番号を取得する

case LinphoneCallConnected: 
      NSLog("callStateChanged: LinphoneCallConnected") 
      NSLog("CALL ID: \(linphone_call_log_get_call_id(linphone_call_get_call_log(linphone_core_get_current_call(lc)))!)") 

しかし、それはnullです。別の方法がありますか?

答えて

0

私のアプリでは、私はlinphoneCorelinphoneCallを、linphone_call_get_remote_addressの後に受け取ります。今あなたはlinphoneAddressからユーザ名linphone_address_get_usernameを抽出できます。ここ

全コード:

- (NSString *)userNameFromCurrentCall { 

    LinphoneCore *lc = [LinphoneManager getLc]; 
    LinphoneCall *currentcall = linphone_core_get_current_call(lc); 

    if (currentcall != NULL) { 
     LinphoneAddress const * addr = linphone_call_get_remote_address(currentcall); 

     if (addr != NULL) { 
      return [NSString stringWithUTF8String:linphone_address_get_username(addr)]; 
     } 
    } 

    return nil; 
} 
関連する問題