Iphone 从Linphone呼叫中获取传入号码
我正在尝试检测在Linphone通话中呼叫我的号码。我试过了Iphone 从Linphone呼叫中获取传入号码,iphone,swift,voip,linphone,incoming-call,Iphone,Swift,Voip,Linphone,Incoming Call,我正在尝试检测在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)))!)") 但
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)))!)")
但这是无效的。还有其他方法吗?在我的应用程序中,我使用
linphoneCore
和linphoneCall
以及通话后linphone\u call\u获取远程地址。现在您有了linphoneAddress
,您可以从中提取用户名linphone\u address\u get\u 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;
}
SString*)用户名fromCurrentCall{
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;