|
@@ -601,16 +601,21 @@ class SkyCallFragment: BaseCallFragment(), CallSession.CallSessionCallback {
|
|
|
//分机呼叫主机时,主机打过来了
|
|
|
val tcpModel = messageEvent.message as TcpModel
|
|
|
if (tcpModel.getAction() == TcpAction.VoiceAction.CALL) {
|
|
|
- interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
|
- fromId = tcpModel.fromId
|
|
|
- Constant.fromId = tcpModel.fromId
|
|
|
- Constant.interactionId = interactionVO?.id
|
|
|
- Constant.CALL_STATE = Constant.CALL_CALLING
|
|
|
+ val curInteractionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
|
+ if (interactionVO != null && curInteractionVO.id == interactionVO?.id) {
|
|
|
+ interactionVO = curInteractionVO
|
|
|
+ fromId = tcpModel.fromId
|
|
|
+ Constant.fromId = tcpModel.fromId
|
|
|
+ Constant.interactionId = interactionVO?.id
|
|
|
+ Constant.CALL_STATE = Constant.CALL_CALLING
|
|
|
|
|
|
- RingPlayHelper.stopRingTone()
|
|
|
- VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
|
- acceptCall()
|
|
|
- checkCallSuccess()
|
|
|
+ RingPlayHelper.stopRingTone()
|
|
|
+ VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
|
+ acceptCall()
|
|
|
+ checkCallSuccess()
|
|
|
+ } else {
|
|
|
+ VoiceUtil.inAudioCall(Constant.DEVICE_ID, tcpModel.fromId, curInteractionVO.id)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|