sendAnswerMsg method

void sendAnswerMsg(
  1. String remoteUserId,
  2. String callId,
  3. String result,
  4. String devId,
)

Implementation

void sendAnswerMsg(
    String remoteUserId, String callId, String result, String devId) async {
  ChatMessage msg = ChatMessage.createCmdSendMessage(
      targetId: remoteUserId, action: "rtcCall");
  Map attributes = {
    kMsgType: kMsgTypeValue,
    kAction: kAnswerCallAction,
    kCallId: callId,
    kCalleeDevId: model.curDevId,
    kCallerDevId: devId,
    kCallResult: result,
    kTs: ts,
  };

  msg.attributes = attributes;
  ChatClient.getInstance.chatManager.sendMessage(msg);
  confirmTimer = Timer.periodic(const Duration(seconds: 5), (timer) {
    timer.cancel();
    confirmTimer = null;
  });

  chatLog("sendAnswerMsg", msg);
}