Commit 248e4ca9 by 万齐军

Ding改30s,leave加reason

parent 5e9cb2bd
...@@ -283,7 +283,7 @@ class AudioHomeActivity : ...@@ -283,7 +283,7 @@ class AudioHomeActivity :
writeAgoraLog("被叫(专家)拒绝了通话邀请") writeAgoraLog("被叫(专家)拒绝了通话邀请")
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
uploadLog() uploadLog()
leaveChannel() leaveChannel(1)
uploadExceptionStatus("对方已拒绝", 2) uploadExceptionStatus("对方已拒绝", 2)
} }
} }
...@@ -424,7 +424,7 @@ class AudioHomeActivity : ...@@ -424,7 +424,7 @@ class AudioHomeActivity :
RtcEvent(RtcEvent.Event.connectionChanged), RtcEvent(RtcEvent.Event.connectionChanged),
errorCode = state, errorReason = reason.toString() errorCode = state, errorReason = reason.toString()
) )
if (reason == 3) { if (reason == 3) {//网络连接被服务器禁止
callEventSave("50", "通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason}") callEventSave("50", "通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason}")
writeAgoraLog("通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})") writeAgoraLog("通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})")
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
...@@ -435,7 +435,7 @@ class AudioHomeActivity : ...@@ -435,7 +435,7 @@ class AudioHomeActivity :
// com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断") // com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断")
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
uploadLog() uploadLog()
leaveChannel() leaveChannel(2)
} }
} }
...@@ -477,7 +477,7 @@ class AudioHomeActivity : ...@@ -477,7 +477,7 @@ class AudioHomeActivity :
if (reason == Constants.USER_OFFLINE_DROPPED) { if (reason == Constants.USER_OFFLINE_DROPPED) {
YDLavManager.instances.callEndStatusUpdate(channelId, 3, "对方超时掉线") YDLavManager.instances.callEndStatusUpdate(channelId, 3, "对方超时掉线")
} }
leaveChannel() leaveChannel(3)
if (totalDisposable != null) { if (totalDisposable != null) {
totalDisposable?.dispose() totalDisposable?.dispose()
...@@ -802,12 +802,12 @@ class AudioHomeActivity : ...@@ -802,12 +802,12 @@ class AudioHomeActivity :
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "已接通:主叫主动挂断 channelId:${channelId}") .sendRichLog(AliYunLogConfig.AGORA, "已接通:主叫主动挂断 channelId:${channelId}")
updateExpertStatus(false, 1) updateExpertStatus(false, 1)
leaveChannel() leaveChannel(4)
uploadLog() uploadLog()
YDLavManager.instances.callEndStatusUpdate(channelId!!, 5, "主叫挂断") YDLavManager.instances.callEndStatusUpdate(channelId!!, 5, "主叫挂断")
callEventSave("51", "已接通:主叫主动挂断") callEventSave("51", "已接通:主叫主动挂断")
} else { } else {
userCloseCalling() userCloseCalling(4)
} }
ActionCountUtils.count( ActionCountUtils.count(
...@@ -1094,7 +1094,7 @@ class AudioHomeActivity : ...@@ -1094,7 +1094,7 @@ class AudioHomeActivity :
uploadLog() uploadLog()
showToast("暂时无法接通,建议稍后尝试") showToast("暂时无法接通,建议稍后尝试")
userCloseCalling() userCloseCalling(7)
} }
} }
...@@ -1167,7 +1167,7 @@ class AudioHomeActivity : ...@@ -1167,7 +1167,7 @@ class AudioHomeActivity :
* 注意:这个方法只在专家还未接听的状态才能调用 * 注意:这个方法只在专家还未接听的状态才能调用
* *
*/ */
private fun userCloseCalling() { private fun userCloseCalling(reason: Int) {
callEventSave("32", "未接听时:主叫(用户)主动挂断,取消呼叫") callEventSave("32", "未接听时:主叫(用户)主动挂断,取消呼叫")
writeAgoraLog("未接听时:主叫(用户)主动挂断,取消呼叫") writeAgoraLog("未接听时:主叫(用户)主动挂断,取消呼叫")
...@@ -1190,7 +1190,7 @@ class AudioHomeActivity : ...@@ -1190,7 +1190,7 @@ class AudioHomeActivity :
uploadLog() uploadLog()
handler?.postDelayed({ handler?.postDelayed({
LogUtil.e("离开频道") LogUtil.e("离开频道")
leaveChannel() leaveChannel(reason)
}, 100) }, 100)
} }
...@@ -1228,7 +1228,7 @@ class AudioHomeActivity : ...@@ -1228,7 +1228,7 @@ class AudioHomeActivity :
// 如果声网未连接成功,切换axb的弹框是自动弹出的,当关闭弹框的时候,执行用户挂断操作 // 如果声网未连接成功,切换axb的弹框是自动弹出的,当关闭弹框的时候,执行用户挂断操作
// 如果声网连接成功,点击右上角按钮弹出切换axb弹框,但是关闭时用户不执行挂断操作 // 如果声网连接成功,点击右上角按钮弹出切换axb弹框,但是关闭时用户不执行挂断操作
if (!isConnectSuccess) { if (!isConnectSuccess) {
userCloseCalling() userCloseCalling(-1)
} }
} }
}) })
...@@ -1285,7 +1285,7 @@ class AudioHomeActivity : ...@@ -1285,7 +1285,7 @@ class AudioHomeActivity :
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断 channelId:${channelId}") .sendRichLog(AliYunLogConfig.AGORA, "未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断 channelId:${channelId}")
} }
leaveChannel() leaveChannel(8)
} }
} }
...@@ -1438,7 +1438,7 @@ class AudioHomeActivity : ...@@ -1438,7 +1438,7 @@ class AudioHomeActivity :
}, { }, {
LogUtil.d(it.message) LogUtil.d(it.message)
}, { }, {
leaveChannel() leaveChannel(9)
uploadLog() uploadLog()
callEventSave("50", "倾诉时间已用完") callEventSave("50", "倾诉时间已用完")
YDLavManager.instances.callEndStatusUpdate(channelId!!, 50, "倾诉时间已用完") YDLavManager.instances.callEndStatusUpdate(channelId!!, 50, "倾诉时间已用完")
...@@ -1516,8 +1516,10 @@ class AudioHomeActivity : ...@@ -1516,8 +1516,10 @@ class AudioHomeActivity :
/** /**
* 声网离开频道 * 声网离开频道
* 未知-1拒绝1网络连接被服务器禁止2对方掉线或离开3主动挂断或取消4被叫接听超时7转AXB8倾诉时间用完9
* 出异常10,加入通道超时11,声网Error12,页面销毁13
*/ */
fun leaveChannel() { fun leaveChannel(reason: Int) {
LogUtil.e("调用leaveChannel方法,isLeavelChannel=$isLeavelChannel") LogUtil.e("调用leaveChannel方法,isLeavelChannel=$isLeavelChannel")
if (!isLeavelChannel) { if (!isLeavelChannel) {
isLeavelChannel = true isLeavelChannel = true
...@@ -1529,7 +1531,7 @@ class AudioHomeActivity : ...@@ -1529,7 +1531,7 @@ class AudioHomeActivity :
//播放结束音频 //播放结束音频
playFinishMusic() playFinishMusic()
// 声网离开房间 // 声网离开房间
AudioApiRequestUtil.reportCallEvent(channelId, RtcEvent(RtcEvent.Event.leave)) AudioApiRequestUtil.reportCallEvent(channelId, RtcEvent(RtcEvent.Event.leave), retCode = reason)
voiceManage?.getVoiceApi()?.leaveChannel() voiceManage?.getVoiceApi()?.leaveChannel()
} }
} }
......
...@@ -96,7 +96,7 @@ class NetQuality( ...@@ -96,7 +96,7 @@ class NetQuality(
if (reason == Constants.REMOTE_AUDIO_REASON_NETWORK_CONGESTION && state == Constants.REMOTE_AUDIO_STATE_FROZEN) { if (reason == Constants.REMOTE_AUDIO_REASON_NETWORK_CONGESTION && state == Constants.REMOTE_AUDIO_STATE_FROZEN) {
val qualityValue = MMKV.defaultMMKV().getString("network_quality_config", "0") val qualityValue = MMKV.defaultMMKV().getString("network_quality_config", "0")
if (TextUtils.equals(qualityValue, "1")) { if (TextUtils.equals(qualityValue, "1")) {
if (System.currentTimeMillis() - lastOnRemoteNetworkCongestion > 10 * 1000) { if (System.currentTimeMillis() - lastOnRemoteNetworkCongestion > 30 * 1000) {
lastOnRemoteNetworkCongestion = System.currentTimeMillis() lastOnRemoteNetworkCongestion = System.currentTimeMillis()
voiceManage?.getVoiceApi() voiceManage?.getVoiceApi()
?.playEffect(3001, getNetLowEffect(activity)) ?.playEffect(3001, getNetLowEffect(activity))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment