onReceivedCall

public abstract void onReceivedCall(RCCallPlusSession callSession, String extra)

本端用户通过该回调接收到通话呼叫。

该方法回调场景:

  1. 本端用户没有正在进行中的音视频通话(getCurrentCallSession 获取的对象为空)时,远端用户通过 startCall 、invite 函数邀请本端用户进行通话。
  2. 本端用户正在进行音视频通话(getCurrentCallSession 获取的对象不为空)时,远端用户通过 startCall、invite 函数邀请本端用户进行通话。

如果本端用户需要接听该通话,需要先调用 hangup 方法挂断当前正在进行中的通话。再调用 accept 方法接听。

判断本端是否正在进行通话,又收到第二通呼叫方法:



public void onReceivedCall(RCCallPlusSession callSession) {
    RCCallPlusSession currentCallSession = RCCallPlusClient.getInstance().getCurrentCallSession();
    if (currentCallSession != null && !TextUtils.equals(callSession.getCallId(), currentCallSession.getCallId())) {
        //在此处理有正在进行中的通话,又有第二通通话呼入的情况
        //需要挂断 currentCallSession ,再接听新的通话
    }
}

Parameters

callSession

通话实体信息

extra

接收远端通过startCall 方法携带的扩展参数