|
@@ -123,12 +123,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
//结束sip通话
|
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
|
sky_voice_call_timer.stop()
|
|
|
- if (visiting) {
|
|
|
- VideoUtil.handoffVideoCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
|
- } else {
|
|
|
- VoiceUtil.handoffAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
|
- }
|
|
|
- callEnd()
|
|
|
+ callEnd(true)
|
|
|
} else {
|
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
|
VoiceUtil.cancelAudioCall(Constant.DEVICE_ID)
|
|
@@ -141,7 +136,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
RingPlayHelper.stopRingTone()
|
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
|
VoiceUtil.rejectAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
|
- callEnd()
|
|
|
+ callEnd(false)
|
|
|
}
|
|
|
|
|
|
//来电接听
|
|
@@ -219,7 +214,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
private fun cancelCall() {
|
|
|
cancelTimer()
|
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
|
- callEnd()
|
|
|
+ callEnd(false)
|
|
|
}
|
|
|
|
|
|
private fun showCalling(audioOnly: Boolean) {
|
|
@@ -247,7 +242,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
}
|
|
|
|
|
|
//通话结束
|
|
|
- override fun callEnd() {
|
|
|
+ override fun callEnd(handoff: Boolean) {
|
|
|
synchronized(this) {
|
|
|
if (callEnded) {
|
|
|
return
|
|
@@ -259,6 +254,13 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
}
|
|
|
|
|
|
Log.e(TAG, "call end !!!!!!!!!!!!!!!!!!")
|
|
|
+ if (handoff) {
|
|
|
+ if (visiting) {
|
|
|
+ VideoUtil.handoffVideoCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
|
+ } else {
|
|
|
+ VoiceUtil.handoffAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (janusClient!!.webSocketChannel != null) {
|
|
|
janusClient!!.callState = EnumType.CallState.Idle
|
|
@@ -310,7 +312,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
Log.w(TAG, "didDisconnected: $userId")
|
|
|
handler.post {
|
|
|
showMessage("$userId 失去连接")
|
|
|
- callEnd()
|
|
|
+ callEnd(true)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -323,14 +325,14 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
Log.e(TAG, "didError: $error")
|
|
|
handler.post {
|
|
|
showMessage("通话错误")
|
|
|
- callEnd()
|
|
|
+ callEnd(true)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
override fun didHangUp(handlerId: BigInteger) {
|
|
|
Log.e("hangup", "socket hangup")
|
|
|
handler.post {
|
|
|
- callEnd()
|
|
|
+ callEnd(true)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -341,7 +343,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
|
|
|
override fun didCallEndWithReason(var1: EnumType.CallEndReason?) {
|
|
|
handler.post {
|
|
|
- callEnd()
|
|
|
+ callEnd(true)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -352,7 +354,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
override fun didUserLeave(userId: BigInteger?) {
|
|
|
Log.w(TAG, "didUserLeave:"+userId)
|
|
|
handler.post {
|
|
|
- callEnd()
|
|
|
+ callEnd(true)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -384,8 +386,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
//通话失败,重置并返回主界面
|
|
|
showMessage("targetSipId为空!")
|
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
|
- VoiceUtil.handoffAudioCall(Constant.DEVICE_ID, fromId, Constant.interactionId)
|
|
|
- callEnd()
|
|
|
+ callEnd(true)
|
|
|
}
|
|
|
} else if (curTcpModel.getAction() == TcpAction.VoiceAction.REJECT) {
|
|
|
//我方呼出,对方拒绝
|
|
@@ -451,13 +452,12 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
janusClient!!.connect()
|
|
|
} else if (serialAction.equals("handoff")) {
|
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
|
- VoiceUtil.handoffAudioCall(Constant.DEVICE_ID, fromId, Constant.interactionId)
|
|
|
- callEnd()
|
|
|
+ callEnd(true)
|
|
|
} else if (serialAction.equals("reject")) {
|
|
|
RingPlayHelper.stopRingTone()
|
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
|
VoiceUtil.rejectAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
|
- callEnd()
|
|
|
+ callEnd(false)
|
|
|
}
|
|
|
}
|
|
|
}
|