◎위챗 : speedseoul
https://github.com/BelledonneCommunications/liblinphone/blob/59d99bd981afe9d1748bf7d827deb64cca39beb3/coreapi/vtables.c
void linphone_core_notify_call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *message){
L_GET_PRIVATE_FROM_C_OBJECT(lc)->notifyCallStateChanged(call, cstate, message); <<----------------------------- notifyCallStateChanged
NOTIFY_IF_EXIST(call_state_changed, lc,call,cstate,message);
cleanup_dead_vtable_refs(lc);
}
https://github.com/BelledonneCommunications/liblinphone/blob/59d99bd981afe9d1748bf7d827deb64cca39beb3/src/core/core.cpp
void CorePrivate::registerListener (CoreListener *listener) {
listeners.push_back(listener);
}
void CorePrivate::unregisterListener (CoreListener *listener) {
listeners.remove(listener);
}
void CorePrivate::notifyCallStateChanged (LinphoneCall *call, LinphoneCallState state, const string &message) {
auto listenersCopy = listeners; // Allow removal of a listener in its own call
for (const auto &listener : listenersCopy)
listener->onCallStateChanged(call, state, message); <<-------------------- onCallStateChanged
}
https://github.com/BelledonneCommunications/liblinphone/blob/6461d23dd5d9bbb03926ab8935473087f526469a/src/conference/session/call-session.cpp
void CallSessionPrivate::onCallStateChanged (LinphoneCall *call, LinphoneCallState state, const std::string &message) {
this->executePendingActions();
}
onCallStateChanged CallManager.swift
func onCallStateChanged(core: Core, call: Call, state cstate: Call.State, message: String) {
let callLog = call.callLog
let callId = callLog?.callId
if (cstate == .PushIncomingReceived) {
displayIncomingCall(call: call, handle: "Calling", hasVideo: false, callId: callId!, displayName: "Calling") <<--------- displayIncomingCall
displayIncomingCall CallManager.swift
func displayIncomingCall(call:Call?, handle: String, hasVideo: Bool, callId: String, displayName:String) {
let uuid = UUID()
let callInfo = CallInfo.newIncomingCallInfo(callId: callId)
providerDelegate.callInfos.updateValue(callInfo, forKey: uuid)
providerDelegate.uuids.updateValue(uuid, forKey: callId)
providerDelegate.reportIncomingCall(call:call, uuid: uuid, handle: handle, hasVideo: hasVideo, displayName: displayName) <<------ reportIncomingCall
}
https://github.com/BelledonneCommunications/linphone-iphone/blob/524d4299602d886e0ec72270623993a45baa98f6/Classes/Swift/ProviderDelegate.swift
reportIncomingCall
func reportIncomingCall(call:Call?, uuid: UUID, handle: String, hasVideo: Bool, displayName:String) {
let update = CXCallUpdate()
update.remoteHandle = CXHandle(type:.generic, value: handle)
update.hasVideo = hasVideo
update.localizedCallerName = displayName
let callInfo = callInfos[uuid]
let callId = callInfo?.callId
provider.reportNewIncomingCall(with: uuid, update: update) { error in <<----- reportNewIncomingCall <<---------- from system
if error == nil {