|
@@ -117,10 +117,11 @@ class SkyCallFragment: BaseCallFragment(), CallSession.CallSessionCallback {
|
|
|
|
|
|
//来电接听
|
|
//来电接听
|
|
sky_voice_call_ring_pickup_audio.setOnClickListener {
|
|
sky_voice_call_ring_pickup_audio.setOnClickListener {
|
|
- acceptCall()
|
|
|
|
RingPlayHelper.stopRingTone()
|
|
RingPlayHelper.stopRingTone()
|
|
Constant.CALL_STATE = Constant.CALL_INCOMING
|
|
Constant.CALL_STATE = Constant.CALL_INCOMING
|
|
VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
|
|
+ acceptCall()
|
|
|
|
+ checkCallSuccess()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -195,6 +196,22 @@ class SkyCallFragment: BaseCallFragment(), CallSession.CallSessionCallback {
|
|
backToMain()
|
|
backToMain()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //分机接听后检查通话是否正常连接上
|
|
|
|
+ private fun checkCallSuccess() {
|
|
|
|
+ //3s还未连接上则判定为通话失败
|
|
|
|
+ Handler().postDelayed({
|
|
|
|
+ val session = gEngineKit!!.currentSession
|
|
|
|
+ if (session != null && session.state == EnumType.CallState.Connected) {
|
|
|
|
+ //连接通话成功
|
|
|
|
+ } else {
|
|
|
|
+ if (!callEnded) {
|
|
|
|
+ showMessage("通话连接失败,通话结束")
|
|
|
|
+ callEnd()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }, 3000)
|
|
|
|
+ }
|
|
|
|
+
|
|
//语音接通
|
|
//语音接通
|
|
private fun joinAudioCall() {
|
|
private fun joinAudioCall() {
|
|
val session = gEngineKit?.getCurrentSession()
|
|
val session = gEngineKit?.getCurrentSession()
|
|
@@ -593,6 +610,7 @@ class SkyCallFragment: BaseCallFragment(), CallSession.CallSessionCallback {
|
|
RingPlayHelper.stopRingTone()
|
|
RingPlayHelper.stopRingTone()
|
|
VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
acceptCall()
|
|
acceptCall()
|
|
|
|
+ checkCallSuccess()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -610,6 +628,7 @@ class SkyCallFragment: BaseCallFragment(), CallSession.CallSessionCallback {
|
|
Constant.CALL_STATE = Constant.CALL_CALLING
|
|
Constant.CALL_STATE = Constant.CALL_CALLING
|
|
VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
|
|
acceptCall()
|
|
acceptCall()
|
|
|
|
+ checkCallSuccess()
|
|
} else if (serialAction.equals("handoff")) {
|
|
} else if (serialAction.equals("handoff")) {
|
|
gEngineKit?.endCall()
|
|
gEngineKit?.endCall()
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|