Commit 8cea9b7d by 万齐军

埋点

parent 248e4ca9
......@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2'
componentVersion = "0.3.0.47.7-SNAPSHOT"
componentVersion = "0.3.0.47.11-SNAPSHOT"
}
repositories {
mavenCentral()
......
......@@ -32,6 +32,7 @@ import com.ydl.audioim.bean.AgoraLogInfoBean
import com.ydl.audioim.contract.IAudioHomeActivityContract
import com.ydl.audioim.http.AudioApiRequestUtil
import com.ydl.audioim.http.AudioNetAPi
import com.ydl.audioim.http.LeaveChannelReason
import com.ydl.audioim.http.RtcEvent
import com.ydl.audioim.http.command.ConnectCommand
import com.ydl.audioim.http.command.ConnectExceptionCommand
......@@ -66,6 +67,7 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.log.XLog
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.ToastUtil
......@@ -435,7 +437,7 @@ class AudioHomeActivity :
// com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断")
//通话结束或挂断时,上传日志文件
uploadLog()
leaveChannel(2)
leaveChannel(10)
}
}
......@@ -477,7 +479,7 @@ class AudioHomeActivity :
if (reason == Constants.USER_OFFLINE_DROPPED) {
YDLavManager.instances.callEndStatusUpdate(channelId, 3, "对方超时掉线")
}
leaveChannel(3)
leaveChannel(if (reason == Constants.USER_OFFLINE_DROPPED) 3 else 4)
if (totalDisposable != null) {
totalDisposable?.dispose()
......@@ -802,12 +804,12 @@ class AudioHomeActivity :
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "已接通:主叫主动挂断 channelId:${channelId}")
updateExpertStatus(false, 1)
leaveChannel(4)
leaveChannel(0)
uploadLog()
YDLavManager.instances.callEndStatusUpdate(channelId!!, 5, "主叫挂断")
YDLavManager.instances.callEndStatusUpdate(channelId!!, 51, "主叫挂断")
callEventSave("51", "已接通:主叫主动挂断")
} else {
userCloseCalling(4)
userCloseCalling(0)
}
ActionCountUtils.count(
......@@ -1094,7 +1096,7 @@ class AudioHomeActivity :
uploadLog()
showToast("暂时无法接通,建议稍后尝试")
userCloseCalling(7)
userCloseCalling(6)
}
}
......@@ -1285,7 +1287,7 @@ class AudioHomeActivity :
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断 channelId:${channelId}")
}
leaveChannel(8)
leaveChannel(5)
}
}
......@@ -1438,7 +1440,7 @@ class AudioHomeActivity :
}, {
LogUtil.d(it.message)
}, {
leaveChannel(9)
leaveChannel(7)
uploadLog()
callEventSave("50", "倾诉时间已用完")
YDLavManager.instances.callEndStatusUpdate(channelId!!, 50, "倾诉时间已用完")
......@@ -1531,7 +1533,12 @@ class AudioHomeActivity :
//播放结束音频
playFinishMusic()
// 声网离开房间
AudioApiRequestUtil.reportCallEvent(channelId, RtcEvent(RtcEvent.Event.leave), retCode = reason)
if (reason in 0..11) {
val from = LeaveChannelReason.getFrom(reason)
AudioApiRequestUtil.reportCallEvent(channelId, RtcEvent(RtcEvent.Event.leave), retCode = from, errorCode = reason)
} else {
XLog.e("audiohomeActivity", "leaveChannel$reason")
}
voiceManage?.getVoiceApi()?.leaveChannel()
}
}
......
......@@ -234,3 +234,26 @@ class DeviceEvent(event: Event) :
}
}
object LeaveChannelReason {
val LeaveChannelReasonNormal = 0
val LeaveChannelReasonRefuse = 1
val LeaveChannelReasonCancel = 2
val LeaveChannelReasonOfflineWithError = 3
val LeaveChannelReasonOfflineNormal = 4
val LeaveChannelReasonTurnToAXB = 5
val LeaveChannelReasonAnswerTimeOut = 6
val LeaveChannelReasonSystemTimeup = 7
val LeaveChannelReasonJoinChannelTimeOut = 8
val LeaveChannelReasonRtcError = 9
val LeaveChannelReasonKickedByServer = 10
val LeaveChannelReasonPageError = 11
fun getFrom(reason: Int): Int {
return when (reason) {
1, 3, 4, 6, 8 -> 2
7, 10 -> 0
else -> 1
}
}
}
......@@ -30,6 +30,7 @@ import com.ydl.audioim.R
import com.ydl.audioim.YDLavManager
import com.ydl.audioim.http.AudioApiRequestUtil
import com.ydl.audioim.http.AudioNetAPi
import com.ydl.audioim.http.LeaveChannelReason
import com.ydl.audioim.http.RtcEvent
import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.http.command.PayLoad
......@@ -59,6 +60,7 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.log.XLog
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.user.api.service.IUserService
......@@ -281,7 +283,7 @@ class ConsultantAudioHomeActivity :
uploadLog()
// leaveChannel()
// finish()
close(RESULT_ANSWERED_CODE, "")
close(RESULT_ANSWERED_CODE, "", 10)
}
}
......@@ -339,7 +341,7 @@ class ConsultantAudioHomeActivity :
totalDisposable!!.dispose()
}
//通知php 通话已结束
close(RESULT_ANSWERED_CODE, "")
close(RESULT_ANSWERED_CODE, "", if (elapsed == 1) 3 else 4)
}
}
......@@ -806,7 +808,7 @@ class ConsultantAudioHomeActivity :
YDLavManager.instances.callEndStatusUpdate(mAudioMessageBean?.channelId!!, 2, "被叫主动拒绝")
writeAgoraLog("通话接通后挂断:专家主动挂断")
//正常接听 挂断电话 需要重置信令管理类状态
close(RESULT_ANSWERED_CODE, "")
close(RESULT_ANSWERED_CODE, "", 0)
}
}
......@@ -988,7 +990,7 @@ class ConsultantAudioHomeActivity :
}
//关闭本页面
fun close(code: Int, msg: String) {
fun close(code: Int, msg: String, reason: Int = -1) {
runOnUiThread {
LogUtil.e("[agora]close(code:$code,msg:$msg)")
AliYunRichLogsHelper.getInstance()
......@@ -1005,7 +1007,7 @@ class ConsultantAudioHomeActivity :
//离开频道
AliYunRichLogsHelper.getInstance().sendRichLog(AliYunLogConfig.AGORA, "咨询用户端:已接听,正常挂断 channelId:${mAudioMessageBean?.channelId}")
leaveChannel()
leaveChannel(reason)
}
RESULT_NOT_ANSWERED_CODE -> {
callStatus = 2
......@@ -1093,10 +1095,16 @@ class ConsultantAudioHomeActivity :
/**
* 离开频道
*/
private fun leaveChannel() {
private fun leaveChannel(reason: Int) {
uploadException("", "zhu", "108")
totalDisposable?.dispose()
connectingStatusDisposable?.dispose()
if (reason in 0..11) {
val from = LeaveChannelReason.getFrom(reason)
AudioApiRequestUtil.reportCallEvent(mAudioMessageBean?.channelId, RtcEvent(RtcEvent.Event.leave), retCode = from, errorCode = reason)
} else {
XLog.e("audiohomeActivity", "leaveChannel$reason")
}
voiceManage?.getVoiceApi()?.leaveChannel()
voiceManage = null
mPlayer?.clear()
......@@ -1164,7 +1172,7 @@ class ConsultantAudioHomeActivity :
LogUtil.e("http-------------onDestory")
AliYunRichLogsHelper.getInstance().sendRichLog(AliYunLogConfig.AGORA, "咨询用户端:onDestroy channelId:${mAudioMessageBean?.channelId}")
leaveChannel()
leaveChannel(11)
voiceDestory()
isConnectSuccess = false
status = STATUS_NOT_ANSWERED
......
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