我正在尝试检测在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)))!)")
但是这是空的。还有另一种方式吗?
答案 0 :(得分:1)
在我的应用中,我linphoneCore
和linphoneCall
以及通话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;
}
答案 1 :(得分:0)
SString *)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;