|
@@ -83,6 +83,7 @@ class WebRTCVoipAudioActivity : Activity(), View.OnClickListener, CallSessionCal
|
|
|
targetId = intent.getStringExtra("targetId")
|
|
|
Log.i(TAG, "SIP账号$targetId")
|
|
|
tcpModel = intent.getSerializableExtra("TcpModel") as TcpModel
|
|
|
+ DeviceChannel.callId = if (tcpModel.toId==Constants.deviceId) tcpModel.fromId else tcpModel.toId
|
|
|
action = intent.getStringExtra(ACTION)
|
|
|
|
|
|
Log.i(TAG, "tcpModel " + tcpModel.toJson())
|
|
@@ -175,7 +176,8 @@ class WebRTCVoipAudioActivity : Activity(), View.OnClickListener, CallSessionCal
|
|
|
|
|
|
gEngineKit?.endCall()
|
|
|
val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
|
- val voiceUtilTcpModel = VoiceUtil.voiceHandoff(Constants.deviceId, tcpModel.toId, interactionVO.id)
|
|
|
+ var toId = if (interactionVO.fromDeviceId.equals(Constants.deviceId)) interactionVO.toDeviceId else interactionVO.fromDeviceId
|
|
|
+ val voiceUtilTcpModel = VoiceUtil.voiceHandoff(Constants.deviceId, toId, interactionVO.id)
|
|
|
NettyClient.instance.sendMsg(voiceUtilTcpModel.toJson()).subscribe {
|
|
|
if (it) {
|
|
|
Log.d(TAG, "TCP.发送消息完成")
|
|
@@ -267,7 +269,8 @@ class WebRTCVoipAudioActivity : Activity(), View.OnClickListener, CallSessionCal
|
|
|
//给服务器发送挂断 tcp
|
|
|
if (tcpModel.type == TcpType.VOICE) {
|
|
|
if (tcpModel.action === TcpAction.VoiceAction.SUCCESS) {
|
|
|
- val voiceUtilTcpModel = VoiceUtil.voiceHandoff(Constants.deviceId, interactionVO.toDeviceId, interactionVO.id)
|
|
|
+ var toId = if (interactionVO.fromDeviceId.equals(Constants.deviceId)) interactionVO.toDeviceId else interactionVO.fromDeviceId
|
|
|
+ val voiceUtilTcpModel = VoiceUtil.voiceHandoff(Constants.deviceId, toId, interactionVO.id)
|
|
|
NettyClient.instance.sendMsg(voiceUtilTcpModel.toJson()).subscribe {
|
|
|
if (it) {
|
|
|
Log.d(TAG, "TCP.发送消息完成")
|
|
@@ -277,7 +280,8 @@ class WebRTCVoipAudioActivity : Activity(), View.OnClickListener, CallSessionCal
|
|
|
}
|
|
|
}
|
|
|
} else if (tcpModel.action === TcpAction.VoiceAction.CALL) {
|
|
|
- val voiceUtilTcpModel = VoiceUtil.voiceHandoff(Constants.deviceId, tcpModel.fromId, interactionVO.id)
|
|
|
+ var toId = if (interactionVO.fromDeviceId.equals(Constants.deviceId)) interactionVO.toDeviceId else interactionVO.fromDeviceId
|
|
|
+ val voiceUtilTcpModel = VoiceUtil.voiceHandoff(Constants.deviceId, toId, interactionVO.id)
|
|
|
NettyClient.instance.sendMsg(voiceUtilTcpModel.toJson()).subscribe {
|
|
|
if (it) {
|
|
|
Log.d(TAG, "TCP.发送消息完成")
|
|
@@ -419,6 +423,7 @@ class WebRTCVoipAudioActivity : Activity(), View.OnClickListener, CallSessionCal
|
|
|
override fun onDestroy() {
|
|
|
super.onDestroy()
|
|
|
DeviceChannel.calling = false
|
|
|
+ DeviceChannel.callId = 0
|
|
|
if(countDownTimer != null){
|
|
|
countDownTimer.cancel()
|
|
|
}
|